auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void main(String[] args) { Class<?>[] testClasses; try { testClasses = new Class<?>[]{ <START> Class.forName(ReceiveAndDeleteMessageTest.class.getName()), <END> Class.forName(ReceiveAndLockMessageTest.class.getName()), Class.forName(SendMessageTest.class.getName()), Class.forName(SendMessagesTest.class.getName()) }; } catch (ClassNotFoundException e) { throw new RuntimeException(e); } PerfStressProgram.run(testClasses, args); }</code><technical_language>I this statement is ReceiveAndDeleteMessageTest.class</technical_language>

Target:
public static void main(String[] args) { Class<?>[] testClasses; testClasses = new Class<?>[]{ ReceiveAndDeleteMessageTest.class, ReceiveAndLockMessageTest.class, SendMessageTest.class, SendMessagesTest.class }; PerfStressProgram.run(testClasses, args); }
Source:
<code>private void zoom(final double zoomFactor) { <START> scale = scale * zoomFactor; <END> repaintNow = true; repaint(); }</code><technical_language>this scale *= zoomFactor</technical_language>

Target:
private void zoom(final double zoomFactor) { scale *= zoomFactor; repaintNow = true; repaint(); }
Source:
<code>private void populateAuthorsAndMingleCards(List<StageFeedEntry> stageEntries, String pipelineName, Username username) { List<Long> pipelineIds = new ArrayList<>(); for (StageFeedEntry stageEntry : stageEntries) { pipelineIds.add(stageEntry.getPipelineId()); } CruiseConfig config = goConfigService.currentCruiseConfig(); Map<Long, List<ModificationForPipeline>> revisionsPerPipeline = changesetService.modificationsOfPipelines(pipelineIds, pipelineName, username); for (StageFeedEntry stageEntry : stageEntries) { List<ModificationForPipeline> revs = revisionsPerPipeline.get(stageEntry.getPipelineId()); for (ModificationForPipeline rev : revs) { Author author = rev.getAuthor(); if (author != null) { stageEntry.addAuthor(author); } String pipelineForRev = rev.getPipelineId().getPipelineName(); if (config.hasPipelineNamed(new CaseInsensitiveString(pipelineForRev))) { PipelineConfig pipelineConfig = config.pipelineConfigByName(new CaseInsensitiveString(pipelineForRev)); MingleConfig mingleConfig = pipelineConfig.getMingleConfig(); Set<String> cardNos = rev.getCardNumbersFromComments(); if (mingleConfig.isDefined()) { for (String cardNo : cardNos) { stageEntry.addCard(new MingleCard(mingleConfig, cardNo)); } } } else { <START> LOGGER.debug("pipeline not found: " + pipelineForRev); <END> } } } }</code><technical_language>change</technical_language>

Target:
private void populateAuthorsAndMingleCards(List<StageFeedEntry> stageEntries, String pipelineName, Username username) { List<Long> pipelineIds = new ArrayList<>(); for (StageFeedEntry stageEntry : stageEntries) { pipelineIds.add(stageEntry.getPipelineId()); } CruiseConfig config = goConfigService.currentCruiseConfig(); Map<Long, List<ModificationForPipeline>> revisionsPerPipeline = changesetService.modificationsOfPipelines(pipelineIds, pipelineName, username); for (StageFeedEntry stageEntry : stageEntries) { List<ModificationForPipeline> revs = revisionsPerPipeline.get(stageEntry.getPipelineId()); for (ModificationForPipeline rev : revs) { Author author = rev.getAuthor(); if (author != null) { stageEntry.addAuthor(author); } String pipelineForRev = rev.getPipelineId().getPipelineName(); if (config.hasPipelineNamed(new CaseInsensitiveString(pipelineForRev))) { PipelineConfig pipelineConfig = config.pipelineConfigByName(new CaseInsensitiveString(pipelineForRev)); MingleConfig mingleConfig = pipelineConfig.getMingleConfig(); Set<String> cardNos = rev.getCardNumbersFromComments(); if (mingleConfig.isDefined()) { for (String cardNo : cardNos) { stageEntry.addCard(new MingleCard(mingleConfig, cardNo)); } } } else { LOGGER.debug("pipeline not found: {}", pipelineForRev); } } } }
Source:
<code>public void testUavg() throws IOException, ProcCallException { String[] columnNames = {"Number"}; String[] columnValues = {"1", "2", "3", "4"}; <START> testFunction("Uavg(Number)", 2.5, VoltType.FLOAT, columnNames, columnValues); <END> }</code><technical_language>Test aggregate function called more column: select Uavg(Number1), Uavg(Number2) t Test aggregate function group clause, clause, clause, join, order by..</technical_language>

Target:
public void testUavg() throws IOException, ProcCallException { String[] columnNames = {"NUM"}; String[][] columnValues = {{"1", "2", "3", "4"}}; Object[] expected = {2.5D}; testFunction("uavg(NUM)", expected, VoltType.FLOAT, columnNames, columnValues); }
Source:
<code>public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) { final BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(getName()); return new StringFirstBufferAggregator(null, null, maxStringBytes) { @Override public void aggregate(ByteBuffer buf, int position) { SerializablePairLongString pair = (SerializablePairLongString) selector.getObject(); <START> if (pair != null && pair.rhs != null) { <END> ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); long lastTime = mutationBuffer.getLong(position); if (pair.lhs < lastTime) { mutationBuffer.putLong(position, pair.lhs); byte[] valueBytes = StringUtils.toUtf8(pair.rhs); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }</code><technical_language>This a bug. lastTime checked pair.rhs is null</technical_language>

Target:
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) { final BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(getName()); return new StringFirstBufferAggregator(null, null, maxStringBytes) { @Override public void aggregate(ByteBuffer buf, int position) { SerializablePairLongString pair = (SerializablePairLongString) selector.getObject(); if (pair != null && pair.lhs != null) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); long lastTime = mutationBuffer.getLong(position); if (pair.lhs < lastTime) { mutationBuffer.putLong(position, pair.lhs); if (pair.rhs != null) { byte[] valueBytes = StringUtils.toUtf8(pair.rhs); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } else { mutationBuffer.putInt(position + Long.BYTES, 0); } } } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }
Source:
<code>public String getProcessFilePath(final HWND hwnd) { final byte[] filePath = new byte[256]; final IntByReference pid = new IntByReference(); User32.INSTANCE.GetWindowThreadProcessId(hwnd, pid); final HANDLE process = Kernel32.INSTANCE.OpenProcess( 0x0400 | 0x0010, false, pid.getValue()); if (process == null && Kernel32.INSTANCE.GetLastError() != 5) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); final int length = Psapi.INSTANCE.GetModuleFileNameExA(process, <START> null, filePath, filePath.length); <END> if (length == 0 && Kernel32.INSTANCE.GetLastError() != 6) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); return Native.toString(filePath).trim(); }</code><technical_language>If this is internal, prefer unicode versions of functions avoid issues ASCII conversions. Call -W version of function a char[] buffer instead</technical_language>

Target:
public String getProcessFilePath(final HWND hwnd) { final char[] filePath = new char[1025]; final IntByReference pid = new IntByReference(); User32.INSTANCE.GetWindowThreadProcessId(hwnd, pid); final HANDLE process = Kernel32.INSTANCE.OpenProcess( WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ, false, pid.getValue()); if (process == null && Kernel32.INSTANCE.GetLastError() != WinNT.ERROR_ACCESS_DENIED) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); final int length = Psapi.INSTANCE.GetModuleFileNameExW(process, null, filePath, filePath.length); if (length == 0 && Kernel32.INSTANCE.GetLastError() != WinNT.ERROR_INVALID_HANDLE) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); return Native.toString(filePath).trim(); }
Source:
<code>public Double getRowCount(Intersect rel, RelMetadataQuery mq) { Double rowCount = null; for (RelNode input : rel.getInputs()) { Double partialRowCount = mq.getRowCount(input); if (rowCount == null || partialRowCount != null && partialRowCount < rowCount) { rowCount = partialRowCount; } } if (!rel.all) { return rowCount; } else { <START> return rowCount * 2; <END> } }</code><technical_language>IMO, return row count is bigger max row count of inputs</technical_language>

Target:
public Double getRowCount(Intersect rel, RelMetadataQuery mq) { Double rowCount = null; for (RelNode input : rel.getInputs()) { Double partialRowCount = mq.getRowCount(input); if (rowCount == null || partialRowCount != null && partialRowCount < rowCount) { rowCount = partialRowCount; } } if (!rel.all) { return rowCount; } else { if (rowCount != null) { return rowCount * 2; } else { return rowCount; } } }
Source:
<code>public void executionForDeletionByKey() throws Exception { final String key = randomKey(); <START> final CategoryDraft draft = CategoryDraftBuilder.of(randomSlug(), randomSlug()).key(key).build(); <END> final Category category = client().executeBlocking(CategoryCreateCommand.of(draft)); client().executeBlocking(CategoryDeleteCommand.ofKey(key,category.getVersion())); assertThat(client().executeBlocking(CategoryQuery.of().byId(category.getId())).head()).isEmpty(); }</code><technical_language>replacing randomSlug() call a new method SphereTestUtils.randomLocalizedString()</technical_language>

Target:
public void executionForDeletionByKey() throws Exception { final String key = randomKey(); final CategoryDraft draft = CategoryDraftBuilder.of(randomLocalizedString(), randomSlug()).key(key).build(); final Category category = client().executeBlocking(CategoryCreateCommand.of(draft)); client().executeBlocking(CategoryDeleteCommand.ofKey(key,category.getVersion())); assertThat(client().executeBlocking(CategoryQuery.of().byId(category.getId())).head()).isEmpty(); }
Source:
<code>@Test public void smokeTest() throws Exception { <START> int sleepSeconds = -1; <END> switch (platform) { case NATIVE: sleepSeconds = 0; break; case CENTOS: case UBUNTU: case SIMPLE: sleepSeconds = 10; break; case ALPINE: case SLIM: sleepSeconds = 45; break; default: fail("Unknown enum value: " + platform); break; } String script = String.format("echo hello world; sleep %s", sleepSeconds); Controller c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeLog(ws,baos); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertTrue(baos.toString().contains("hello world")); c.cleanup(ws); assertThat(getZombies(), isEmptyString()); }</code><technical_language>suggestion int sleepSeconds;</technical_language>

Target:
@Test public void smokeTest() throws Exception { int sleepSeconds; switch (platform) { case NATIVE: sleepSeconds = 0; break; case CENTOS: case UBUNTU: case NO_INIT: sleepSeconds = 10; break; case ALPINE: case SLIM: sleepSeconds = 45; break; default: throw new AssertionError(platform); } String script = String.format("echo hello world; sleep %s", sleepSeconds); Controller c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeLog(ws,baos); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertTrue(baos.toString().contains("hello world")); c.cleanup(ws); assertThat(getZombies(), isEmptyString()); }
Source:
<code>private void verifyPopoverImageUrlWithHoverRetry( final String popoverSelector, final String hoverSelector, final String urlRegex, String taskName) { RetryManager.runUntilNoException(new RetryableTask(taskName) { @Override public void run() { verifyPopoverImageUrl(popoverSelector, urlRegex); } @Override public void beforeRetry() { moveToElement(By.cssSelector(hoverSelector)); } }, WebDriverException.class); <START> } <END></code><technical_language>If current location is element, moveToElement trigger hover action? jquery hover action is triggered mouse enter mouse leave, I if is action</technical_language>

Target:
private void verifyPopoverImageUrlWithHoverRetry( final String popoverSelector, final String hoverSelector, final String urlRegex, String taskName) throws MaximumRetriesExceededException { uiRetryManager.runUntilNoRecognizedException(new RetryableTask(taskName) { @Override public void run() { verifyPopoverImageUrl(popoverSelector, urlRegex); } @Override public void beforeRetry() { moveToElement(By.cssSelector(hoverSelector)); } }, WebDriverException.class); }
Source:
<code>public ColumnIndices(ColumnIndices other, boolean mutable) { this(other.schemaVersion, new HashMap<Pair<Class<? extends RealmModel>, String>, ColumnInfo>(other.classesToColumnInfo.size()), mutable); for (Map.Entry<Pair<Class<? extends RealmModel>, String>, ColumnInfo> entry : other.classesToColumnInfo.entrySet()) { ColumnInfo columnInfo = entry.getValue().copy(mutable); Pair<Class<? extends RealmModel>, String> oldKey = entry.getKey(); <START> Pair<Class<? extends RealmModel>, String> newKey = Pair.<Class<? extends RealmModel>, String>create(oldKey.first, oldKey.second); <END> this.classes.put(newKey.first, columnInfo); this.classesByName.put(newKey.second, columnInfo); this.classesToColumnInfo.put(newKey, columnInfo); } }</code><technical_language>do need create a new Pair? immutable anyway</technical_language>

Target:
public ColumnIndices(ColumnIndices other, boolean mutable) { this(other.schemaVersion, new HashMap<Pair<Class<? extends RealmModel>, String>, ColumnInfo>(other.classesToColumnInfo.size()), mutable); for (Map.Entry<Pair<Class<? extends RealmModel>, String>, ColumnInfo> entry : other.classesToColumnInfo.entrySet()) { ColumnInfo columnInfo = entry.getValue().copy(mutable); Pair<Class<? extends RealmModel>, String> key = entry.getKey(); this.classes.put(key.first, columnInfo); this.classesByName.put(key.second, columnInfo); this.classesToColumnInfo.put(key, columnInfo); } }
Source:
<code>protected ColumnRealName resolveCompoundColumn(ColumnRealName baseRealName, ConditionOption option) { if (option == null || !option.hasCompoundColumn()) { return baseRealName; } if (!option.hasStringConnector()) { String msg = "The option should have string connector when compound column is specified: " + option; throw new IllegalConditionBeanOperationException(msg); } final List<SpecifiedColumn> compoundColumnList = option.getCompoundColumnList(); final List<ColumnRealName> realNameList = new ArrayList<ColumnRealName>(); if (option.treatsCompoundColumnNullAsEmpty()) { realNameList.add(toColumnRealName("coalesce(" + baseRealName + ",\'\')")); for (SpecifiedColumn specifiedColumn : compoundColumnList) { realNameList.add(toColumnRealName("coalesce(" + doResolveCompoundColumn(option, specifiedColumn) + ",\'\')")); } } else { realNameList.add(baseRealName); for (SpecifiedColumn specifiedColumn : compoundColumnList) { ColumnRealName resolvedColumnRealName = doResolveCompoundColumn(option, specifiedColumn); realNameList.add(resolvedColumnRealName); <START> } <END> } final OnQueryStringConnector stringConnector = option.getStringConnector(); final String connected = stringConnector.connect(realNameList.toArray()); return ColumnRealName.create(null, new ColumnSqlName(connected)); }</code><technical_language>I want refactor this logic if can. Please unify for-statement</technical_language>

Target:
protected ColumnRealName resolveCompoundColumn(ColumnRealName baseRealName, ConditionOption option) { if (option == null || !option.hasCompoundColumn()) { return baseRealName; } if (!option.hasStringConnector()) { String msg = "The option should have string connector when compound column is specified: " + option; throw new IllegalConditionBeanOperationException(msg); } final List<SpecifiedColumn> compoundColumnList = option.getCompoundColumnList(); final List<ColumnRealName> realNameList = new ArrayList<ColumnRealName>(); realNameList.add(doResolveCompoundColumnOption(option, baseRealName)); for (SpecifiedColumn specifiedColumn : compoundColumnList) { realNameList.add(doResolveCompoundColumnOption(option, doResolveCompoundColumnCipher(option, specifiedColumn))); } final OnQueryStringConnector stringConnector = option.getStringConnector(); final String connected = stringConnector.connect(realNameList.toArray()); return ColumnRealName.create(null, new ColumnSqlName(connected)); }
Source:
<code>public void handleMinutesSpentInputChange( ChangeEvent event ) { try { Long value = minutesSpentInput.getValue().isEmpty() ? null : Long.parseLong( minutesSpentInput.getValue() ); presenter.onMinutesSpentChange( value ); } catch ( NumberFormatException e ) { <START> <END> } }</code><technical_language>Likewise.</technical_language>

Target:
public void handleMinutesSpentInputChange( ChangeEvent event ) { boolean isNumeric = minutesSpentInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onMinutesSpentChange( Long.parseLong( minutesSpentInput.getValue() ) ); } else { presenter.onMinutesSpentChange( 0l ); minutesSpentInput.setValue( "0" ); } }
Source:
<code>public void onConnect(String message) { debugView.showPermanently(getString(R.string.connected)); switchableView.setDisplayedChild(1); <START> presenter.startListeningForDirection(); <END> }</code><technical_language>"forward" onConnect presenter instead</technical_language>

Target:
public void onConnect(String message) { debugView.showPermanently(getString(R.string.connected)); switchableView.setDisplayedChild(1); }
Source:
<code>protected Map<ComponentType, Set<DistributionModuleGroup>> buildModuleGroups() { Map<ComponentType, Set<DistributionModuleGroup>> componentsMap = new HashMap<>(); <START> componentsMap.put(ComponentType.HDFS, QuboleHDFSModuleGroup.getModuleGroups()); <END> componentsMap.put(ComponentType.HIVE, QuboleHiveModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIG, QubolePigModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIGOUTPUT, QubolePigOutputModuleGroup.getModuleGroups()); return componentsMap; }</code><technical_language>Needed</technical_language>

Target:
protected Map<ComponentType, Set<DistributionModuleGroup>> buildModuleGroups() { Map<ComponentType, Set<DistributionModuleGroup>> componentsMap = new HashMap<>(); componentsMap.put(ComponentType.HIVE, QuboleHiveModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIG, QubolePigModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIGOUTPUT, QubolePigOutputModuleGroup.getModuleGroups()); return componentsMap; }
Source:
<code>public void run() { long currentTime = System.currentTimeMillis(); long purgeTime; Object[] purgeTimes = new Object[1]; List<VariableExpressionExecutor> variableExpressionExecutorList = new ArrayList<>(); <START> Attribute attribute; <END> VariableExpressionExecutor variableExpressionExecutor; ComplexEventChunk<StateEvent> eventChunk = new ComplexEventChunk<>(true); BaseIncrementalDataPurgingValueStore baseIncrementalDataPurgingValueStore = new BaseIncrementalDataPurgingValueStore(currentTime, streamEventPool); attribute = new Attribute(INTERNAL_AGG_TIMESTAMP_FIELD, Attribute.Type.LONG); variableExpressionExecutor = new VariableExpressionExecutor(attribute, 0, 1); variableExpressionExecutorList.add(variableExpressionExecutor); for (Map.Entry<TimePeriod.Duration, Table> entry : aggregationTables.entrySet()) { if (retentionPeriods.get(entry.getKey()) != -1) { Variable leftVariable = new Variable(INTERNAL_AGG_TIMESTAMP_FIELD); leftVariable.setStreamId(entry.getValue().getTableDefinition().getId()); Compare expression = new Compare(leftVariable, Compare.Operator.LESS_THAN, new Variable(INTERNAL_AGG_TIMESTAMP_FIELD)); purgeTime = currentTime - retentionPeriods.get(entry.getKey()); purgeTimes[0] = purgeTime; StateEvent secEvent = baseIncrementalDataPurgingValueStore.createStreamEvent(purgeTimes); eventChunk.add(secEvent); Table table = aggregationTables.get(entry.getKey()); try { CompiledCondition compiledCondition = table.compileCondition(expression, matchingMetaInfoHolder(table, attribute), siddhiAppContext, variableExpressionExecutorList, tableMap, "query1"); LOG.info("Purging has enable for the table: " + table.getTableDefinition().getId() + " with a" + " retention of timestamp : " + purgeTime); table.deleteEvents(eventChunk, compiledCondition, 1); } catch (Exception e) { LOG.error("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); throw new DataPurgingException("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); } } } }</code><technical_language>name attribute hold. static a constant</technical_language>

Target:
public void run() { long currentTime = System.currentTimeMillis(); long purgeTime; Object[] purgeTimeArray = new Object[1]; for (Map.Entry<TimePeriod.Duration, Table> entry : aggregationTables.entrySet()) { if (!retentionPeriods.get(entry.getKey()).equals(RETAIN_ALL)) { purgeTime = currentTime - retentionPeriods.get(entry.getKey()); purgeTimeArray[0] = purgeTime; StateEvent secEvent = createStreamEvent(purgeTimeArray, currentTime); eventChunk.add(secEvent); Table table = aggregationTables.get(entry.getKey()); try { LOG.info("Purging data of table: " + table.getTableDefinition().getId() + " with a" + " retention of timestamp : " + purgeTime); table.deleteEvents(eventChunk, compiledConditionsHolder.get(entry.getKey()), 1); } catch (RuntimeException e) { LOG.error("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); throw new DataPurgingException("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); } } } }
Source:
<code>public void validateSerialNumber(@RequestBody SerialNumberValidationDto params, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { String serialNumber = params.getSerialNumber(); String maybeContainerId = params.getContainerId(); if (isStringEmptyOrNull(serialNumber) || isStringEmptyOrNull(maybeContainerId)) { throw new RestException("Serial number and containerID must be provided", Status.BAD_REQUEST); } Long containerId = SequencerPartitionContainerImpl.UNSAVED_ID; if (!maybeContainerId.contains("Unsaved")) { containerId = Long.valueOf(maybeContainerId); } try { List<SequencerPartitionContainer> matchingContainers = (List<SequencerPartitionContainer>) containerService .listByBarcode(serialNumber); if (matchingContainers.isEmpty() || (matchingContainers.size() == 1 && matchingContainers.get(0).getId() == containerId)) { return; } else { <START> throw new RestException("Serial number is already associated with another container", Status.PRECONDITION_FAILED); <END> } } catch (IOException e) { String error = String.format("Error looking up containers by serial number '%s'", serialNumber); log.error(error, e); throw new RestException(error); } }</code><technical_language>instances of Status.PRECONDITION_FAILED changed Status.BAD_REQUEST. Precondition failed status refers conditions in request headers - user/application data</technical_language>

Target:
public void validateSerialNumber(@RequestBody SerialNumberValidationDto params, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { String serialNumber = params.getSerialNumber(); String maybeContainerId = params.getContainerId(); if (isStringEmptyOrNull(serialNumber) || isStringEmptyOrNull(maybeContainerId)) { throw new RestException("Serial number and containerID must be provided", Status.BAD_REQUEST); } final Long containerId = (maybeContainerId.contains("Unsaved") ? SequencerPartitionContainerImpl.UNSAVED_ID : Long.valueOf(Integer.valueOf(maybeContainerId))); List<SequencerPartitionContainer> matchingContainers = (List<SequencerPartitionContainer>) containerService .listByBarcode(serialNumber); if (!matchingContainers.isEmpty() && matchingContainers.stream().noneMatch(spc -> spc.getId() == containerId)) { throw new RestException("Serial number is already associated with another container", Status.BAD_REQUEST); } }
Source:
<code>public void testFileBatchInputFormatText() throws Exception { <START> String filePath = "file:/ END> String testData = "String for testing purposes"; Path textFile = new Path(filePath); Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(conf); FSDataOutputStream writeData = fs.create(textFile); writeData.write(testData.getBytes()); writeData.flush(); writeData.close(); ETLStage source = new ETLStage( "source", new ETLPlugin("File", BatchSource.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put(Constants.Reference.REFERENCE_NAME, "TestFile") .put(Properties.File.FILESYSTEM, "Text") .put(Properties.File.PATH, filePath) .put(Properties.File.FILE_SOURCE_FORMAT, "text") .put(Properties.File.IGNORE_NON_EXISTING_FOLDERS, "false") .build(), null)); String outputDatasetName = "test-filesource-text"; ETLStage sink = new ETLStage("sink", MockSink.getPlugin(outputDatasetName)); ETLBatchConfig etlConfig = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(BATCH_ARTIFACT, etlConfig); ApplicationId appId = NamespaceId.DEFAULT.app("FileSourceTextFormat"); ApplicationManager appManager = deployApplication(appId, appRequest); WorkflowManager workflowManager = appManager.getWorkflowManager(SmartWorkflow.NAME); workflowManager.start(); workflowManager.waitForRuns(ProgramRunStatus.COMPLETED, 1, 2, TimeUnit.MINUTES); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(1, output.size()); Assert.assertEquals(testData, output.get(0).get("body")); }</code><technical_language>hardcoding a directory this is bad practice, assumes system permission write location, clean itself, break if some other test writes directory. TemporaryFolder variable in this class create a new temporary folder for this test case</technical_language>

Target:
public void testFileBatchInputFormatText() throws Exception { File fileText = new File(temporaryFolder.newFolder(), "test.txt"); String outputDatasetName = "test-filesource-text"; Schema textSchema = Schema.recordOf("file.record", Schema.Field.of("offset", Schema.of(Schema.Type.LONG)), Schema.Field.of("body", Schema.nullableOf(Schema.of(Schema.Type.STRING))), Schema.Field.of("file", Schema.nullableOf(Schema.of( Schema.Type.STRING)))); ApplicationManager appManager = createSourceAndDeployApp(fileText, "text", outputDatasetName, textSchema); FileUtils.writeStringToFile(fileText, "Hello,World!"); workflowStartAndWait(appManager); List<StructuredRecord> expected = ImmutableList.of( StructuredRecord.builder(textSchema) .set("offset", (long)0) .set("body", "Hello,World!") .set("file", fileText.toURI().toString()) .build() ); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(output, expected); }
Source:
<code>public byte toByte() { <START> switch (this) { <END> case CORE: return 1; case LEAF: return 2; default: throw new IllegalStateException(); } }</code><technical_language>return fByteValue;</technical_language>

Target:
public byte toByte() { return fByte; }
Source:
<code>public GroupedExecutionProperties visitTableScan(TableScanNode node, Void context) { Optional<TablePartitioning> tablePartitioning = metadata.getLayout(session, node.getTable()).getTablePartitioning(); if (!tablePartitioning.isPresent()) { return GroupedExecutionProperties.notCapable(); } List<ConnectorPartitionHandle> partitionHandles = nodePartitioningManager.listPartitionHandles(session, tablePartitioning.get().getPartitioningHandle()); boolean recoveryEligible = metadata.getConnectorCapabilities(session, node.getTable().getConnectorId()).contains(SUPPORTS_REWINDABLE_SPLIT_SOURCE); boolean useful = isGroupedExecutionForAllEligibleTableScansEnabled(session); if (ImmutableList.of(NOT_PARTITIONED).equals(partitionHandles)) { <START> return new GroupedExecutionProperties(false, useful, ImmutableList.of(), 1, recoveryEligible); <END> } else { return new GroupedExecutionProperties(true, useful, ImmutableList.of(node.getId()), partitionHandles.size(), recoveryEligible); } }</code><technical_language>I feel GroupedExecutionProperties#useful renamed. do in this PR</technical_language>

Target:
public GroupedExecutionProperties visitTableScan(TableScanNode node, Void context) { Optional<TablePartitioning> tablePartitioning = metadata.getLayout(session, node.getTable()).getTablePartitioning(); if (!tablePartitioning.isPresent()) { return GroupedExecutionProperties.notCapable(); } List<ConnectorPartitionHandle> partitionHandles = nodePartitioningManager.listPartitionHandles(session, tablePartitioning.get().getPartitioningHandle()); boolean recoveryEligible = metadata.getConnectorCapabilities(session, node.getTable().getConnectorId()).contains(SUPPORTS_REWINDABLE_SPLIT_SOURCE); boolean useful = isGroupedExecutionForEligibleTableScansEnabled(session); if (ImmutableList.of(NOT_PARTITIONED).equals(partitionHandles)) { return new GroupedExecutionProperties(false, useful, ImmutableList.of(), 1, recoveryEligible); } else { return new GroupedExecutionProperties(true, useful, ImmutableList.of(node.getId()), partitionHandles.size(), recoveryEligible); } }
Source:
<code>public String toString() { <START> return "MemberCandidate{" + <END> "candidate=" + candidate + ", member=" + member + ", richUser=" + richUser + '}'; }</code><technical_language>if PerunBean, please similar toString: MemberCandidate:[content]</technical_language>

Target:
public String toString() { return getClass().getSimpleName()+ ":[" + "candidate='" + candidate + "', member='" + member + "', richUser='" + richUser + "']"; }
Source:
<code>public F.Promise<Result> pop() { <START> return cmsService().get(userContext().locale(), "pop").flatMap(cms -> { <END> final ProductOverviewPageContent pageData = new ProductOverviewPageContent(cms); return view().map(view -> ok(view.productOverviewPage(pageData))); }); }</code><technical_language>I extract a method, write: java getPage("pop").flatMap(cms -> {</technical_language>

Target:
public F.Promise<Result> pop() { return withCms("pop", cms -> { final ProductOverviewPageContent content = new ProductOverviewPageContent(cms); return render(view -> ok(view.productOverviewPage(content))); }); }
Source:
<code><START> public <T> Future<T> submit(Callable<T> task) { <END> final Callable<T> callable = doWrapOrThrowException(task, controlPoint); try { return super.submit(doIdentityWrap(callable)); } catch (RejectedExecutionException e) { controlPoint.requestComplete(); throw e; } }</code><technical_language>this is ok, for exception request completed, RejectedException</technical_language>

Target:
public <T> Future<T> submit(Callable<T> task) { final Callable<T> callable = doWrap(task, controlPoint); try { return super.submit(doIdentityWrap(callable)); } catch (Exception e) { controlPoint.requestComplete(); throw e; } }
Source:
<code>private Object invokeParser(InputStream inputStream, Function<io.crate.protocols.postgres.antlr.v4.PgArrayParser, ParserRuleContext> parseFunction, Function<byte[], Object> convert) { try { var lexer = new PgArrayLexer(CharStreams.fromStream( inputStream, <START> Charset.forName("UTF-8"))); <END> var tokenStream = new CommonTokenStream(lexer); var parser = new io.crate.protocols.postgres.antlr.v4.PgArrayParser(tokenStream); lexer.removeErrorListeners(); lexer.addErrorListener(ERROR_LISTENER); parser.removeErrorListeners(); parser.addErrorListener(ERROR_LISTENER); ParserRuleContext tree; try { parser.getInterpreter().setPredictionMode(PredictionMode.SLL); tree = parseFunction.apply(parser); } catch (ParseCancellationException ex) { tokenStream.seek(0); parser.reset(); parser.getInterpreter().setPredictionMode(PredictionMode.LL); tree = parseFunction.apply(parser); } return new PgArrayASTVisitor(convert).visit(tree); } catch (StackOverflowError e) { throw new PgArrayParsingException("stack overflow while parsing: " + e.getLocalizedMessage()); } catch (IOException e) { return new IllegalArgumentException(e); } }</code><technical_language>suggestion StandardCharsets.UTF_8));</technical_language>

Target:
private Object invokeParser(InputStream inputStream, Function<io.crate.protocols.postgres.antlr.v4.PgArrayParser, ParserRuleContext> parseFunction, Function<byte[], Object> convert) { try { var lexer = new PgArrayLexer(CharStreams.fromStream( inputStream, StandardCharsets.UTF_8)); var tokenStream = new CommonTokenStream(lexer); var parser = new io.crate.protocols.postgres.antlr.v4.PgArrayParser(tokenStream); lexer.removeErrorListeners(); lexer.addErrorListener(ERROR_LISTENER); parser.removeErrorListeners(); parser.addErrorListener(ERROR_LISTENER); ParserRuleContext tree; try { parser.getInterpreter().setPredictionMode(PredictionMode.SLL); tree = parseFunction.apply(parser); } catch (ParseCancellationException ex) { tokenStream.seek(0); parser.reset(); parser.getInterpreter().setPredictionMode(PredictionMode.LL); tree = parseFunction.apply(parser); } return new PgArrayASTVisitor(convert).visit(tree); } catch (StackOverflowError e) { throw new PgArrayParsingException("stack overflow while parsing: " + e.getLocalizedMessage()); } catch (IOException e) { return new IllegalArgumentException(e); } }
Source:
<code>public void initialize(final ExtensionContext context) { JSFLogger.ROOT_LOGGER.debug("Activating JSF(Mojarra) Extension"); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); subsystem.registerSubsystemModel(JSFResourceDefinition.INSTANCE); subsystem.registerXMLElementWriter(JSFSubsystemParser_1_1.INSTANCE); if (context.isRegisterTransformers()) { <START> JSFResourceDefinition.registerTransformers(subsystem); <END> } }</code><technical_language>a new ServiceLoader based of registering transformers -- implementations of org.jboss.as.controller.transform.ExtensionTransformerRegistration</technical_language>

Target:
public void initialize(final ExtensionContext context) { JSFLogger.ROOT_LOGGER.debug("Activating JSF(Mojarra) Extension"); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); subsystem.registerSubsystemModel(JSFResourceDefinition.INSTANCE); subsystem.registerXMLElementWriter(JSFSubsystemParser_1_1.INSTANCE); }
Source:
<code>public void onIndexPageWithResourcesFromCdn() { ContentSecurityPolicyHeaderWriter writer <START> = new ContentSecurityPolicyHeaderWriter( <END> true, false, bool(), SiteUrl.PUBLIC_URL, H2_CONSOLE_PROPERTIES ); String[] directives = writer.constructDirectives("/").split(";"); assertThat(directives) .contains( "default-src 'none'", "img-src <LINK_3> <LINK_4>", "font-src <LINK_2>", "report-uri <LINK_0>" ) .contains( "style-src " + "'report-sample' " + "<LINK_3> " + "<LINK_4> " + "<LINK_2>" ) .contains( "script-src " + "'report-sample' " + "'unsafe-inline' " + "<LINK_4> " + "<LINK_2> " + "<LINK_1>" ) .hasSize(NUMBER_OF_DIRECTIVES_ON_STANDARD_PAGES); }</code><technical_language>nit: write 2 lines now: java ContentSecurityPolicyHeaderWriter writer = new ContentSecurityPolicyHeaderWriter(</technical_language>

Target:
public void onIndexPageWithResourcesFromCdn() { ContentSecurityPolicyHeaderWriter writer = new ContentSecurityPolicyHeaderWriter( true, false, bool(), SiteUrl.PUBLIC_URL, H2_CONSOLE_PATH ); String[] directives = writer.constructDirectives("/").split(";"); assertThat(directives) .contains( "default-src 'none'", "img-src <LINK_3> <LINK_4>", "font-src <LINK_2>", "report-uri <LINK_0>" ) .contains( "style-src " + "'report-sample' " + "<LINK_3> " + "<LINK_4> " + "<LINK_2>" ) .contains( "script-src " + "'report-sample' " + "'unsafe-inline' " + "<LINK_4> " + "<LINK_2> " + "<LINK_1>" ) .hasSize(NUMBER_OF_DIRECTIVES_ON_STANDARD_PAGES); }
Source:
<code>private Exception createTimeoutException(Thread thread) { StackTraceElement[] stackTrace = thread.getStackTrace(); final Thread stuckThread = fLookForStuckThread ? getStuckThread(thread) : null; Exception currThreadException = new TestFailedOnTimeoutException(String.format( <START> "test timed out after %d %s", fTimeout, fTimeUnit.name().toLowerCase())); <END> if (stackTrace != null) { currThreadException.setStackTrace(stackTrace); thread.interrupt(); } if (stuckThread != null) { Exception stuckThreadException = new Exception ("Appears to be stuck in thread " + stuckThread.getName()); stuckThreadException.setStackTrace(getStackTrace(stuckThread)); return new MultipleFailureException (Arrays.<Throwable>asList(currThreadException, stuckThreadException)); } else { return currThreadException; } }</code><technical_language>If making a custom exception, pass values constructor provide methods in exception get values people parse exception message</technical_language>

Target:
private Exception createTimeoutException(Thread thread) { StackTraceElement[] stackTrace = thread.getStackTrace(); final Thread stuckThread = fLookForStuckThread ? getStuckThread(thread) : null; Exception currThreadException = new TestTimedOutException(fTimeout, fTimeUnit); if (stackTrace != null) { currThreadException.setStackTrace(stackTrace); thread.interrupt(); } if (stuckThread != null) { Exception stuckThreadException = new Exception ("Appears to be stuck in thread " + stuckThread.getName()); stuckThreadException.setStackTrace(getStackTrace(stuckThread)); return new MultipleFailureException (Arrays.<Throwable>asList(currThreadException, stuckThreadException)); } else { return currThreadException; } }
Source:
<code>protected Tag getVersion(Tool tool) { Tag tag = new Tag(); tag.setCwlPath("/Dockstore.cwl"); tag.setDockerfilePath("/Dockerfile"); tag.setAutomated(false); tag.setWdlPath("/Dockstore.wdl"); tag.setReferenceType(Version.ReferenceType.TAG); <START> tag.setLastBuilt(new Date()); <END> return tag; }</code><technical_language>If this is set creation time, this redundant dbCreateDate</technical_language>

Target:
protected Tag getVersion(Tool tool) { Tag tag = new Tag(); tag.setCwlPath("/Dockstore.cwl"); tag.setDockerfilePath("/Dockerfile"); tag.setAutomated(false); tag.setWdlPath("/Dockstore.wdl"); tag.setReferenceType(Version.ReferenceType.TAG); return tag; }
Source:
<code>public FastReaderBuilder getFastReaderBuilder() { if (fastReaderBuilder == null) { <START> FastReaderBuilder localFastReader = new FastReaderBuilder(this); <END> this.fastReaderBuilder = localFastReader; return localFastReader; } else { return this.fastReaderBuilder; } }</code><technical_language>a nit, introduce local variable here</technical_language>

Target:
public FastReaderBuilder getFastReaderBuilder() { if (fastReaderBuilder == null) { fastReaderBuilder = new FastReaderBuilder(this); } return this.fastReaderBuilder; }
Source:
<code>void setFadeEnabled(boolean enabled) { fadeEnabled = enabled; <START> pageFragment.getWebView().postDelayed(this::update, DELAY_UPDATE_MS); <END> }</code><technical_language>I code postDelayed work a problem, means incomplete understanding of underlying issue. (see below)</technical_language>

Target:
void setFadeEnabled(boolean enabled) { fadeEnabled = enabled; update(); }
Source:
<code>protected void scheduleFlush(String encodedRegionName, List<byte[]> families) { RegionServerServices services = this.abortable; HRegion r = (HRegion) services.getRegion(encodedRegionName); if (r == null) { LOG.warn("Failed to schedule flush of {}, because it is not online on us", encodedRegionName); return; } FlushRequester requester = services.getFlushRequester(); if (requester == null) { LOG.warn("Failed to schedule flush of {}, region={}, because FlushRequester is null", encodedRegionName, r); return; } <START> requester.requestFlush(r, false, families, FlushLifeCycleTracker.DUMMY); <END> }</code><technical_language>in a force roll requested. change true false. changing behavior for default flush stores case</technical_language>

Target:
protected void scheduleFlush(String encodedRegionName, List<byte[]> families) { RegionServerServices services = this.abortable; HRegion r = (HRegion) services.getRegion(encodedRegionName); if (r == null) { LOG.warn("Failed to schedule flush of {}, because it is not online on us", encodedRegionName); return; } FlushRequester requester = services.getFlushRequester(); if (requester == null) { LOG.warn("Failed to schedule flush of {}, region={}, because FlushRequester is null", encodedRegionName, r); return; } requester.requestFlush(r, families, FlushLifeCycleTracker.DUMMY); }
Source:
<code>private void makeCachedRequestWithCredsId(String credsId) throws IOException { GitHubServerConfig config = new GitHubServerConfig(credsId); config.setApiUrl(github.serverConfig().getApiUrl()); <START> config.setClientCacheSize(1); <END> GitHub gitHub = new GitHubLoginFunction().apply(config); gitHub.getMyself(); }</code><technical_language>@kohsuke easy for implement this <LINK_0></technical_language>

Target:
private void makeCachedRequestWithCredsId(String credsId) throws IOException { GitHubServerConfig config = new GitHubServerConfig(credsId); config.setApiUrl(github.serverConfig().getApiUrl()); config.setClientCacheSize(1); GitHub gitHub = GitHubServerConfig.loginToGithub().apply(config); gitHub.getMyself(); }
Source:
<code>public synchronized void send(DatastreamEventRecord record) throws DatastreamException { if (_shutdownRequested) { throw new IllegalStateException("send() is not allowed on a shutdown producer"); } validateEventRecord(record); try { _transportProvider.send(record); _latestCheckpoints.get(record.getDatastreamTask()).put(record.getPartition(), record.getCheckpoint()); _pendingCheckpoint = true; } catch (TransportException e) { <START> throw new DatastreamException("Failed to send: " + record, e); <END> } }</code><technical_language>wrapping TransportException</technical_language>

Target:
public synchronized void send(DatastreamEventRecord record) { if (_shutdownRequested) { throw new IllegalStateException("send() is not allowed on a shutdown producer"); } validateEventRecord(record); try { _transportProvider.send(record); _latestCheckpoints.get(record.getDatastreamTask()).put(record.getPartition(), record.getCheckpoint()); _pendingCheckpoint = true; } catch (TransportException e) { throw new RuntimeException("Failed to send: " + record, e); } }
Source:
<code>public static DataType<?> getCommonType(DataType<?> firstType, DataType<?> secondType) { <START> TypeCompatibility compatibility = compatibility(firstType, secondType); <END> if (!compatibility.isCompatible()) { return null; } return compatibility.getCommonType(); }</code><technical_language>if worth changing, I for common cases TypeCompatibility creation avoided (if types match, undefined case, "by precedence" case)</technical_language>

Target:
public static DataType<?> getCommonType(DataType<?> firstType, DataType<?> secondType) { return compatibility(firstType, secondType); }
Source:
<code>private Map<URL, URL> findExportedResources(Module dependencyModule, Map<String, Map<URL, URL>> exportedResourcesCache) { <START> if (exportedResourcesCache.containsKey(dependencyModule)) { <END> return exportedResourcesCache.get(dependencyModule.getName()); } Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { exportedResourcesCache.put(dependencyModule.getName(), Collections.emptyMap()); return Collections.emptyMap(); } Set<URL> indexes = findExportedResource(dependencyModule, META_INF_JANDEX_IDX); Map<URL, URL> ret = new HashMap<>(); for (URL beansXml : beanXmls) { String urlBase = beansXml.toString().substring(0, beansXml.toString().length() - META_INF_BEANS_XML.length()); URL idx = null; for (URL index : indexes) { if (index.toString().startsWith(urlBase)) { idx = index; break; } } ret.put(beansXml, idx); } exportedResourcesCache.put(dependencyModule.getName(), ret); return ret; }</code><technical_language>This return false keys dependencyModule.getName()</technical_language>

Target:
private Map<URL, URL> findExportedResources(Module dependencyModule, Map<String, Map<URL, URL>> exportedResourcesCache) { if (exportedResourcesCache.containsKey(dependencyModule.getName())) { return exportedResourcesCache.get(dependencyModule.getName()); } Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { exportedResourcesCache.put(dependencyModule.getName(), Collections.emptyMap()); return Collections.emptyMap(); } Set<URL> indexes = findExportedResource(dependencyModule, META_INF_JANDEX_IDX); Map<URL, URL> ret = new HashMap<>(); for (URL beansXml : beanXmls) { String urlBase = beansXml.toString().substring(0, beansXml.toString().length() - META_INF_BEANS_XML.length()); URL idx = null; for (URL index : indexes) { if (index.toString().startsWith(urlBase)) { idx = index; break; } } ret.put(beansXml, idx); } exportedResourcesCache.put(dependencyModule.getName(), ret); return ret; }
Source:
<code>private String getDatabase(final Query query) { String db = query.getDatabase(); <START> return db == null ? this.database : db; <END> }</code><technical_language>I dont elvis, please consider</technical_language>

Target:
private String getDatabase(final Query query) { String db = query.getDatabase(); if (db == null) { return this.database; } return db; }
Source:
<code>private Map<String, List<Entry<T>>> copy(final Map<String, List<Entry<T>>> original) { final Map<String, List<Entry<T>>> copy = new HashMap<>(); original.forEach((key, value) -> copy.put(key, new CopyOnWriteArrayList<>(value))); <START> return copy; <END> }</code><technical_language>OK, this properly, reasoning change in SubtypeMap is instead of heavy ConcurrentHashMap instances, more lightweight plain HashMap instances. concurrency is dealt copying writing volatile references instances. Right? Btw, sense try providing a size parameter creating new (copy) map? Now, wondering, add getPossible methods synchronized ensure consistent results? more fine-grain synchronized blocks added changes 3 indexes atomic preventing access while change is performed? other hand, this problem ConcurrentHashMap based implementation... simply ignore for create a jira for if necessary</technical_language>

Target:
private Map<String, List<Entry<T>>> copy(final Map<String, List<Entry<T>>> original) { final Map<String, List<Entry<T>>> copy = new HashMap<>(original.size()); original.forEach((key, value) -> copy.put(key, new CopyOnWriteArrayList<>(value))); return copy; }
Source:
<code>private void executeStartOperation(final PlanOperation startOp) { final String planContextId = startOp.getEvalId().get(); final Optional<ActiveContext> context = executingPlan.getAddedWorkerContext(planContextId); if (context.isPresent()) { final String contextId = context.get().getId(); LOG.log(Level.FINE, "START: worker {0}", contextId); asyncDolphinDriver.get().getSecondContextActiveHandlerForWorker(true).onNext(context.get()); <START> executingPlan.putWorkerTaskControlOp(contextId, startOp); <END> } else { throw new RuntimeException("There's no worker evaluator to start"); } }</code><technical_language>I L473 precede L472</technical_language>

Target:
private void executeStartOperation(final PlanOperation startOp) { final String planContextId = startOp.getEvalId().get(); final Optional<ActiveContext> context = executingPlan.getAddedWorkerContext(planContextId); if (context.isPresent()) { final String contextId = context.get().getId(); LOG.log(Level.FINE, "START: worker {0}", contextId); executingPlan.putWorkerTaskControlOp(contextId, startOp); asyncDolphinDriver.get().getSecondContextActiveHandlerForWorker(true).onNext(context.get()); } else { throw new RuntimeException("There's no worker evaluator to start"); } }