auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public synchronized void returnConnection(PoolEntry entry) throws IOException { if (entry.isExpired()) { entry.connection.close(); } else { <START> connections.put(entry.getKey(), entry); <END> } }</code><technical_language>This is place add entry pool, is fill pool</technical_language>

Target:
public synchronized void returnConnection(PoolEntry entry) throws IOException { if (entry.isExpired()) { closeAsynchronously(entry); } else { connections.put(entry.getKey(), entry); } }
Source:
<code>private void ensureUnequal(CloudFindToken token1, CloudFindToken token2) { assertFalse("Tokens should match", token1.equals(token2)); <START> assertFalse("Tokens should match", token1.hashCode() == token2.hashCode()); <END> }</code><technical_language>remove hashcode check conflicts possible</technical_language>

Target:
private void ensureUnequal(CloudFindToken token1, CloudFindToken token2) { assertFalse("Tokens should match", token1.equals(token2)); }
Source:
<code>protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performRuntime(context, operation, model); ServiceName serviceName = TRACER_CAPABILITY.getCapabilityServiceName(context.getCurrentAddressValue()); ServiceBuilder builder = context.getServiceTarget().addService(serviceName); String outboundSocketBindingName = TracerAttributes.SENDER_BINDING.resolveModelAttribute(context, model).asStringOrNull(); Supplier<OutboundSocketBinding> outboundSocketBindingSupplier; if (outboundSocketBindingName != null) { outboundSocketBindingSupplier = builder.requires(OUTBOUND_SOCKET_BINDING_CAPABILITY.getCapabilityServiceName(outboundSocketBindingName)); } else { <START> outboundSocketBindingSupplier = new Supplier<OutboundSocketBinding>() { <END> @Override public OutboundSocketBinding get() { return null; } }; } TracerConfiguration config = new JaegerTracerConfiguration(context, operation, outboundSocketBindingSupplier); OpentracingConfigurationService.installTracerConfigurationService(builder, config, serviceName); }</code><technical_language>replace this anonymous class with: org.wildfly.common.function.Functions.constantSupplier(null);</technical_language>

Target:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performRuntime(context, operation, model); CapabilityServiceBuilder builder = context.getCapabilityServiceTarget().addCapability(TRACER_CAPABILITY); String outboundSocketBindingName = TracerAttributes.SENDER_BINDING.resolveModelAttribute(context, model).asStringOrNull(); Supplier<OutboundSocketBinding> outboundSocketBindingSupplier; if (outboundSocketBindingName != null) { outboundSocketBindingSupplier = builder.requiresCapability(OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, OutboundSocketBinding.class, outboundSocketBindingName); } else { outboundSocketBindingSupplier = () -> null; } TracerConfiguration config = new JaegerTracerConfiguration(context, operation, outboundSocketBindingSupplier); Consumer<TracerConfiguration> injector = builder.provides(TRACER_CAPABILITY); builder.setInstance(new Service() { @Override public void start(StartContext context) { injector.accept(config); WildFlyTracerFactory.registerTracer(config.getName()).accept(config); } @Override public void stop(StopContext context) { WildFlyTracerFactory.registerTracer(config.getName()).accept(null); } }); builder.setInitialMode(ON_DEMAND).install(); }
Source:
<code>public AnimatedFactoryV2Impl( PlatformBitmapFactory platformBitmapFactory, ExecutorSupplier executorSupplier, CountingMemoryCache<CacheKey, CloseableImage> backingCache, boolean downscaleFrameToDrawableDimensions, SerialExecutorService serialExecutorServiceForFramePreparing) { mPlatformBitmapFactory = platformBitmapFactory; mExecutorSupplier = executorSupplier; mBackingCache = backingCache; mDownscaleFrameToDrawableDimensions = downscaleFrameToDrawableDimensions; <START> this.mSerialExecutorService = serialExecutorServiceForFramePreparing; <END> }</code><technical_language>this. is required</technical_language>

Target:
public AnimatedFactoryV2Impl( PlatformBitmapFactory platformBitmapFactory, ExecutorSupplier executorSupplier, CountingMemoryCache<CacheKey, CloseableImage> backingCache, boolean downscaleFrameToDrawableDimensions, SerialExecutorService serialExecutorServiceForFramePreparing) { mPlatformBitmapFactory = platformBitmapFactory; mExecutorSupplier = executorSupplier; mBackingCache = backingCache; mDownscaleFrameToDrawableDimensions = downscaleFrameToDrawableDimensions; mSerialExecutorService = serialExecutorServiceForFramePreparing; }
Source:
<code>public Map<String, Object> queryFilterParams(DocumentReference user, NotificationFormat format) { <START> Map<String, Object> params = new ConcurrentHashMap<>(); <END> try { for (NotificationPreferenceScope scope : modelBridge.getNotificationPreferenceScopes(user, format)) { final String suffix = String.format(PREFIX_FORMAT, Integer.toHexString(scope.getEventType().hashCode())); final String wikiParam = "wiki_%s"; switch (scope.getScopeReference().getType()) { case DOCUMENT: params.put(String.format(wikiParam, suffix), scope.getScopeReference().extractReference( EntityType.WIKI).getName()); params.put(String.format("page_%s", suffix), serializer.serialize(scope.getScopeReference())); break; case SPACE: params.put(String.format(wikiParam, suffix), scope.getScopeReference().extractReference( EntityType.WIKI).getName()); params.put(String.format("space_%s", suffix), escape(serializer.serialize(scope.getScopeReference())) + ".%" ); break; case WIKI: params.put(String.format(wikiParam, suffix), scope.getScopeReference().extractReference( EntityType.WIKI).getName()); break; default: break; } } } catch (NotificationException e) { logger.warn(ERROR, e); } return params; }</code><technical_language>explain why</technical_language>

Target:
public Map<String, Object> queryFilterParams(DocumentReference user, NotificationFormat format) { Map<String, Object> params = new HashMap<>(); try { for (NotificationPreferenceScope scope : modelBridge.getNotificationPreferenceScopes(user, format)) { final String suffix = String.format(PREFIX_FORMAT, Integer.toHexString(scope.getEventType().hashCode())); final String wikiParam = "wiki_%s"; switch (scope.getScopeReference().getType()) { case DOCUMENT: params.put(String.format(wikiParam, suffix), scope.getScopeReference().extractReference( EntityType.WIKI).getName()); params.put(String.format("page_%s", suffix), serializer.serialize(scope.getScopeReference())); break; case SPACE: params.put(String.format(wikiParam, suffix), scope.getScopeReference().extractReference( EntityType.WIKI).getName()); params.put(String.format("space_%s", suffix), escape(serializer.serialize(scope.getScopeReference())) + ".%" ); break; case WIKI: params.put(String.format(wikiParam, suffix), scope.getScopeReference().extractReference( EntityType.WIKI).getName()); break; default: break; } } } catch (NotificationException e) { logger.warn(ERROR, e); } return params; }
Source:
<code>public void initialize(final RequestMonitor rm) { <START> super.initialize(new RequestMonitor(getExecutor(), rm) { <END> @Override protected void handleSuccess() { doInitialize(rm); } }); }</code><technical_language>ImmediateRequestMonitor in this case. some race issues long do this for service in initialize() method</technical_language>

Target:
public void initialize(final RequestMonitor rm) { super.initialize(new ImmediateRequestMonitor(rm) { @Override protected void handleSuccess() { doInitialize(rm); } }); }
Source:
<code>private void subscribeSelectionUpdated(@UIEventTopic(UIEvents.Item.TOPIC_SELECTED) Event event) { <START> if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MMenuItem)) <END> return; MMenuItem itemModel = (MMenuItem) event.getProperty(UIEvents.EventTags.ELEMENT); IContributionItem ici = getContribution(itemModel); if (ici != null) { ici.update(); } }</code><technical_language>code-style: brackets</technical_language>

Target:
private void subscribeSelectionUpdated(@UIEventTopic(UIEvents.Item.TOPIC_SELECTED) Event event) { Object property = event.getProperty(UIEvents.EventTags.ELEMENT); if (!(property instanceof MMenuItem)) { return; } MMenuItem itemModel = (MMenuItem) property; IContributionItem ici = getContribution(itemModel); if (ici != null) { ici.update(); } }
Source:
<code><START> public boolean isAtSCCBoundary(final Node node) { <END> final CommunicationGroup ownGroup = this.groupMap.get(node); assert ownGroup != null; for (final Node source : this.dependencyGraph.getSourceNodes(node).keySet()) { final CommunicationGroup otherGroup = this.groupMap.get(source); assert otherGroup != null; if (!ownGroup.equals(otherGroup)) { return true; } } for (final Node target : this.dependencyGraph.getTargetNodes(node).keySet()) { final CommunicationGroup otherGroup = this.groupMap.get(target); assert otherGroup != null; if (!ownGroup.equals(otherGroup)) { return true; } } return false; }</code><technical_language>in case of fall-through flag, some special cases handled separately (DualInputNodes, non-active nodes, dispatcher nodes?). of relevant here</technical_language>

Target:
public boolean isAtSCCBoundary(final Node node) { final CommunicationGroup ownGroup = this.groupMap.get(node); assert ownGroup != null; for (final Node source : this.dependencyGraph.getSourceNodes(node).keySet()) { final CommunicationGroup otherGroup = this.groupMap.get(source); assert otherGroup != null; if (!ownGroup.equals(otherGroup)) { return true; } } return false; }
Source:
<code>private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; String formattedClassName = String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS); try { actionType = Class.forName(formattedClassName); } catch (ClassNotFoundException cnfe) { <START> log.debug("StorageHelperDirector Error:: the lookup for following class has failed: " <END> + formattedClassName, cnfe); } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { log.error("StorageHelperDirector Error:: exception was encountered during InitializeHelpers() execution", ex); throw new ApplicationException("JTODO missing exception", ex); } }</code><technical_language>Please change log.debugFormat()</technical_language>

Target:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; String formattedClassName = String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS); try { actionType = Class.forName(formattedClassName); } catch (ClassNotFoundException cnfe) { log.debugFormat("StorageHelperDirector Error:: the lookup for following class has failed: " + formattedClassName, cnfe); } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { log.error("StorageHelperDirector Error:: exception was encountered during InitializeHelpers() execution", ex); throw new ApplicationException("JTODO missing exception", ex); } }
Source:
<code>public SPromise deserialize(final DeserializationBuffer sb) { byte state = sb.get(); assert state >= 0 && state <= 2; if (state > 0) { Object value = sb.getReference(); SPromise p = SPromise.createResolved( EventualMessage.getActorCurrentMessageIsExecutionOn(), value, state == 1 ? Resolution.SUCCESSFUL : Resolution.ERRONEOUS); if (DeserializationBuffer.needsFixup(value)) { sb.installFixup(new PromiseValueFixup(p)); } return p; } else { SPromise promise = SPromise.createPromise( EventualMessage.getActorCurrentMessageIsExecutionOn(), false, false, null); int whenResolvedCnt = sb.getShort(); for (int i = 0; i < whenResolvedCnt; i++) { PromiseMessage pm = (PromiseMessage) sb.getReference(); promise.registerWhenResolvedUnsynced(pm); } int onErrorCnt = sb.getShort(); for (int i = 0; i < onErrorCnt; i++) { PromiseMessage pm = (PromiseMessage) sb.getReference(); promise.registerOnErrorUnsynced(pm); } int chainedPromCnt = sb.getShort(); for (int i = 0; i < chainedPromCnt; i++) { SPromise remote = (SPromise) sb.getReference(); promise.addChainedPromise(remote); } return promise; } <START> } <END></code><technical_language>another one</technical_language>

Target:
public SPromise deserialize(final DeserializationBuffer sb) { byte state = sb.get(); assert state >= 0 && state <= 2; if (state > 0) { return deserializeCompletedPromise(state, sb); } else { return deserializeUnresolvedPromise(sb); } }
Source:
<code>public boolean isCallPermitted() { <START> final boolean callPermitted = semaphore.tryAcquire(); <END> publishBulkheadEvent( () -> callPermitted ? new BulkheadOnCallPermittedEvent(name) : new BulkheadOnCallRejectedEvent(name) ); return callPermitted; }</code><technical_language>Do sense waiting time configurable? Please a [SemaphoreBasedRateLimiter](<LINK_0></technical_language>

Target:
public boolean isCallPermitted() { boolean callPermitted = tryEnterBulkhead(); publishBulkheadEvent( () -> callPermitted ? new BulkheadOnCallPermittedEvent(name) : new BulkheadOnCallRejectedEvent(name) ); return callPermitted; }
Source:
<code>public void testWriteAndReadFromPipe() throws IOException, InterruptedException, ExecutionException, TimeoutException { final SAMRecordSetBuilder builder = new SAMRecordSetBuilder(false, SortOrder.unsorted); for (int i=1; i<= 5000; ++i) { builder.addPair("q" + i, 0, i, i); } final File fifo = File.createTempFile("fifo", ""); Assert.assertTrue(fifo.delete()); fifo.deleteOnExit(); final Process exec = new ProcessBuilder("mkfifo", fifo.getAbsolutePath()).start(); exec.waitFor(1, TimeUnit.MINUTES); Assert.assertEquals(exec.exitValue(), 0, "mkfifo failed with exit code " + 0); for (final SamInputResource res : Arrays.asList(SamInputResource.of(fifo), SamInputResource.of(fifo.toPath()))) { ExecutorService executor = null; try { executor = Executors.newSingleThreadExecutor(); final Future<Integer> future = executor.submit(() -> { final SAMFileWriter writer = new SAMFileWriterFactory() .setCreateIndex(false).setCreateMd5File(false).makeBAMWriter(builder.getHeader(), true, fifo); int written = 0; for (SAMRecord read : builder) { writer.addAlignment(read); written += 1; } <START> writer.close(); <END> return written; }); final SamReader in = SamReaderFactory.make().open(res); int count = 0; for (SAMRecord rec : in) { Assert.assertEquals(rec.getReadName(), "q" + rec.getAlignmentStart()); count += 1; } in.close(); Assert.assertEquals(count, builder.size()); Assert.assertEquals(count, future.get().intValue()); } finally { if (executor != null) executor.shutdownNow(); } } }</code><technical_language>try-with-resources avoid need for explicit close</technical_language>

Target:
public void testWriteAndReadFromPipe() throws IOException, InterruptedException, ExecutionException, TimeoutException { final SAMRecordSetBuilder builder = new SAMRecordSetBuilder(false, SortOrder.unsorted); for (int i = 1; i <= 5000; ++i) { builder.addPair("q" + i, 0, i, i); } for (final boolean usePath : CollectionUtil.makeList(true, false)) { final File fifo = File.createTempFile("fifo", ""); Assert.assertTrue(fifo.delete()); fifo.deleteOnExit(); final Process exec = new ProcessBuilder("mkfifo", fifo.getAbsolutePath()).start(); exec.waitFor(1, TimeUnit.MINUTES); Assert.assertEquals(exec.exitValue(), 0, "mkfifo failed with exit code " + 0); ExecutorService executor = null; try { executor = Executors.newSingleThreadExecutor(); final Future<Integer> future = executor.submit(() -> { try (final SAMFileWriter writer = new SAMFileWriterFactory() .setCreateIndex(false) .setCreateMd5File(false) .makeBAMWriter(builder.getHeader(), true, fifo)) { int written = 0; for (final SAMRecord read : builder) { writer.addAlignment(read); written += 1; } return written; } }); final SamInputResource res = usePath ? SamInputResource.of(fifo.toPath()) : SamInputResource.of(fifo); int count = 0; try (final SamReader in = SamReaderFactory.make().open(res)) { for (final SAMRecord rec : in) { Assert.assertEquals(rec.getReadName(), "q" + rec.getAlignmentStart()); count += 1; } } Assert.assertEquals(count, builder.size()); Assert.assertEquals(count, future.get().intValue()); } finally { if (executor != null) executor.shutdownNow(); } } }
Source:
<code>private void exec(String... command) throws InfrastructureException { <START> LOG.debug( <END> "Executing Pod={} ContainerName={} command={}", kubernetesMachine.getPodName(), kubernetesMachine.getContainerName(), command); namespace .deployments() .exec( kubernetesMachine.getPodName(), kubernetesMachine.getContainerName(), EXEC_TIMEOUT_MIN, command); }</code><technical_language>do need this log for JSON RPC</technical_language>

Target:
private void exec(String... command) throws InfrastructureException { namespace .deployments() .exec( kubernetesMachine.getPodName(), kubernetesMachine.getContainerName(), EXEC_TIMEOUT_MIN, command); }
Source:
<code>private void populateReferences() { <START> if (!fReferenceStructs .isEmpty()) { <END> return; } StructDeclaration ref = new StructDeclaration(ALIGN); EnumDeclaration id = new EnumDeclaration(IntegerDeclaration.createDeclaration(5, false, 10, fByteOrder, Encoding.NONE, "", 1)); id.add(0, 30, "compact"); id.add(31, 31, "extended"); ref.addField("id", id); VariantDeclaration v = new VariantDeclaration(); StructDeclaration compact = new StructDeclaration(1); compact.addField("timestamp", IntegerDeclaration.createDeclaration(27, false, 10, fByteOrder, Encoding.NONE, "", 1)); StructDeclaration extended = new StructDeclaration(8); extended.addField("id", IntegerDeclaration.createDeclaration(32, false, 10, fByteOrder, Encoding.NONE, "", 8)); extended.addField("timestamp", IntegerDeclaration.createDeclaration(64, false, 10, fByteOrder, Encoding.NONE, "", 8)); v.addField("compact", compact); v.addField("extended", extended); ref.addField("v", v); fReferenceStructs.add(ref); }</code><technical_language>white space</technical_language>

Target:
private void populateReferences() { if (!fReferenceStructs.isEmpty()) { return; } StructDeclaration ref = new StructDeclaration(ALIGN_ON_8); EnumDeclaration id = new EnumDeclaration(IntegerDeclaration.createDeclaration(COMPACT_ID, false, BASE_10, fByteOrder, Encoding.NONE, CLOCK, ALIGN_ON_1)); id.add(0, EXTENDED_VALUE - 1, COMPACT); id.add(EXTENDED_VALUE, EXTENDED_VALUE, EXTENDED); ref.addField(ID, id); VariantDeclaration v = new VariantDeclaration(); StructDeclaration compact = new StructDeclaration(ALIGN_ON_1); compact.addField(TIMESTAMP, IntegerDeclaration.createDeclaration(27, false, BASE_10, fByteOrder, Encoding.NONE, CLOCK, ALIGN_ON_1)); StructDeclaration extended = new StructDeclaration(ALIGN_ON_8); extended.addField(ID, IntegerDeclaration.createDeclaration(32, false, BASE_10, fByteOrder, Encoding.NONE, CLOCK, ALIGN_ON_8)); extended.addField(TIMESTAMP, IntegerDeclaration.createDeclaration(64, false, BASE_10, fByteOrder, Encoding.NONE, CLOCK, ALIGN_ON_8)); v.addField(COMPACT, compact); v.addField(EXTENDED, extended); ref.addField(VARIANT_NAME, v); fReferenceStructs.add(ref); }
Source:
<code>private void validatePersonAddresses(Person person, Errors errors) { int index = 0; for (PersonAddress address : person.getAddresses()) { try { errors.pushNestedPath("addresses[" + index + "]"); personAddressValidator.validate(address, errors); } <START> catch (NullPointerException exception) { <END> continue; } finally { errors.popNestedPath(); index++; } } }</code><technical_language>intentionally ignoring null pointer exception</technical_language>

Target:
private void validatePersonAddresses(Person person, Errors errors) { int index = 0; for (PersonAddress address : person.getAddresses()) { try { errors.pushNestedPath("addresses[" + index + "]"); ValidationUtils.invokeValidator(personAddressValidator, address, errors); } finally { errors.popNestedPath(); index++; } } }
Source:
<code>private List<Partition> batchGetPartitions(AWSGlueAsync glueClient, String tableName) throws IOException { List<Partition> partitions = new ArrayList<>(); try { GetPartitionsRequest getPartitionsRequest = new GetPartitionsRequest() .withCatalogId(mGlueConfiguration.get(Property.CATALOG_ID)) .withDatabaseName(mGlueDbName) .withTableName(tableName); if (glueClient.getPartitions(getPartitionsRequest).getPartitions() != null) { partitions = glueClient.getPartitions(getPartitionsRequest).getPartitions(); <START> LOG.debug("Get partitions from Table Database {}.", <END> partitions.size(), tableName, mGlueDbName); partitions.stream().forEach(partition -> LOG.debug("Get partition: {}, from table Database {}.", partition.toString(), tableName, partition.getDatabaseName())); } return partitions; } catch (AWSGlueException e) { throw new IOException("Cannot get partition information for table: " + tableName + " in Database: " + mGlueDbName + "; Catalog ID: " + mGlueConfiguration.get(Property.CATALOG_ID) + ". error: " + e.getMessage(), e); } }</code><technical_language>helpful for this message distinct other messages, this "Glue table {}.{} partitions."</technical_language>

Target:
private List<Partition> batchGetPartitions(AWSGlueAsync glueClient, String tableName) throws IOException { List<Partition> partitions = new ArrayList<>(); try { GetPartitionsRequest getPartitionsRequest = new GetPartitionsRequest() .withCatalogId(mGlueConfiguration.get(Property.CATALOG_ID)) .withDatabaseName(mGlueDbName) .withTableName(tableName); if (glueClient.getPartitions(getPartitionsRequest).getPartitions() != null) { partitions = glueClient.getPartitions(getPartitionsRequest).getPartitions(); LOG.info("Glue table {}.{} has partitions.", mGlueDbName, tableName, partitions.size()); if (LOG.isDebugEnabled()) { partitions.stream().forEach(partition -> LOG.debug("Glue table {}.{} with partition: {}.", partition.getDatabaseName(), tableName, partition.toString())); } } return partitions; } catch (AWSGlueException e) { throw new IOException("Cannot get partition information for table: " + tableName + " in Database: " + mGlueDbName + "; Catalog ID: " + mGlueConfiguration.get(Property.CATALOG_ID) + ". error: " + e.getMessage(), e); } }
Source:
<code>private void closeRAF() { <START> if(!(closed || lockLevel == 0)) throw new IllegalStateException(); <END> if(raf == null) return; try { raf.close(); } catch (IOException e) { Logger.error(this, "Error closing "+this+" : "+e, e); } raf = null; OPEN_FDS--; }</code><technical_language>Writing this if(!closed && lockLevel != 0) instead of negated disjunction allows for easier recognition of this condition holds</technical_language>

Target:
private void closeRAF() { if(!closed && lockLevel != 0) throw new IllegalStateException(); if(raf == null) return; try { raf.close(); } catch (IOException e) { Logger.error(this, "Error closing "+this+" : "+e, e); } raf = null; OPEN_FDS--; }
Source:
<code>public StreamDefinitionResource instantiateModel(StreamDefinition stream) { final StreamDefinitionResource resource = new StreamDefinitionResource(stream.getName(), <START> new ArgumentSanitizer().sanitizeStream(stream), stream.getOriginalDslText(), stream.getDescription()); <END> DeploymentState deploymentState = streamDeploymentStates.get(stream); if (deploymentState != null) { final DeploymentStateResource deploymentStateResource = ControllerUtils .mapState(deploymentState); resource.setStatus(deploymentStateResource.getKey()); resource.setStatusDescription(deploymentStateResource.getDescription()); } return resource; }</code><technical_language>sanitize original well</technical_language>

Target:
public StreamDefinitionResource instantiateModel(StreamDefinition stream) { final StreamDefinitionResource resource = new StreamDefinitionResource(stream.getName(), new ArgumentSanitizer().sanitizeStream(stream), new ArgumentSanitizer().sanitizeOriginalStreamDsl(stream), stream.getDescription()); DeploymentState deploymentState = streamDeploymentStates.get(stream); if (deploymentState != null) { final DeploymentStateResource deploymentStateResource = ControllerUtils .mapState(deploymentState); resource.setStatus(deploymentStateResource.getKey()); resource.setStatusDescription(deploymentStateResource.getDescription()); } return resource; }
Source:
<code>public void shouldHaveImmutableSpliterator() { <START> assertThat(of('1', '2', '3').spliterator().hasCharacteristics(Spliterator.IMMUTABLE)); <END> }</code><technical_language>assertion .isTrue() missing</technical_language>

Target:
public void shouldHaveImmutableSpliterator() { assertThat(of('1', '2', '3').spliterator().hasCharacteristics(Spliterator.IMMUTABLE)).isTrue(); }
Source:
<code>public void put(K key, V value) { if (service.isRunning()) { try { String target = buildUrl(service.cacheName, key); Invocation put = service.getHttpClient().target(target).request().accept(service.getContentType()) .buildPut(Entity.entity(encodeObject(value), service.getContentType())); Response response = put.invoke(); int status = response.getStatus(); response.close(); <START> if (status != Status.OK.getStatusCode()) { <END> throw new RuntimeException("RESTEasyHTTPOperations.put::Unexpected HttpStatus: " + status + " " + response.getStatusInfo().getReasonPhrase() + " for request " + target); } } catch (IOException e) { throw new RuntimeException(e); } catch (NullPointerException e) { throw new RuntimeException(e); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } } }</code><technical_language>201 204 fine,</technical_language>

Target:
public void put(K key, V value) { putInternal(key, value, null); }
Source:
<code>private String[] extractStateParams(String state) { final String decodedState; try { decodedState = decode(state, "UTF-8"); } catch (UnsupportedEncodingException e) { <START> throw new RuntimeException(e); <END> } return decodedState.split("&"); }</code><technical_language>is good throw RuntimeException here</technical_language>

Target:
private String[] extractStateParams(String state) { try { String decodedState = decode(state, "UTF-8"); return decodedState.split("&"); } catch (UnsupportedEncodingException ignored) { } return null; }
Source:
<code><START> public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { <END> ImageStore result = _storageService.updateImageStoreStatus(getId(), getReadonly()); ImageStoreResponse storeResponse = null; if (result != null) { storeResponse = _responseGenerator.createImageStoreResponse(result); storeResponse.setResponseName(getCommandName()+"response"); storeResponse.setObjectName("imagestore"); setResponseObject(storeResponse); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update Image store status"); } }</code><technical_language>in MigrateSecondaryStorageDataCmd</technical_language>

Target:
public void execute() { ImageStore result = _storageService.updateImageStoreStatus(getId(), getReadonly()); ImageStoreResponse storeResponse = null; if (result != null) { storeResponse = _responseGenerator.createImageStoreResponse(result); storeResponse.setResponseName(getCommandName()+"response"); storeResponse.setObjectName("imagestore"); setResponseObject(storeResponse); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update Image store status"); } }
Source:
<code>public MasterBenchTaskResult runLocal() throws Exception { ExecutorService service = ExecutorServiceFactories.fixedThreadPool("bench-thread", mParameters.mThreads).create(); RateLimiter rateLimiter = RateLimiter.create(mParameters.mTargetThroughput); mFiledata = new byte[(int) FormatUtils.parseSpaceSize(mParameters.mCreateFileSize)]; Arrays.fill(mFiledata, (byte) 0x7A); long durationMs = FormatUtils.parseTimeSize(mParameters.mDuration); long warmupMs = FormatUtils.parseTimeSize(mParameters.mWarmup); long startMs = mBaseParameters.mStartMs; if (mBaseParameters.mStartMs == BaseParameters.UNDEFINED_START_MS) { startMs = CommonUtils.getCurrentMs() + 1000; } long endMs = startMs + warmupMs + durationMs; BenchContext context = new BenchContext(rateLimiter, startMs, endMs); for (int i = 0; i < mParameters.mThreads; i++) { <START> service.submit(new BenchThread(context, mCachedFs[i % mCachedFs.length])); <END> } WaitForOptions waitOptions = WaitForOptions.defaults().setInterval(5000) .setTimeoutMs((int) (endMs - CommonUtils.getCurrentMs()) + 60000); if (mParameters.mStopCount != MasterBenchParameters.STOP_COUNT_INVALID) { waitOptions = WaitForOptions.defaults().setInterval(5000).setTimeoutMs(10 * Constants.MINUTE_MS); } CommonUtils.waitFor("Threads to terminate", () -> context.getTerminated().get() == mParameters.mThreads, waitOptions); service.shutdownNow(); service.awaitTermination(30, TimeUnit.SECONDS); return context.getResult(); }</code><technical_language>executors service's InvokeAll method instead? clean some of this code: <LINK_0></technical_language>

Target:
public MasterBenchTaskResult runLocal() throws Exception { ExecutorService service = ExecutorServiceFactories.fixedThreadPool("bench-thread", mParameters.mThreads).create(); RateLimiter rateLimiter = RateLimiter.create(mParameters.mTargetThroughput); mFiledata = new byte[(int) FormatUtils.parseSpaceSize(mParameters.mCreateFileSize)]; Arrays.fill(mFiledata, (byte) 0x7A); long durationMs = FormatUtils.parseTimeSize(mParameters.mDuration); long warmupMs = FormatUtils.parseTimeSize(mParameters.mWarmup); long startMs = mBaseParameters.mStartMs; if (mBaseParameters.mStartMs == BaseParameters.UNDEFINED_START_MS) { startMs = CommonUtils.getCurrentMs() + 1000; } long endMs = startMs + warmupMs + durationMs; BenchContext context = new BenchContext(rateLimiter, startMs, endMs); List<Callable<Void>> callables = new ArrayList<>(mParameters.mThreads); for (int i = 0; i < mParameters.mThreads; i++) { callables.add(new BenchThread(context, mCachedFs[i % mCachedFs.length])); } service.invokeAll(callables, 10, TimeUnit.MINUTES); service.shutdownNow(); service.awaitTermination(30, TimeUnit.SECONDS); return context.getResult(); }
Source:
<code>private String toString( Object obj ) { String str; if ( obj != null && obj.getClass().isArray() ) { int n = Array.getLength( obj ); StringBuilder buf = new StringBuilder( 256 ); buf.append( '[' ); for ( int i = 0; i < n; i++ ) { if ( i > 0 ) { buf.append( ", " ); } <START> buf.append( String.valueOf( Array.get( obj, i ) ) ); <END> } buf.append( ']' ); str = buf.toString(); } else { str = String.valueOf( obj ); } return str; }</code><technical_language>Consider StringJoiner and/or Stream API</technical_language>

Target:
private String toString( Object obj ) { String str; if ( obj != null && obj.getClass().isArray() ) { int n = Array.getLength( obj ); StringBuilder buf = new StringBuilder( 256 ); StringJoiner sj = new StringJoiner( ", ", "[", "]" ); for ( int i = 0; i < n; i++ ) { sj.add( String.valueOf( Array.get( obj, i ) ) ); } buf.append( sj.toString() ); str = buf.toString(); } else { str = String.valueOf( obj ); } return str; }
Source:
<code>public GenericMessage<?> convert(DBObject source) { <START> return new GenericMessage<Object>(source.get("payload"), (Map<String, Object>) source.get("headers")); <END> }</code><technical_language>need fix ID timestamp, is done in read() ?</technical_language>

Target:
public GenericMessage convert(DBObject source) { MessageReadingMongoConverter converter = (MessageReadingMongoConverter) MongoDbMessageStore.this.template.getConverter(); Map<String, Object> headers = converter.normalizeHeaders((Map<String, Object>) source.get("headers")); Object payload = source.get("payload"); Object payloadType = source.get(PAYLOAD_TYPE_KEY); if (payloadType != null && payload instanceof DBObject) { try { Class<?> payloadClass = ClassUtils.forName(payloadType.toString(), classLoader); payload = converter.read(payloadClass, (DBObject) payload); } catch (Exception e) { throw new IllegalStateException("failed to load class: " + payloadType, e); } } GenericMessage message = new GenericMessage(payload, headers); Map innerMap = (Map) new DirectFieldAccessor(message.getHeaders()).getPropertyValue("headers"); innerMap.put(MessageHeaders.ID, headers.get(MessageHeaders.ID)); innerMap.put(MessageHeaders.TIMESTAMP, headers.get(MessageHeaders.TIMESTAMP)); return message; }
Source:
<code>public void getHighestUid_imapConnectionThrowsNegativesResponse_shouldReturnMinus1() throws Exception { ImapFolder folder = createFolder("Folder"); prepareImapFolderForOpen(OPEN_MODE_RW); List<ImapResponse> imapResponses = singletonList(createImapResponse("* SEARCH 42")); when(imapConnection.executeSimpleCommand("UID SEARCH *:*")) .thenThrow(NegativeImapResponseException.class); folder.open(OPEN_MODE_RW); long result = folder.getHighestUid(); <START> assertEquals(-1L, result); <END> }</code><technical_language>assertEquals(-1L, folder.getHighestUid());</technical_language>

Target:
public void getHighestUid_imapConnectionThrowsNegativesResponse_shouldReturnMinus1() throws Exception { ImapFolder folder = createFolder("Folder"); prepareImapFolderForOpen(OPEN_MODE_RW); when(imapConnection.executeSimpleCommand("UID SEARCH *:*")) .thenThrow(NegativeImapResponseException.class); folder.open(OPEN_MODE_RW); assertEquals(-1L, folder.getHighestUid()); }
Source:
<code>public int hashCode() { <START> return this.cluster.length() + this.path.length(); <END> }</code><technical_language>This a pretty weak version of hashCode(). HashCodeBuilder generate hash code</technical_language>

Target:
public int hashCode() { return new HashCodeBuilder() .append(this.cluster) .append(this.path) .toHashCode(); }
Source:
<code>public void execute(SensorContext context) { if (rules.length == 0) { <START> LOG.info("Skipping execution of eslint-based rules because none of them are activated"); <END> return; } startEslintBridgeServerProcess(); if (process == null) { return; } try { for (InputFile inputFile : getInputFiles(context)) { analyze(inputFile, context); } } finally { clean(); } }</code><technical_language>I this DEBUG</technical_language>

Target:
public void execute(SensorContext context) { if (rules.length == 0) { LOG.debug("Skipping execution of eslint-based rules because none of them are activated"); return; } startEslintBridgeServerProcess(); if (process == null) { return; } try { for (InputFile inputFile : getInputFiles(context)) { analyze(inputFile, context); } } finally { clean(); } }
Source:
<code>private static String quote(String text, char quoteChar) { if (text == null || text.isEmpty()) return emptyQuoted(quoteChar); int nbMatch = 0; int start = -1; do { start = text.indexOf(quoteChar, start + 1); if (start != -1) ++nbMatch; } while (start != -1); <START> <END> int newLength = 2 + text.length() + nbMatch; char[] result = new char[newLength]; result[0] = quoteChar; result[newLength - 1] = quoteChar; int newIdx = 1; for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (c == quoteChar) { result[newIdx++] = c; result[newIdx++] = c; } else { result[newIdx++] = c; } } return new String(result); }</code><technical_language>cool a fast exit if nbMatch == 0</technical_language>

Target:
private static String quote(String text, char quoteChar) { if (text == null || text.isEmpty()) return emptyQuoted(quoteChar); int nbMatch = 0; int start = -1; do { start = text.indexOf(quoteChar, start + 1); if (start != -1) ++nbMatch; } while (start != -1); if (nbMatch == 0) return quoteChar + text + quoteChar; int newLength = 2 + text.length() + nbMatch; char[] result = new char[newLength]; result[0] = quoteChar; result[newLength - 1] = quoteChar; int newIdx = 1; for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (c == quoteChar) { result[newIdx++] = c; result[newIdx++] = c; } else { result[newIdx++] = c; } } return new String(result); }
Source:
<code>static LedgerMetadataBuilder from(LedgerMetadata other) { LedgerMetadataBuilder builder = new LedgerMetadataBuilder(); builder.ensembleSize = other.getEnsembleSize(); builder.writeQuorumSize = other.getWriteQuorumSize(); builder.ackQuorumSize = other.getAckQuorumSize(); builder.state = other.getState(); long lastEntryId = other.getLastEntryId(); if (lastEntryId != LedgerHandle.INVALID_ENTRY_ID) { builder.lastEntryId = Optional.of(lastEntryId); } builder.ensembles.putAll(other.getEnsembles()); builder.digestType = other.getDigestType(); if (other.hasPassword()) { builder.password = Optional.of(other.getPassword()); } if (other.storeSystemtimeAsLedgerCreationTime) { builder.ctime = Optional.of(other.getCtime()); } <START> builder.customMetadata.putAll(other.getCustomMetadata()); <END> builder.version = other.getVersion(); return builder; }</code><technical_language>changing builder pattern, I suggest making structures immutable if (!other.getCustomerMetadata.isEmpty()) { builder.cutomMetadata = ImmutableMap.of(other.getCustomMetadata()); }</technical_language>

Target:
static LedgerMetadataBuilder from(LedgerMetadata other) { LedgerMetadataBuilder builder = new LedgerMetadataBuilder(); builder.ensembleSize = other.getEnsembleSize(); builder.writeQuorumSize = other.getWriteQuorumSize(); builder.ackQuorumSize = other.getAckQuorumSize(); builder.state = other.getState(); long lastEntryId = other.getLastEntryId(); if (lastEntryId != LedgerHandle.INVALID_ENTRY_ID) { builder.lastEntryId = Optional.of(lastEntryId); } builder.ensembles.putAll(other.getEnsembles()); builder.digestType = other.getDigestType(); if (other.hasPassword()) { builder.password = Optional.of(other.getPassword()); } if (other.storeSystemtimeAsLedgerCreationTime) { builder.ctime = Optional.of(other.getCtime()); } builder.customMetadata = ImmutableMap.copyOf(other.getCustomMetadata()); builder.version = other.getVersion(); return builder; }
Source:
<code>public void close() throws ItemStreamException { if (!ignoreItemStream && delegate instanceof ItemStream) { ((ItemStream) delegate).close(); } <START> } <END></code><technical_language>Removing configuration option simplifies of methods</technical_language>

Target:
public void close() throws ItemStreamException { if (delegate instanceof ItemStream) { ((ItemStream) delegate).close(); } }
Source:
<code>public static TrackingMode fromString(String trackingMode) { if(trackingMode == null) { return null; } switch(trackingMode){ case "trackingAll": return TRACK_ALL; case "discardedOnly": return TRACK_DISCARDED_ONLY; <START> case "trackingOff": <END> return TRACKING_OFF; default: return TRACKING_OFF; } }</code><technical_language>java case "trackingOff": default: return TRACKING_OFF;</technical_language>

Target:
public static Optional<TrackingMode> fromString(String trackingMode) { if(trackingMode == null) { return Optional.empty(); } switch(trackingMode){ case "trackingAll": return Optional.of(TRACK_ALL); case "discardedOnly": return Optional.of(TRACK_DISCARDED_ONLY); case "trackingOff": default: return Optional.of(TRACKING_OFF); } }
Source:
<code>public boolean getSslEnabledDb() { String ssl = env.get("TWILIO_DISABLE_DB_SSL"); <START> if (ssl != null && ssl.compareToIgnoreCase("true") == 0) { <END> return false; } else { return true; } }</code><technical_language>This method replaced return !Boolean.parseBoolean(env.get("TWILIO_DISABLE_DB_SSL"));</technical_language>

Target:
public boolean getSslEnabledDb() { return !Boolean.parseBoolean(env.get("TWILIO_DISABLE_DB_SSL")); }
Source:
<code>static Checksum forURL(URL url) throws IOException { try { MessageDigest md = MessageDigest.getInstance(JarLoaderImpl.DIGEST_ALGORITHM); <START> try(OutputStream ostream = new DigestOutputStream(new NullOutputStream(), md)) { <END> Util.copy(url.openStream(), ostream); return new Checksum(md.digest(), md.getDigestLength() / 8); } } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }</code><technical_language>If concerned NullOutputStream leaking (impossible), java try (NullOutputStream nos = new NullOutputStream(); OutputStream ostream = new DigestOutputStream(nos)) {</technical_language>

Target:
static Checksum forURL(URL url) throws IOException { try { MessageDigest md = MessageDigest.getInstance(JarLoaderImpl.DIGEST_ALGORITHM); try(InputStream istsream = url.openStream(); OutputStream ostream = new DigestOutputStream(new NullOutputStream(), md)) { Util.copy(istsream, ostream); return new Checksum(md.digest(), md.getDigestLength() / 8); } } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
Source:
<code>public static int getTID(IDMContext context) { IMIExecutionDMContext execContext = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class); int tid = 0; if (execContext != null) { try { tid = Integer.parseInt(execContext.getThreadId()); <START> } catch (NumberFormatException e) { <END> } } return tid; }</code><technical_language>Add assert eventually catch case a tid string is passed translate int? ex: tid = "1.1". This trigger need adapt code new PIDs</technical_language>

Target:
public static int getTID(IDMContext context) { IMIExecutionDMContext execContext = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class); int tid = 0; if (execContext != null) { try { tid = Integer.parseInt(execContext.getThreadId()); } catch (NumberFormatException e) { assert false : "The thread id does not convert to an integer: " + execContext.getThreadId(); } } return tid; }
Source:
<code>public void testConsumerRejoinAfterRebalance() throws Exception { long waitTimeout = 5_000; try (ConsumerCoordinator coordinator = prepareCoordinatorForCloseTest(true, true, Optional.of("group-id"))) { coordinator.ensureActiveGroup(); prepareOffsetCommitRequest(singletonMap(t1p, 100L), Errors.REBALANCE_IN_PROGRESS); assertThrows(CommitFailedException.class, () -> coordinator.commitOffsetsSync( singletonMap(t1p, new OffsetAndMetadata(100L)), time.timer(Long.MAX_VALUE))); assertFalse(client.hasPendingResponses()); assertFalse(client.hasInFlightRequests()); AtomicBoolean res = new AtomicBoolean(); <START> Thread th = new Thread(() -> { <END> coordinator.joinGroupIfNeeded(time.timer(Long.MAX_VALUE)); res.set(true); }); th.start(); client.waitForRequests(1, waitTimeout); client.respond(joinGroupFollowerResponse(1, "consumer", "leader", Errors.NONE)); waitForCondition(() -> coordinator.generation.generationId != OffsetCommitRequest.DEFAULT_GENERATION_ID, waitTimeout, "JoinGroup response handled."); client.waitForRequests(1, waitTimeout); client.respond(joinGroupFollowerResponse(1, "consumer", "leader", Errors.NONE)); client.waitForRequests(1, waitTimeout); coordinator.maybeLeaveGroup("Clear generation data."); client.respond(syncGroupResponse(singletonList(t1p), Errors.NONE)); th.join(); assertTrue(res.get()); assertFalse(client.hasPendingResponses()); assertFalse(client.hasInFlightRequests()); } }</code><technical_language>clear want a separate thread call joinGroupIfNeeded? In unit test try avoid unnecessary multi-threading easily flaky tests</technical_language>

Target:
public void testConsumerRejoinAfterRebalance() throws Exception { try (ConsumerCoordinator coordinator = prepareCoordinatorForCloseTest(true, false, Optional.of("group-id"))) { coordinator.ensureActiveGroup(); prepareOffsetCommitRequest(singletonMap(t1p, 100L), Errors.REBALANCE_IN_PROGRESS); assertThrows(CommitFailedException.class, () -> coordinator.commitOffsetsSync( singletonMap(t1p, new OffsetAndMetadata(100L)), time.timer(Long.MAX_VALUE))); assertFalse(client.hasPendingResponses()); assertFalse(client.hasInFlightRequests()); int generationId = 42; String memberId = "consumer-42"; client.prepareResponse(joinGroupFollowerResponse(generationId, memberId, "leader", Errors.NONE)); MockTime time = new MockTime(1); boolean res = coordinator.joinGroupIfNeeded(time.timer(2)); assertFalse(res); assertFalse(client.hasPendingResponses()); assertEquals(1, client.inFlightRequestCount()); assertEquals(generationId, coordinator.generation().generationId); assertEquals(memberId, coordinator.generation().memberId); coordinator.maybeLeaveGroup("Clear generation data."); assertEquals(AbstractCoordinator.Generation.NO_GENERATION, coordinator.generation()); client.respond(syncGroupResponse(singletonList(t1p), Errors.NONE)); res = coordinator.joinGroupIfNeeded(time.timer(1)); assertFalse(res); assertFalse(client.hasPendingResponses()); assertFalse(client.hasInFlightRequests()); } }
Source:
<code>public void dispose() { super.dispose(); getSite().getPage().removePostSelectionListener(this); RegistryFactory.getRegistry().removeListener(this); SaveablesList saveables = (SaveablesList) getSite().getService(ISaveablesLifecycleListener.class); <START> saveables.removeModelLifecycleListener(saveablesTracker); <END> currentPart = null; currentSelection = null; pinPropertySheetAction = null; }</code><technical_language>check for null</technical_language>

Target:
public void dispose() { super.dispose(); getSite().getPage().removePostSelectionListener(this); RegistryFactory.getRegistry().removeListener(this); SaveablesList saveables = (SaveablesList) getSite().getService(ISaveablesLifecycleListener.class); if (saveables != null) { saveables.removeModelLifecycleListener(saveablesTracker); } currentPart = null; currentSelection = null; pinPropertySheetAction = null; }
Source:
<code>public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { <START> GoLiteralValue literal = ObjectUtils.tryCast(descriptor.getStartElement(), GoLiteralValue.class); <END> GoStructType structType = getStructType(literal); List<GoElement> elements = structType != null ? literal.getElementList() : emptyList(); List<String> fieldDefinitionNames = structType != null ? getFieldDefinitionsNames(structType) : emptyList(); if (!areElementsNamesMatchesDefinitions(getNames(elements), fieldDefinitionNames)) return; replaceElementsByNamed(elements, fieldDefinitionNames, project); }</code><technical_language>startElement null invalid. check</technical_language>

Target:
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = ObjectUtils.tryCast(descriptor.getStartElement(), GoElement.class); GoLiteralValue literal = element != null && element.isValid() ? PsiTreeUtil.getParentOfType(element, GoLiteralValue.class) : null; List<GoElement> elements = literal != null ? literal.getElementList() : emptyList(); List<GoNamedElement> definitions = getFieldDefinitions(getLiteralStructType(literal)); if (!areElementsKeysMatchesDefinitions(elements, definitions)) return; addKeysToElements(project, elements, definitions); }
Source:
<code>public PinotQueryGeneratorContext visitProject(ProjectNode node, PinotQueryGeneratorContext contextIn) { PinotQueryGeneratorContext context = node.getSource().accept(this, contextIn); <START> requireNonNull(context, "context is null"); <END> LinkedHashMap<VariableReferenceExpression, Selection> newSelections = new LinkedHashMap<>(); node.getOutputVariables().forEach(variable -> { RowExpression expression = node.getAssignments().get(variable); PinotExpression pinotExpression = expression.accept(new PinotProjectExpressionConverter(typeManager, functionMetadataManager, session), context.getSelections()); newSelections.put( variable, new Selection(pinotExpression.getDefinition(), pinotExpression.getOrigin())); }); return context.withProject(newSelections); }</code><technical_language>this function private static belongs PinotQueryGenerator instead of visitor</technical_language>

Target:
public PinotQueryGeneratorContext visitProject(ProjectNode node, PinotQueryGeneratorContext contextIn) { PinotQueryGeneratorContext context = node.getSource().accept(this, contextIn); requireNonNull(context, "context is null"); LinkedHashMap<VariableReferenceExpression, Selection> newSelections = new LinkedHashMap<>(); node.getOutputVariables().forEach(variable -> { RowExpression expression = node.getAssignments().get(variable); PinotExpression pinotExpression = expression.accept( contextIn.getVariablesInAggregation().contains(variable) ? new PinotAggregationProjectConverter(typeManager, functionMetadataManager, standardFunctionResolution, session) : pinotProjectExpressionConverter, context.getSelections()); newSelections.put( variable, new Selection(pinotExpression.getDefinition(), pinotExpression.getOrigin())); }); return context.withProject(newSelections); }