auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void createProgressBar(Composite parent) { progressBarComposite = new Composite(parent, SWT.NONE); GridData gd = new GridData(SWT.FILL, SWT.TOP, true, true); progressBarComposite.setLayoutData(gd); GridLayout layout = new <START> GridLayout(); <END> progressBarComposite.setLayout(layout); progressBarComposite.setVisible(false); Label progressBarLabel = new Label(progressBarComposite, SWT.NONE); progressBarLabel.setText(ProvUIMessages.AvailableIUsPage_Fetching); gd = new GridData(SWT.LEFT, SWT.CENTER, true, true); progressBarLabel.setLayoutData(gd); ProgressBar progressBar = new ProgressBar(progressBarComposite, SWT.INDETERMINATE); gd = new GridData(SWT.FILL, SWT.FILL, true, true); progressBar.setLayoutData(gd); IContentProvider contentProvider = availableIUGroup.getCheckboxTreeViewer().getContentProvider(); if (contentProvider instanceof DeferredQueryContentProvider) { ((DeferredQueryContentProvider) contentProvider).addOnFetchingActionListener(new IDeferredQueryTreeListener() { @Override public void finishedFetchingDeferredChildren(Object parent, Object placeHolder) { if (parent instanceof QueriedElement) { if (((QueriedElement) parent).getCachedChildren().length > 0) { setProgressBarVisibility(false); } } } @Override public void fetchingDeferredChildren(Object parent, Object placeHolder) { setProgressBarVisibility(true); } }); } }</code><technical_language>Instead of creating a GridLayout here, a GridLayoutFactory end of method</technical_language>

Target:
private Composite createProgressBar(Composite parent) { final Composite progressBarComposite = new Composite(parent, SWT.NONE); Label progressBarLabel = new Label(progressBarComposite, SWT.NONE); progressBarLabel.setText(ProvUIMessages.AvailableIUsPage_Fetching); ProgressBar progressBar = new ProgressBar(progressBarComposite, SWT.INDETERMINATE); IContentProvider contentProvider = availableIUGroup.getCheckboxTreeViewer().getContentProvider(); if (contentProvider instanceof DeferredQueryContentProvider) { ((DeferredQueryContentProvider) contentProvider).addOnFetchingActionListener(new IDeferredQueryTreeListener() { @Override public void finishedFetchingDeferredChildren(Object parent, Object placeHolder) { if (parent instanceof QueriedElement) { if (((QueriedElement) parent).getCachedChildren().length > 0) { if (progressBarRefCount > 0) { progressBarRefCount--; } } } changeProgressBarVisibility(progressBarComposite); } @Override public void fetchingDeferredChildren(Object parent, Object placeHolder) { progressBarRefCount++; changeProgressBarVisibility(progressBarComposite); } }); } GridLayoutFactory.fillDefaults().generateLayout(progressBarComposite); return progressBarComposite; }
Source:
<code>private void abortL1UpdateOrWait(Object key) throws InterruptedException { L1WriteSynchronizer sync = concurrentWrites.remove(key); <START> if (sync != null) { <END> if (sync.trySkipL1Update()) { log.tracef("Aborted possible L1 update due to concurrent invalidation for key %s", key); } else { log.tracef("L1 invalidation found a pending update from a read for key %s - need to wait for it to " + "complete to guarantee consistency", key); try { sync.get(); } catch (ExecutionException e) { } log.tracef("Pending L1 update completed - L1 invalidation can occur for key %s", key); } } }</code><technical_language>I thinking of keeping it, making verbose</technical_language>

Target:
private void abortL1UpdateOrWait(Object key) throws InterruptedException { L1WriteSynchronizer sync = concurrentWrites.remove(key); if (sync != null) { if (sync.trySkipL1Update()) { if (trace) { log.tracef("Aborted possible L1 update due to concurrent invalidation for key %s", key); } } else { if (trace) { log.tracef("L1 invalidation found a pending update for key %s - need to block until finished", key); } boolean success; try { sync.get(); success = true; } catch (ExecutionException e) { success = false; } if (trace) { log.tracef("Pending L1 update completed successfully: %b - L1 invalidation can occur for key %s", success, key); } } } }
Source:
<code>protected String getStateParameter(final WebContext context) { <START> final String stateParameter; <END> final String stateData = getState(); if (CommonHelper.isNotBlank(stateData)) { stateParameter = stateData; } else { stateParameter = CommonHelper.randomString(10); } return stateParameter; }</code><technical_language>remove stateData</technical_language>

Target:
protected String getStateParameter(final WebContext context) { final String stateParameter; if (CommonHelper.isNotBlank(stateData)) { stateParameter = stateData; } else { stateParameter = CommonHelper.randomString(10); } return stateParameter; }
Source:
<code>private DiscoveryResult createDiscoveryResult(StateServiceResponse packet, StateVersionResponse returnedPacket) { MACAddress discoveredAddress = packet.getTarget(); ThingUID thingUID = getUID(discoveredAddress.getAsLabel()); Products product = Products.getProductFromProductID(returnedPacket.getProduct()); String label = ""; if (StringUtils.isBlank(label)) <START> label = product.getName() + " v." + returnedPacket.getVersion() + " [" + discoveredAddress.getAsLabel() <END> + "]"; logger.debug("Discovered a LIFX light : {}", label); return DiscoveryResultBuilder.create(thingUID).withLabel(label) .withProperty(LifxBindingConstants.CONFIG_PROPERTY_DEVICE_ID, discoveredAddress.getAsLabel()).build(); }</code><technical_language>This results in a ugly label - I reduce product.getName()only. For address, 'DiscoveryResultBuilder.withRepresentationProperty()' - this sure, address is shown user identification</technical_language>

Target:
private DiscoveryResult createDiscoveryResult(StateServiceResponse packet, StateVersionResponse returnedPacket) { MACAddress discoveredAddress = packet.getTarget(); try { Products product = Products.getProductFromProductID(returnedPacket.getProduct()); ThingUID thingUID = getUID(discoveredAddress.getAsLabel(), product.isColor()); String label = ""; if (StringUtils.isBlank(label)) { label = product.getName(); } logger.trace("Discovered a LIFX light : {}", label); return DiscoveryResultBuilder.create(thingUID).withLabel(label) .withProperty(LifxBindingConstants.CONFIG_PROPERTY_DEVICE_ID, discoveredAddress.getAsLabel()) .withRepresentationProperty(discoveredAddress.getAsLabel()).build(); } catch (IllegalArgumentException e) { logger.trace("Ignoring packet: {}", e); return null; } }
Source:
<code>public void write(Page page) throws IOException { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } checkArgument(page.getChannelCount() == columnWriters.size()); if (validationBuilder != null) { validationBuilder.addPage(page); } int averageLogicalSizePerRow = estimateAverageLogicalSizePerRow(page); <START> int chunkRows = Math.max(1, chunkMaxLogicalBytes / Math.max(1, averageLogicalSizePerRow)); <END> while (page != null) { chunkRows = min(chunkRows, min(rowGroupMaxRowCount - rowGroupRowCount, stripeMaxRowCount - stripeRowCount)); chunkRows = min(page.getPositionCount(), chunkRows); Page chunk = page.getRegion(0, chunkRows); if (chunkRows < page.getPositionCount()) { page = page.getRegion(chunkRows, page.getPositionCount() - chunkRows); } else { page = null; } writeChunk(chunk); } long recordedSizeInBytes = getRetainedBytes(); stats.updateSizeInBytes(recordedSizeInBytes - previouslyRecordedSizeInBytes); previouslyRecordedSizeInBytes = recordedSizeInBytes; }</code><technical_language>static import max (similarly min in this class)</technical_language>

Target:
public void write(Page page) throws IOException { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } checkArgument(page.getChannelCount() == columnWriters.size()); if (validationBuilder != null) { validationBuilder.addPage(page); } int averageLogicalSizePerRow = estimateAverageLogicalSizePerRow(page); int maxChunkRowCount = max(1, chunkMaxLogicalBytes / max(1, averageLogicalSizePerRow)); while (page != null) { int chunkRows = min(maxChunkRowCount, min(rowGroupMaxRowCount - rowGroupRowCount, stripeMaxRowCount - stripeRowCount)); chunkRows = min(page.getPositionCount(), chunkRows); Page chunk = page.getRegion(0, chunkRows); if (chunkRows < page.getPositionCount()) { page = page.getRegion(chunkRows, page.getPositionCount() - chunkRows); } else { page = null; } writeChunk(chunk); } long recordedSizeInBytes = getRetainedBytes(); stats.updateSizeInBytes(recordedSizeInBytes - previouslyRecordedSizeInBytes); previouslyRecordedSizeInBytes = recordedSizeInBytes; }
Source:
<code>public MamPrefsIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String iqType = parser.getAttributeValue("", "type"); String defaultField = parser.getAttributeValue("", "default"); if (iqType == null) { iqType = "result"; } List<Jid> alwaysJids = null; List<Jid> neverJids = null; <START> boolean done = false; <END> while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("always")) { alwaysJids = iterateJids(parser, "always"); } if (parser.getName().equals("never")) { neverJids = iterateJids(parser, "never"); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(MamPrefsIQ.ELEMENT)) { done = true; } } } return new MamPrefsIQ(Type.fromString(iqType), alwaysJids, neverJids, defaultField); }</code><technical_language>Please remove done boolean explained above</technical_language>

Target:
public MamPrefsIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String iqType = parser.getAttributeValue("", "type"); String defaultField = parser.getAttributeValue("", "default"); if (iqType == null) { iqType = "result"; } List<Jid> alwaysJids = null; List<Jid> neverJids = null; outerloop: while (true) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("always")) { alwaysJids = iterateJids(parser); } if (parser.getName().equals("never")) { neverJids = iterateJids(parser); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getDepth() == initialDepth) { break outerloop; } } } return new MamPrefsIQ(Type.fromString(iqType), alwaysJids, neverJids, defaultField); }
Source:
<code>public List<DatabaseChangeViewModel> scanForChanges() { if (database.getDatabasePath().isEmpty()) { return Collections.emptyList(); <START> } else { <END> try { List<DatabaseChangeViewModel> changes = new ArrayList<>(); ImportFormatPreferences importFormatPreferences = Globals.prefs.getImportFormatPreferences(); ParserResult result = new BibtexImporter(importFormatPreferences, new DummyFileUpdateMonitor()) .importDatabase(database.getDatabasePath().get(), importFormatPreferences.getEncoding()); BibDatabaseContext databaseOnDisk = result.getDatabaseContext(); BibDatabaseDiff differences = BibDatabaseDiff.compare(database, databaseOnDisk); differences.getMetaDataDifferences().ifPresent(diff -> { changes.add(new MetaDataChangeViewModel(diff)); diff.getGroupDifferences().ifPresent(groupDiff -> changes.add(new GroupChangeViewModel(groupDiff))); }); differences.getPreambleDifferences().ifPresent(diff -> changes.add(new PreambleChangeViewModel(diff))); differences.getBibStringDifferences().forEach(diff -> changes.add(createBibStringDiff(diff))); differences.getEntryDifferences().forEach(diff -> changes.add(createBibEntryDiff(diff))); return changes; } catch (IOException e) { LOGGER.warn("Error while parsing changed file.", e); return Collections.emptyList(); } } }</code><technical_language>I close if else --> code for else branch. I think, if guard is OK</technical_language>

Target:
public List<DatabaseChangeViewModel> scanForChanges() { if (database.getDatabasePath().isEmpty()) { return Collections.emptyList(); } try { List<DatabaseChangeViewModel> changes = new ArrayList<>(); ImportFormatPreferences importFormatPreferences = Globals.prefs.getImportFormatPreferences(); ParserResult result = new BibtexImporter(importFormatPreferences, new DummyFileUpdateMonitor()) .importDatabase(database.getDatabasePath().get(), importFormatPreferences.getEncoding()); BibDatabaseContext databaseOnDisk = result.getDatabaseContext(); BibDatabaseDiff differences = BibDatabaseDiff.compare(database, databaseOnDisk); differences.getMetaDataDifferences().ifPresent(diff -> { changes.add(new MetaDataChangeViewModel(diff)); diff.getGroupDifferences().ifPresent(groupDiff -> changes.add(new GroupChangeViewModel(groupDiff))); }); differences.getPreambleDifferences().ifPresent(diff -> changes.add(new PreambleChangeViewModel(diff))); differences.getBibStringDifferences().forEach(diff -> changes.add(createBibStringDiff(diff))); differences.getEntryDifferences().forEach(diff -> changes.add(createBibEntryDiff(diff))); return changes; } catch (IOException e) { LOGGER.warn("Error while parsing changed file.", e); return Collections.emptyList(); } }
Source:
<code>public void testParseUserAttrStringFileArguments() { List<String> cmdArgs = new ArrayList<>(DFLT_ARGS); cmdArgs.add(CommandList.TX.text()); cmdArgs.add(CommonArgParser.CMD_USER_ATTR_PATH); cmdArgs.add(IgniteUtils.resolveIgnitePath(USER_ATTRIBUTE_PATH).getAbsolutePath()); cmdArgs.add(CommonArgParser.CMD_USER_ATTR); cmdArgs.add("attr1=val1,attr3=val4"); ConnectionAndSslParameters args = parseArgs(cmdArgs); <START> assertEquals(args.userAttributes().get("attr3"), "val4"); <END> }</code><technical_language>ensure other attributes sources here</technical_language>

Target:
public void testParseUserAttrStringFileArguments() { List<String> cmdArgs = new ArrayList<>(DFLT_ARGS); cmdArgs.add(CommandList.TX.text()); cmdArgs.add(CommonArgParser.CMD_USER_PROPS_PATH); cmdArgs.add(IgniteUtils.resolveIgnitePath(USER_ATTRIBUTE_PATH).getAbsolutePath()); cmdArgs.add(CommonArgParser.CMD_USER_PROPS); cmdArgs.add("prop1=val1,prop3=val4"); ConnectionAndSslParameters args = parseArgs(cmdArgs); assertEquals(args.userProperties().get("prop1"), "val1"); assertEquals(args.userProperties().get("prop3"), "val4"); assertEquals(args.userProperties().get("prop4"), "mode=test"); }
Source:
<code>public void ShouldShowWebView_WhenTermsOfUseButtonIsClicked() throws Exception{ activity.onTermsAndConditionClick(); ShadowActivity shadowActivity = shadowOf(activity); Intent startedIntent = shadowActivity.getNextStartedActivity(); <START> assertEquals(ExternalLinkActivity.class.getName(), startedIntent.getComponent().getClassName()); <END> }</code><technical_language>AssertJ library, assertions assertThat(something).isEqualTo(expected)</technical_language>

Target:
public void ShouldShowWebView_WhenTermsOfUseButtonIsClicked() throws Exception { activity.onTermsAndConditionClick(); Intent expectedIntent = new Intent(activity, ExternalLinkActivity.class); assertThat(new Intent(RuntimeEnvironment.application, ExternalLinkActivity.class)).isEqualTo(expectedIntent); }
Source:
<code>public void addExistsTest() throws Exception{ ExtentIndex index = new ExtentIndex(); index.configure(new Config()); index.startup(); long testIndex = 9; ExtentSummary product = new ExtentSummary(); product.setId(testIndex); product.setMaxLatitude(0.); index.addExtentSummary(product); long response = index.getLastExtentIndexId(); Assert.assertEquals(testIndex,response); Connection conn = index.connect(); <START> PreparedStatement stmnt = conn.prepareStatement("DELETE FROM " + ExtentIndex.EXTENT_TABLE + " WHERE " + ExtentIndex.EXTENT_INDEX_ID + "=" + product.getId()); <END> stmnt.executeUpdate(); index.shutdown(); }</code><technical_language>This getIndexId()</technical_language>

Target:
public void addExistsTest() throws Exception{ ExtentIndex index = new ExtentIndex(); index.configure(new Config()); index.startup(); long testIndex = 9; ExtentSummary product = new ExtentSummary(); product.setIndexId(testIndex); product.setMaxLatitude(BigDecimal.ZERO); index.addExtentSummary(product); long response = index.getLastExtentIndexId(); Assert.assertEquals(testIndex,response); Connection conn = index.connect(); PreparedStatement stmnt = conn.prepareStatement("DELETE FROM " + ExtentIndex.EXTENT_TABLE + " WHERE " + ExtentIndex.EXTENT_INDEX_ID + "=" + product.getIndexId()); stmnt.executeUpdate(); index.shutdown(); }
Source:
<code>public void testInvalidBenchmarkSuiteSupplier() throws Exception { Bootstrap app = new Bootstrap( <START> ImmutableList.<Module>builder() <END> .add(new BenchmarkSuiteModule(ImmutableSet.of("test-supplier"))) .build()); app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("benchmark-query-supplier", "unknown-supplier") .put("database", "jdbc://localhost:1080") .put("suite-name", "test") .build()) .initialize(); }</code><technical_language>merge previous line</technical_language>

Target:
public void testInvalidBenchmarkSuiteSupplier() { Bootstrap app = new Bootstrap(ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of("test-supplier"))) .build()); Injector injector = null; try { injector = app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("benchmark-query-supplier", "unknown-supplier") .build()) .initialize(); } finally { if (injector != null) { injector.getInstance(LifeCycleManager.class).stop(); } } }
Source:
<code>public boolean equals(Object obj) { <START> if (this == obj) <END> return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Tuple<?> other = (Tuple<?>) obj; if (big == null) { if (other.big != null) return false; } else if (!big.equals(other.big)) return false; if (small == null) { if (other.small != null) return false; } else if (!small.equals(other.small)) return false; return true; }</code><technical_language>ok assume tuple elements null</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Tuple<?> other = (Tuple<?>) obj; if (!big.equals(other.big)) return false; if (!small.equals(other.small)) return false; return true; }
Source:
<code>public void purgeDeletedKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.purgeDeletedKeyWithResponse("deletedKeyName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> <START> System.out.printf("Purge Status response %rsaPrivateExponent \n", purgeResponse.getStatusCode())); <END> END: com.azure.security.keyvault.keys.async.keyclient.purgeDeletedKeyWithResponse#string }</code><technical_language>%d%n, remove copy paste error</technical_language>

Target:
public void purgeDeletedKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.purgeDeletedKeyWithResponse("deletedKeyName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> System.out.printf("Purge Status response %d %n", purgeResponse.getStatusCode())); END: com.azure.security.keyvault.keys.async.keyclient.purgeDeletedKeyWithResponse#string }
Source:
<code>public void installTrustCertificate(String alias, X509Certificate x509crt) throws GeneralSecurityException, IOException { String trustStore = this.options.getSslKeyStore(); File fTrustStore = new File(trustStore); try (InputStream tsReadStream = new FileInputStream(trustStore); <START> FileOutputStream tsOutStream = new FileOutputStream(trustStore)) { <END> KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType()); char[] trustStorePassword = getKeyStorePassword(); if (fTrustStore.exists()) { ts.load(tsReadStream, trustStorePassword); } else { ts.load(null, null); } ts.setCertificateEntry(alias, x509crt); ts.store(tsOutStream, trustStorePassword); } }</code><technical_language>a good idea open file for reading writing time. If move output stream down, work. add another try-with-resources, there</technical_language>

Target:
public void installTrustCertificate(String alias, X509Certificate x509crt) throws GeneralSecurityException, IOException { InputStream tsReadStream = null; FileOutputStream tsOutStream = null; try { String trustStore = this.options.getSslKeyStore(); KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType()); File fTrustStore = new File(trustStore); char[] trustStorePassword = getKeyStorePassword(); if (fTrustStore.exists()) { tsReadStream = new FileInputStream(trustStore); ts.load(tsReadStream, trustStorePassword); } else { ts.load(null, null); } ts.setCertificateEntry(alias, x509crt); tsOutStream = new FileOutputStream(trustStore); ts.store(tsOutStream, trustStorePassword); } finally { close(tsReadStream); close(tsOutStream); } }
Source:
<code>public EmbeddedSolrFiles( String coreName, String configXml, String[] schemaXmls, ConfigurationFileProxy configProxy) { Validate.notNull(coreName, "invalid null Solr core name"); Validate.notNull(configXml, "invalid null Solr configuration file"); Validate.notNull(schemaXmls, "Invalid null Solr schema files"); Validate.notEmpty(schemaXmls, "missing Solr schema files"); Validate.noNullElements(schemaXmls, "invalid null Solr schema file"); Validate.notNull(configProxy, "invalid null Solr config proxy"); this.coreName = coreName; this.configName = configXml; this.configFile = EmbeddedSolrFactory.getConfigFile(configXml, configProxy, coreName); Validate.notNull(configFile, "Unable to find Solr configuration file"); File solrSchemaFile = null; String schemaXml = null; for (final String s : schemaXmls) { schemaXml = s; solrSchemaFile = EmbeddedSolrFactory.getConfigFile(schemaXml, configProxy, coreName); if (solrSchemaFile != null) { <START> break; <END> } } Validate.notNull(solrSchemaFile, "Unable to find Solr schema file."); this.schemaFile = solrSchemaFile; this.schemaName = schemaXml; }</code><technical_language>this class methods package-private instead of public</technical_language>

Target:
public EmbeddedSolrFiles( String coreName, String configXml, String[] schemaXmls, ConfigurationFileProxy configProxy) { Validate.notNull(coreName, "invalid null Solr core name"); Validate.notNull(configXml, "invalid null Solr config file"); Validate.notNull(schemaXmls, "invalid null Solr schema files"); Validate.notEmpty(schemaXmls, "missing Solr schema files"); Validate.noNullElements(schemaXmls, "invalid null Solr schema file"); Validate.notNull(configProxy, "invalid null Solr config proxy"); this.coreName = coreName; this.configName = configXml; this.configProxy = configProxy; this.configFile = FileUtils.toFile(configProxy.getResource(configXml, coreName)); Validate.notNull(configFile, "Unable to find Solr configuration file: " + configXml); File solrSchemaFile = null; String schemaXml = null; for (final String s : schemaXmls) { schemaXml = s; solrSchemaFile = FileUtils.toFile(configProxy.getResource(schemaXml, coreName)); if (solrSchemaFile != null) { break; } } Validate.notNull( solrSchemaFile, "Unable to find Solr schema file(s): " + Arrays.toString(schemaXmls)); this.schemaFile = solrSchemaFile; this.schemaName = schemaXml; }
Source:
<code>public static boolean IsVersionMatchStorageType(Version version, StorageType type) { return !((type == StorageType.LOCALFS && version.compareTo(new Version(2, 2)) <= 0) <START> || (type == StorageType.POSIXFS && version.compareTo(new Version(3, 0)) <= 0) <END> || (type == StorageType.GLUSTERFS && version.compareTo(new Version(3, 2)) <= 0)); }</code><technical_language>Config file GLUSTERFS storage enabled in 3.3, this changed too</technical_language>

Target:
public static boolean IsVersionMatchStorageType(Version version, StorageType type) { return !((type == StorageType.LOCALFS && version.compareTo(new Version(2, 2)) <= 0) || (type == StorageType.POSIXFS && version.compareTo(new Version(3, 0)) <= 0) || (type == StorageType.GLUSTERFS && version.compareTo(new Version(3, 3)) <= 0)); }
Source:
<code>protected QueryWithParams getEntityKeyOnlyQuery(EntityAttributes attributes) { Class<?> entityClass = Account.class; <START> String primaryKeyName = "googleId"; <END> AccountAttributes aa = (AccountAttributes) attributes; String id = aa.googleId; Query q = getPm().newQuery(entityClass); q.declareParameters("String idParam"); q.setFilter(primaryKeyName + " == idParam"); return new QueryWithParams(q, new Object[] {id}, primaryKeyName); }</code><technical_language>this part of entity class instead? e.g. public static String PRIMARY_KEY_NAME = "googleId";</technical_language>

Target:
protected QueryWithParams getEntityKeyOnlyQuery(EntityAttributes attributes) { Class<?> entityClass = Account.class; String primaryKeyName = Account.PRIMARY_KEY_NAME; AccountAttributes aa = (AccountAttributes) attributes; String id = aa.googleId; Query q = getPm().newQuery(entityClass); q.declareParameters("String idParam"); q.setFilter(primaryKeyName + " == idParam"); return new QueryWithParams(q, new Object[] {id}, primaryKeyName); }
Source:
<code>public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) { Viewer contentViewer = super.findContentViewer(oldViewer, input, parent); if (input instanceof FileItemNode) { ReviewCompareAnnotationSupport support = ReviewCompareAnnotationSupport.getAnnotationSupport(contentViewer); support.setReviewItem(((FileItemNode) input).getFileItem(), behavior); <START> <END> if (input.getLeft() instanceof FileRevisionTypedElement) { getCompareConfiguration().setLeftImage(((FileItemNode) input).getImage()); } else { getCompareConfiguration().setLeftImage(null); } if (input.getRight() instanceof FileRevisionTypedElement) { getCompareConfiguration().setRightImage(((FileItemNode) input).getImage()); } else { getCompareConfiguration().setRightImage(null); } } return contentViewer; }</code><technical_language>This working -- is I stuff I resolve in editor, bvut icon</technical_language>

Target:
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) { Viewer contentViewer = super.findContentViewer(oldViewer, input, parent); if (input instanceof FileItemNode) { ReviewCompareAnnotationSupport support = ReviewCompareAnnotationSupport.getAnnotationSupport(contentViewer); support.setReviewItem(((FileItemNode) input).getFileItem(), behavior); } return contentViewer; }
Source:
<code>public void emitAndPersistEventForRefundHistoryEntry(RefundHistory refundHistory) { Class refundEventClass = RefundStateEventMap.calculateRefundEventClass(refundHistory.getUserExternalId(), refundHistory.getStatus()); Event event = EventFactory.createRefundEvent(refundHistory, refundEventClass); Boolean emittedBefore = emittedEventDao.hasBeenEmittedBefore(event); <START> if (doNotForceEmission && emittedBefore) { <END> logger.info("Refund history event emitted before [refundExternalId={}] [refundHistoryId={}]", refundHistory.getExternalId(), refundHistory.getId()); } else { RefundStateTransition stateTransition = new RefundStateTransition( refundHistory.getExternalId(), refundHistory.getStatus(), refundEventClass); logger.info("Processing new refund history event: [refundExternalId={}] [refundHistoryId={}]", refundHistory.getExternalId(), refundHistory.getId()); stateTransitionQueue.offer(stateTransition); persistEventEmittedRecord(event); } }</code><technical_language>is more place check emittedEventDao.hasBeenEmittedBefore(event); <LINK_0></technical_language>

Target:
public void emitAndPersistEventForRefundHistoryEntry(RefundHistory refundHistory) { Class refundEventClass = RefundStateEventMap.calculateRefundEventClass(refundHistory.getUserExternalId(), refundHistory.getStatus()); Event event = EventFactory.createRefundEvent(refundHistory, refundEventClass); if (shouldForceEmission) { emitRefundEvent(refundHistory, refundEventClass, event); } else { boolean emittedBefore = emittedEventDao.hasBeenEmittedBefore(event); if (emittedBefore) { logger.info("Refund history event emitted before [refundExternalId={}] [refundHistoryId={}]", refundHistory.getExternalId(), refundHistory.getId()); } else { emitRefundEvent(refundHistory, refundEventClass, event); } } }
Source:
<code>public AlertQuery createAlertQuery(final Organization organization) { assertIsOpen(); LOGGER.debug() <START> .setMessage("Preparing queryAlerts") <END> .addData("organization", organization) .log(); return new DefaultAlertQuery(this, organization); }</code><technical_language>I this change intended</technical_language>

Target:
public AlertQuery createAlertQuery(final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Preparing query") .addData("organization", organization) .log(); return new DefaultAlertQuery(this, organization); }
Source:
<code>public void registerSpecialPathInfo( SpecialPathInfo pathInfo ) { <START> registerSpecialPathInfo( pathInfo, PKG_TYPE_MAVEN ); <END> }</code><technical_language>This registered "standard" special paths, IMO</technical_language>

Target:
public synchronized void registerSpecialPathInfo( SpecialPathInfo pathInfo ) { stdSpecialPaths.add( pathInfo ); }
Source:
<code>public int endpointSize() { <START> Iterator<E> iterator = endpointProvider.iterator(); <END> int size = 0; while (iterator.hasNext()){ iterator.next(); size++; } return size; }</code><technical_language>Remove copypast</technical_language>

Target:
public int endpointSize() { return getIterableSize(endpointProvider); }
Source:
<code>private void processKafkaMessages() throws Exception { try { m_executorService = createImporterExecutor(m_loader, this, this); if (m_args.useSuppliedProcedure) { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started using procedure: " + m_args.procedure); } else { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started for table: " + m_args.table); } m_executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (Throwable terminate) { m_log.error("Error in Kafka Consumer", terminate); System.exit(-1); } finally { <START> close(); <END> } }</code><technical_language>This get called in situations System.exit() succeeds. <LINK_1></technical_language>

Target:
private void processKafkaMessages() throws Exception { try { m_executorService = createImporterExecutor(this, this); if (m_args.useSuppliedProcedure) { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started using procedure: " + m_args.procedure); } else { m_log.info("Kafka Consumer from topic: " + m_args.topic + " Started for table: " + m_args.table); } m_executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (Throwable terminate) { m_log.error("Error in Kafka Consumer", terminate); } finally { close(); } System.exit(-1); }
Source:
<code>protected void readElement(final XMLExtendedStreamReader reader, final EJB3SubsystemXMLElement element, final List<ModelNode> operations, final ModelNode ejb3SubsystemAddOperation) throws XMLStreamException { switch (element) { case APPLICATION_SECURITY_DOMAINS: { parseApplicationSecurityDomains(reader, operations); break; } case IDENTITY: { parseIdentity(reader, operations); break; } case ALLOW_EJB_NAME_REGEX: { parseAllowEjbNameRegex(reader, ejb3SubsystemAddOperation); break; } case ENABLE_GRACEFUL_TXN_SHUTDOWN: { <START> parseEnableGracefulTxnShutdown(reader, ejb3SubsystemAddOperation); <END> break; } case SERVER_INTERCEPTORS: { parseServerInterceptors(reader, ejb3SubsystemAddOperation); break; } default: { super.readElement(reader, element, operations, ejb3SubsystemAddOperation); } } }</code><technical_language>adding a new top-level element ejb3 subsystem configuration. is version namespace evolved? Do need bump 5.0 6.0, 5.1, remain same? 5.0 is in WF 16, I guess modify a released namespace</technical_language>

Target:
protected void readElement(final XMLExtendedStreamReader reader, final EJB3SubsystemXMLElement element, final List<ModelNode> operations, final ModelNode ejb3SubsystemAddOperation) throws XMLStreamException { switch (element) { case APPLICATION_SECURITY_DOMAINS: { parseApplicationSecurityDomains(reader, operations); break; } case IDENTITY: { parseIdentity(reader, operations); break; } case ALLOW_EJB_NAME_REGEX: { parseAllowEjbNameRegex(reader, ejb3SubsystemAddOperation); break; } case ENABLE_GRACEFUL_TXN_SHUTDOWN: { parseEnableGracefulTxnShutdown(reader, ejb3SubsystemAddOperation); break; } default: { super.readElement(reader, element, operations, ejb3SubsystemAddOperation); } } }
Source:
<code>public Iterable<Result<TimeBoundaryResultValue>> buildResult(DateTime timestamp, DateTime min, DateTime max) { List<Result<TimeBoundaryResultValue>> results = Lists.newArrayList(); Map<String, Object> result = Maps.newHashMap(); <START> if (min != null && !bound.equalsIgnoreCase(MAX_TIME)) { <END> result.put(MIN_TIME, min); } if (max != null && !bound.equalsIgnoreCase(MIN_TIME)) { result.put(MAX_TIME, max); } if (!result.isEmpty()) { results.add(new Result<>(timestamp, new TimeBoundaryResultValue(result))); } return results; }</code><technical_language>do need check bound here? min null if ask for maxtime</technical_language>

Target:
public static Iterable<Result<TimeBoundaryResultValue>> buildResult(DateTime timestamp, DateTime min, DateTime max) { List<Result<TimeBoundaryResultValue>> results = Lists.newArrayList(); Map<String, Object> result = Maps.newHashMap(); if (min != null) { result.put(MIN_TIME, min); } if (max != null) { result.put(MAX_TIME, max); } if (!result.isEmpty()) { results.add(new Result<>(timestamp, new TimeBoundaryResultValue(result))); } return results; }
Source:
<code>CompletionStage<Boolean> currentConnectionIsOpen() { if ( connectionStage == null ) { <START> return completedWithFalse(); <END> } return connectionStage.handle( ( connection, error ) -> error == null && connection != null && connection.isOpen() ); }</code><technical_language>connectionStage is initialized completedWithNull, this connectionStage == null check removed checked completedWithNull</technical_language>

Target:
CompletionStage<Boolean> currentConnectionIsOpen() { return connectionStage.handle( ( connection, error ) -> error == null && connection != null && connection.isOpen() ); }
Source:
<code>private List<BasicNameValuePair> getParamsList(String key, Object value) { List<BasicNameValuePair> params = new LinkedList(); if (value instanceof Map) { Map map = (Map) value; List list = new ArrayList<Object>(map.keySet()); Collections.sort(list); for (Object nestedKey : list) { if (nestedKey instanceof String) { Object nestedValue = map.get(nestedKey); if (nestedValue != null) { params.addAll(getParamsList(key == null ? (String) nestedKey : String.format("%s[%s]", key, nestedKey), nestedValue)); } } } } else if (value instanceof List) { List list = (List) value; <START> for (int nestedValueIndex = 0; nestedValueIndex < list.size(); nestedValueIndex++) { <END> params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), list.get(nestedValueIndex))); } } else if (value instanceof Object[]) { Object[] array = (Object[]) value; for (int nestedValueIndex = 0; nestedValueIndex < array.length; nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), array[nestedValueIndex])); } } else if (value instanceof Set) { Set set = (Set) value; for (Object nestedValue : set) { params.addAll(getParamsList(key, nestedValue)); } } else if (value instanceof String) { params.add(new BasicNameValuePair(key, (String) value)); } return params; }</code><technical_language>put a <code>list.size()</code> a variable, for statment, for perfomance</technical_language>

Target:
private List<BasicNameValuePair> getParamsList(String key, Object value) { List<BasicNameValuePair> params = new LinkedList(); if (value instanceof Map) { Map map = (Map) value; List list = new ArrayList<Object>(map.keySet()); Collections.sort(list); for (Object nestedKey : list) { if (nestedKey instanceof String) { Object nestedValue = map.get(nestedKey); if (nestedValue != null) { params.addAll(getParamsList(key == null ? (String) nestedKey : String.format("%s[%s]", key, nestedKey), nestedValue)); } } } } else if (value instanceof List) { List list = (List) value; int listSize = list.size(); for (int nestedValueIndex = 0; nestedValueIndex < listSize; nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), list.get(nestedValueIndex))); } } else if (value instanceof Object[]) { Object[] array = (Object[]) value; int arrayLength = array.length; for (int nestedValueIndex = 0; nestedValueIndex < arrayLength; nestedValueIndex++) { params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), array[nestedValueIndex])); } } else if (value instanceof Set) { Set set = (Set) value; for (Object nestedValue : set) { params.addAll(getParamsList(key, nestedValue)); } } else if (value instanceof String) { params.add(new BasicNameValuePair(key, (String) value)); } return params; }
Source:
<code>public OuiaComponentTypeAttribute ouiaComponentType() { <START> return new OuiaComponentTypeAttribute("qe-dmn-grid-context-menu-item"); <END> }</code><technical_language>I prefix 'qe-' this shorter - data-ouia prefix of attribute - for testing</technical_language>

Target:
public OuiaComponentTypeAttribute ouiaComponentType() { return new OuiaComponentTypeAttribute("dmn-grid-context-menu-item"); }
Source:
<code>private void validateLookupConfigurations() { String partitionInclude = configuration.get(STREAMING_SOURCE_PARTITION_INCLUDE); if (isStreamingSource()) { Preconditions.checkArgument( !configuration.contains(STREAMING_SOURCE_CONSUME_START_OFFSET), String.format( "The '%s' is not supported when set '%s' to 'latest'", STREAMING_SOURCE_CONSUME_START_OFFSET.key(), STREAMING_SOURCE_PARTITION_INCLUDE.key())); Duration monitorInterval = configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL) == null ? DEFAULT_LOOKUP_MONITOR_INTERVAL : configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL); if (monitorInterval.toMillis() < DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis()) { LOG.warn(String.format( <START> "Currently the recommended value of '%s' is bigger than default value '%s' " + <END> "when set '%s' to 'latest', but actual is '%s', this may produce big pressure to hive metastore.", STREAMING_SOURCE_MONITOR_INTERVAL.key(), DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis(), STREAMING_SOURCE_PARTITION_INCLUDE.key(), monitorInterval.toMillis())); } hiveTableReloadInterval = monitorInterval; } else { Preconditions.checkArgument( "all".equals(partitionInclude), String.format("The only supported %s for lookup is '%s' in batch source," + " but actual is '%s'", STREAMING_SOURCE_PARTITION_INCLUDE.key(), "all", partitionInclude)); hiveTableReloadInterval = configuration.get(LOOKUP_JOIN_CACHE_TTL); } }</code><technical_language>curious decided 1h is recommended for monitor interval, a smaller value, say, 30min pressure metastore</technical_language>

Target:
private void validateLookupConfigurations() { String partitionInclude = configuration.get(STREAMING_SOURCE_PARTITION_INCLUDE); if (isStreamingSource()) { Preconditions.checkArgument( !configuration.contains(STREAMING_SOURCE_CONSUME_START_OFFSET), String.format( "The '%s' is not supported when set '%s' to 'latest'", STREAMING_SOURCE_CONSUME_START_OFFSET.key(), STREAMING_SOURCE_PARTITION_INCLUDE.key())); Duration monitorInterval = configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL) == null ? DEFAULT_LOOKUP_MONITOR_INTERVAL : configuration.get(STREAMING_SOURCE_MONITOR_INTERVAL); if (monitorInterval.toMillis() < DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis()) { LOG.warn(String.format( "Currently the recommended value of '%s' is at least '%s' when set '%s' to 'latest'," + " but actual is '%s', this may produce big pressure to hive metastore.", STREAMING_SOURCE_MONITOR_INTERVAL.key(), DEFAULT_LOOKUP_MONITOR_INTERVAL.toMillis(), STREAMING_SOURCE_PARTITION_INCLUDE.key(), monitorInterval.toMillis())); } hiveTableReloadInterval = monitorInterval; } else { Preconditions.checkArgument( "all".equals(partitionInclude), String.format("The only supported %s for lookup is '%s' in batch source," + " but actual is '%s'", STREAMING_SOURCE_PARTITION_INCLUDE.key(), "all", partitionInclude)); hiveTableReloadInterval = configuration.get(LOOKUP_JOIN_CACHE_TTL); } }
Source:
<code>public void start() throws InterruptedException, IOException { String bitcoindCmd = "export LD_LIBRARY_PATH=" + config.berkeleyDbLibPath + ";" + " " + config.bitcoinPath + "/bitcoind" + " -datadir=" + config.bitcoinDatadir <START> + " -daemon"; <END> BashCommand cmd = new BashCommand(bitcoindCmd).run(); log.info("Starting ...\n$ {}", cmd.getCommand()); if (cmd.getExitStatus() != 0) throw new IllegalStateException("Error starting bitcoind:\n" + cmd.getError()); pid = BashCommand.getPid("bitcoind"); if (!isAlive(pid)) throw new IllegalStateException("Error starting regtest bitcoind daemon:\n" + cmd.getCommand()); log.info("Running with pid {}", pid); log.info("Log {}", config.bitcoinDatadir + "/regtest/debug.log"); }</code><technical_language>export LD_LIBRARY_PATH= necessary distribution of bitcoind. Also, config.bitcoinPath expect pointed bin sub-directory of bitcoin-core's home (the contains bitcoind executable). a bit unexpected. I more intuitive for point executable directly, alternatively bitcoin-core's home directory</technical_language>

Target:
public void start() throws InterruptedException, IOException { String berkeleyDbLibPathExport = config.berkeleyDbLibPath.equals(EMPTY) ? EMPTY : "export LD_LIBRARY_PATH=" + config.berkeleyDbLibPath + "; "; String bitcoindCmd = berkeleyDbLibPathExport + config.bitcoinPath + "/bitcoind" + " -datadir=" + config.bitcoinDatadir + " -daemon" + " -regtest=1" + " -server=1" + " -txindex=1" + " -peerbloomfilters=1" + " -debug=net" + " -fallbackfee=0.0002" + " -rpcport=" + config.bitcoinRpcPort + " -rpcuser=" + config.bitcoinRpcUser + " -rpcpassword=" + config.bitcoinRpcPassword + " -blocknotify=" + config.bitcoinDatadir + "/blocknotify"; BashCommand cmd = new BashCommand(bitcoindCmd).run(); log.info("Starting ...\n$ {}", cmd.getCommand()); if (cmd.getExitStatus() != 0) { startupExceptions.add(new IllegalStateException( format("Error starting bitcoind%nstatus: %d%nerror msg: %s", cmd.getExitStatus(), cmd.getError()))); return; } pid = BashCommand.getPid("bitcoind"); if (!isAlive(pid)) throw new IllegalStateException("Error starting regtest bitcoind daemon:\n" + cmd.getCommand()); log.info("Running with pid {}", pid); log.info("Log {}", config.bitcoinDatadir + "/regtest/debug.log"); }
Source:
<code>private void sendCommand(ReplicableCommand command, List<LuceneWork> workList, boolean sync) { <START> CompletionStages.join(rpcManager.invokeCommand(recipients, command, VoidResponseCollector.ignoreLeavers(), <END> rpcManager.getSyncRpcOptions())); log.workListRemotedTo(workList, masterAddress); }</code><technical_language>ignoring sync parameter. recipients replaced a single Address (it change is assigned in constructor)</technical_language>

Target:
private void sendCommand(ReplicableCommand command, List<LuceneWork> workList, boolean sync) { if (sync) { CompletionStage<Void> completionStage = rpcManager.invokeCommand(recipient, command, VoidResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions()); rpcManager.blocking(completionStage); } else { rpcManager.sendTo(recipient, command, DeliverOrder.PER_SENDER); } log.workListRemotedTo(workList, masterAddress); }
Source:
<code>public List<RGB> sample(List<Point> samplePoints) { for (Point p : samplePoints) { if (!getBounds().contains(p)) { throw new <START> IllegalArgumentException("Pixel outside of picture"); <END> } } List<RGB> retVal = new ArrayList<>(samplePoints.size()); for (Point p : samplePoints) { retVal.add(getPixel(p.x, p.y)); } return retVal; }</code><technical_language>Point of image</technical_language>

Target:
public List<RGB> sample(List<Point> samplePoints) { for (Point p : samplePoints) { if (!getBounds().contains(p)) { throw new IllegalArgumentException("Pixel outside of the image"); } } List<RGB> retVal = new ArrayList<>(samplePoints.size()); for (Point p : samplePoints) { retVal.add(getPixel(p.x, p.y)); } return retVal; }
Source:
<code>public void onPrepared() { isPrepared = true; if (!isResumed() || (getParentFragment() != null && !getParentFragment().getUserVisibleHint())) { freezePlayer(); return; } environment.getSegment().trackVideoLoading(videoEntry.videoId, videoEntry.eid, <START> videoEntry.lmsUrl); <END> clearAllErrors(); initializeClosedCaptioning(); allowSensorOrientation(); if (IS_AUTOPLAY_ENABLED && !isPaused) { handler.postDelayed(unfreezeCallback, UNFREEZE_DELAY_MS); } else { updateController("player paused"); } }</code><technical_language>move this clearAllErrors()? tracking call performed end</technical_language>

Target:
public void onPrepared() { isPrepared = true; allowSensorOrientation(); if (!isResumed() || (getParentFragment() != null && !getParentFragment().getUserVisibleHint())) { freezePlayer(); return; } clearAllErrors(); initializeClosedCaptioning(); if (IS_AUTOPLAY_ENABLED) { handler.postDelayed(unfreezeCallback, UNFREEZE_DELAY_MS); } environment.getSegment().trackVideoLoading(videoEntry.videoId, videoEntry.eid, videoEntry.lmsUrl); }
Source:
<code>private Features(Map<String, VersionRangeType> features) { <START> if (features == null) { <END> throw new IllegalArgumentException("Provided features can not be null."); } this.features = features; }</code><technical_language>nit: liner: this.features = Objects.requireNonNull(features, "Provided features null.");</technical_language>

Target:
private Features(Map<String, VersionRangeType> features) { Objects.requireNonNull(features, "Provided features can not be null."); this.features = features; }
Source:
<code>private void setChangeDetails(TissueOrigin tissueOrigin) throws IOException { User user = authorizationManager.getCurrentUser(); Date now = new Date(); tissueOrigin.setUpdatedBy(user); <START> if (tissueOrigin.getId() == Array.UNSAVED_ID) { <END> tissueOrigin.setCreatedBy(user); if (tissueOrigin.getCreationDate() == null) { tissueOrigin.setCreationDate(now); } if (tissueOrigin.getLastUpdated() == null) { tissueOrigin.setLastUpdated(now); } } else { tissueOrigin.setLastUpdated(now); } }</code><technical_language>TissueOriginImpl.UNSAVED_ID if pedantic</technical_language>

Target:
private void setChangeDetails(TissueOrigin tissueOrigin) throws IOException { User user = authorizationManager.getCurrentUser(); Date now = new Date(); tissueOrigin.setUpdatedBy(user); if (tissueOrigin.getId() == TissueOrigin.UNSAVED_ID) { tissueOrigin.setCreatedBy(user); if (tissueOrigin.getCreationDate() == null) { tissueOrigin.setCreationDate(now); } if (tissueOrigin.getLastUpdated() == null) { tissueOrigin.setLastUpdated(now); } } else { tissueOrigin.setLastUpdated(now); } }
Source:
<code>public void handle() { if (running.containsKey(task.getId())) { <START> log.warn( <END> "Got run notice for task [%s] that I am already running...", task.getId() ); workerCuratorCoordinator.unannounceTask(task.getId()); return; } log.info("Submitting runnable for task[%s]", task.getId()); workerCuratorCoordinator.updateAnnouncement( TaskAnnouncement.create( task, TaskStatus.running(task.getId()), TaskLocation.unknown() ) ); log.info("Affirmative. Running task [%s]", task.getId()); workerCuratorCoordinator.unannounceTask(task.getId()); final ListenableFuture<TaskStatus> future = taskRunner.run(task); addRunningTask(task, future); }</code><technical_language>if a task finishes in this block of code</technical_language>

Target:
public void handle() { if (running.containsKey(task.getId())) { log.warn( "Got run notice for task [%s] that I am already running...", task.getId() ); workerCuratorCoordinator.removeTaskRunZnode(task.getId()); return; } log.info("Submitting runnable for task[%s]", task.getId()); workerCuratorCoordinator.updateTaskStatusAnnouncement( TaskAnnouncement.create( task, TaskStatus.running(task.getId()), TaskLocation.unknown() ) ); log.info("Affirmative. Running task [%s]", task.getId()); workerCuratorCoordinator.removeTaskRunZnode(task.getId()); final ListenableFuture<TaskStatus> future = taskRunner.run(task); addRunningTask(task, future); }