auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public boolean waitInvisibility(WebElement webElement, int timeout) { <END> return webDriverWaitFactory.get(timeout).until(invisibilityOfAllElements(asList(webElement))); }</code><technical_language>returning boolean type is useless return **true**, throw timeout exception</technical_language>

Target:
public void waitInvisibility(WebElement webElement, int timeout) { webDriverWaitFactory.get(timeout).until(invisibilityOfAllElements(asList(webElement))); }
Source:
<code>public boolean quit() { if (stateManager.getAnyTaskRunning().getValue()) { if (!(dialogService.showBackgroundProgressDialogAndWait( Localization.lang("Please wait..."), Localization.lang("Waiting for background tasks to finish. Quit anyway?"), stateManager <START> ).orElse(ButtonType.CANCEL) == ButtonType.YES)) { <END> return false; } } List<String> filenames = new ArrayList<>(); for (int i = 0; i < tabbedPane.getTabs().size(); i++) { BasePanel panel = getBasePanelAt(i); final BibDatabaseContext context = panel.getBibDatabaseContext(); if (panel.isModified() && (context.getLocation() == DatabaseLocation.LOCAL)) { tabbedPane.getSelectionModel().select(i); if (!confirmClose(panel)) { return false; } } else if (context.getLocation() == DatabaseLocation.SHARED) { context.convertToLocalDatabase(); context.getDBMSSynchronizer().closeSharedDatabase(); context.clearDBMSSynchronizer(); } AutosaveManager.shutdown(context); BackupManager.shutdown(context); context.getDatabasePath().map(Path::toAbsolutePath).map(Path::toString).ifPresent(filenames::add); } WaitForSaveFinishedDialog waitForSaveFinishedDialog = new WaitForSaveFinishedDialog(dialogService); waitForSaveFinishedDialog.showAndWait(getBasePanelList()); tearDownJabRef(filenames); Platform.exit(); return true; }</code><technical_language>This odd</technical_language>

Target:
public boolean quit() { if (stateManager.getAnyTaskRunning().getValue()) { Optional<ButtonType> shouldClose = dialogService.showBackgroundProgressDialogAndWait( Localization.lang("Please wait..."), Localization.lang("Waiting for background tasks to finish. Quit anyway?"), stateManager ); if (!(shouldClose.isPresent() && shouldClose.get() == ButtonType.YES)) { return false; } } List<String> filenames = new ArrayList<>(); for (int i = 0; i < tabbedPane.getTabs().size(); i++) { BasePanel panel = getBasePanelAt(i); final BibDatabaseContext context = panel.getBibDatabaseContext(); if (panel.isModified() && (context.getLocation() == DatabaseLocation.LOCAL)) { tabbedPane.getSelectionModel().select(i); if (!confirmClose(panel)) { return false; } } else if (context.getLocation() == DatabaseLocation.SHARED) { context.convertToLocalDatabase(); context.getDBMSSynchronizer().closeSharedDatabase(); context.clearDBMSSynchronizer(); } AutosaveManager.shutdown(context); BackupManager.shutdown(context); context.getDatabasePath().map(Path::toAbsolutePath).map(Path::toString).ifPresent(filenames::add); } WaitForSaveFinishedDialog waitForSaveFinishedDialog = new WaitForSaveFinishedDialog(dialogService); waitForSaveFinishedDialog.showAndWait(getBasePanelList()); tearDownJabRef(filenames); Platform.exit(); return true; }
Source:
<code>public void render(Screen screen) { if (active) { int xOffset = xLoc; int yOffset = yLoc; if (!closing) { <START> Font.defaultFont().drawAlpha(screen, now, xOffset, yOffset, alpha); <END> } yOffset -= 8 * memory.size() + 8; for (int i = 0; i < memory.size(); i++) { Font.defaultFont().drawAlpha(screen, memory.get(i), xOffset, (yOffset += 8), alpha); } } }</code><technical_language>This compile errors, changed method name drawOpaque()</technical_language>

Target:
public void render(Screen screen) { if (active) { int xOffset = xLoc; int yOffset = yLoc; if (!closing) { Font.defaultFont().drawOpaque(screen, "> "+now, xOffset, yOffset, alpha); } yOffset -= 8 * memory.size() + 8; for (int i = 0; i < memory.size(); i++) { Font.defaultFont().drawOpaque(screen, "> "+memory.get(i), xOffset, (yOffset += 8), alpha); } } }
Source:
<code>public RemoveQuotaCommand(T parameters) { super(parameters); <START> setStoragePoolId(parameters.getStoragePoolId()); <END> }</code><technical_language>here, a reason send sp id if i send quota id</technical_language>

Target:
public RemoveQuotaCommand(T parameters) { super(parameters); }
Source:
<code>public CertificateSerialDTO populate(ModelTranslator translator, CertificateSerial source, CertificateSerialDTO dest) { if (source == null) { throw new IllegalArgumentException("source is null"); } if (dest == null) { throw new IllegalArgumentException("dest is null"); } Date created = source.getCreated(); <START> dest.setCreated(created != null ? Instant.ofEpochMilli(created.getTime()).atZone(ZoneId.systemDefault()).toLocalDate(): null); <END> Date updated = source.getUpdated(); dest.setUpdated(updated != null ? Instant.ofEpochMilli(updated.getTime()).atZone(ZoneId.systemDefault()).toLocalDate() : null); dest.id(source.getId() == null ? null : source.getId().toString()); dest.serial(source.getSerial() == null ? null : source.getSerial().toString()); Date expirationDate = source.getExpiration(); dest.expiration(expirationDate != null ? Instant.ofEpochMilli(expirationDate.getTime()).atZone(ZoneId.systemDefault()).toLocalDate() : null); dest.collected(source.isCollected()); dest.revoked(source.isRevoked()); return dest; }</code><technical_language>I if worth effort (and if possible) update entities LocalDate well. While this translation works, I keen I everywhere</technical_language>

Target:
public CertificateSerialDTO populate(ModelTranslator translator, CertificateSerial source, CertificateSerialDTO dest) { if (source == null) { throw new IllegalArgumentException("source is null"); } if (dest == null) { throw new IllegalArgumentException("dest is null"); } Date created = source.getCreated(); dest.setCreated(created != null ? created.toInstant().atOffset(ZoneOffset.UTC) : null); Date updated = source.getUpdated(); dest.setUpdated(updated != null ? updated.toInstant().atOffset(ZoneOffset.UTC) : null); dest.id(source.getId() == null ? null : source.getId().toString()); dest.serial(source.getSerial() == null ? null : source.getSerial().toString()); Date expirationDate = source.getExpiration(); dest.expiration(expirationDate != null ? expirationDate.toInstant().atOffset(ZoneOffset.UTC) : null); dest.collected(source.isCollected()); dest.revoked(source.isRevoked()); return dest; }
Source:
<code>@Override public String toString(boolean pretty) { return new StringBuilder("ModelsComposition [").append(pretty ? "\n\t" : "") .append("aggregator = ").append(predictionsAggregator.toString(pretty)).append(pretty ? "\n\t" : ", ") .append("models = [").append(pretty ? "\n\t\t" : "") .append(models.stream().map(x -> x.toString(false)).collect(Collectors.joining(pretty ? "\n\t\t" : ", "))) <START> .append(pretty ? "\n\t]\n]" : "]]").toString(); <END> }</code><technical_language>a lot of magic char sequences? move constatns util file</technical_language>

Target:
@Override public String toString(boolean pretty) { return ModelTrace.builder("Models composition", pretty) .addField("aggregator", predictionsAggregator.toString(pretty)) .addField("models", models) .toString(); }
Source:
<code>public long put(String key, T value, String context, Integer ttlInSeconds) { Objects.requireNonNull(key); Objects.requireNonNull(value); long now = System.currentTimeMillis(); try { <START> upsertStatement.setString(1, key); <END> upsertStatement.setString(2, context); upsertStatement.setTimestamp(3, new java.sql.Timestamp(now)); upsertStatement.setTimestamp(6, new java.sql.Timestamp(now)); if (ttlInSeconds != null) { long expireTime = now + TimeUnit.MILLISECONDS.convert(ttlInSeconds, TimeUnit.SECONDS); upsertStatement.setTimestamp(4, new java.sql.Timestamp(expireTime)); upsertStatement.setTimestamp(7, new java.sql.Timestamp(expireTime)); } else { upsertStatement.setNull(4, Types.DATE); upsertStatement.setNull(7, Types.DATE); } upsertStatement.setObject(5, getSQLTypeFromValueType(value)); upsertStatement.setObject(8, getSQLTypeFromValueType(value)); upsertStatement.execute(); } catch (SQLException e) { throw new RuntimeException(e); } return now; }</code><technical_language>prepared statements connection thread safe</technical_language>

Target:
public long put(String key, T value, String context, Integer ttlInSeconds) { Objects.requireNonNull(key); Objects.requireNonNull(value); long now = System.currentTimeMillis(); try (Connection connection = dataSource.getConnection()) { try (PreparedStatement upsertStatement = getUpsertStatement(connection)) { upsertStatement.setString(1, key); upsertStatement.setString(2, context); upsertStatement.setTimestamp(3, new java.sql.Timestamp(now)); upsertStatement.setTimestamp(6, new java.sql.Timestamp(now)); if (ttlInSeconds != null) { long expireTime = now + TimeUnit.MILLISECONDS.convert(ttlInSeconds, TimeUnit.SECONDS); upsertStatement.setTimestamp(4, new java.sql.Timestamp(expireTime)); upsertStatement.setTimestamp(7, new java.sql.Timestamp(expireTime)); } else { upsertStatement.setNull(4, Types.DATE); upsertStatement.setNull(7, Types.DATE); } upsertStatement.setObject(5, getSQLTypeFromValueType(value)); upsertStatement.setObject(8, getSQLTypeFromValueType(value)); upsertStatement.execute(); } } catch (SQLException e) { throw new RuntimeException(e); } return now; }
Source:
<code>private void showMediaAboveText() { alignMediaAtTop(videoView); alignMediaAtTop(qrView); alignMediaAtTop(imageView); alignMediaAtTop(resizingImageView); alignMediaAtTop(missingMediaBackground); alignMediaAtTop(downloadIcon); alignMediaAtTop(progressBar); <START> <END> alignTextContainerBelowMediaView(audioButton); alignTextContainerBelowMediaView(textViewContainer); }</code><technical_language>confused remove videoButton</technical_language>

Target:
private void showMediaAboveText() { questionBottomBarrier.setReferencedIds(new int[]{ R.id.top_guideline }); mediaLayoutBottomBarrier.setReferencedIds(new int[]{ R.id.missing_media_tv, R.id.inline_video_view, R.id.qr_view, R.id.image, R.id.resizing_image }); }
Source:
<code>long checkConfigAndRunSweep(SweepLocks locks) throws InterruptedException { if (isSweepEnabled.get()) { return grabLocksAndRun(locks); } else { log.debug("Skipping sweep because it is currently disabled."); } <START> return 20 * (1000 + sweepPauseMillis.get()); <END> }</code><technical_language>nit: extract this other 20*(1000 + sweepPauseMillis.get()) getBackoffTimeOnFailure(). expression a bit arbitrary, I guess reasons for choice - in case existing behaviour</technical_language>

Target:
long checkConfigAndRunSweep(SweepLocks locks) throws InterruptedException { if (isSweepEnabled.get()) { return grabLocksAndRun(locks); } else { log.debug("Skipping sweep because it is currently disabled."); } return getBackoffTimeWhenSweepHasNotRun(); }
Source:
<code><START> public Iterable<Map.Entry<String, Object>> orderMap(DataMap map) <END> { return Data.orderMapEntries(map); }</code><technical_language>I curious this method is called</technical_language>

Target:
public Iterable<Map.Entry<String, Object>> orderMap(DataMap map) { if (_orderMapEntriesByKey) { return Data.orderMapEntries(map); } else { return map.entrySet(); } }
Source:
<code>public Set<ApprovalCategoryValue.Id> getApprovals() { <START> return Collections.unmodifiableSet(approvals); <END> }</code><technical_language>"Collections.unmodifiableSet(approvals);" "approvals" variable is defined "Collections.unmodifiableSet"</technical_language>

Target:
public Set<ApprovalCategoryValue.Id> getApprovals() { return approvals; }
Source:
<code>public void testInvalidNullDefaultForInt() throws Exception { MessageSpec testMessageSpec = MessageGenerator.JSON_SERDE.readValue(String.join("", Arrays.asList( "{", " \"type\": \"request\",", " \"name\": \"FooBar\",", " \"validVersions\": \"0-2\",", " \"fields\": [", " { \"name\": \"field1\", \"type\": \"int32\", \"versions\": \"0+\", \"default\": \"null\" }", " ]", "}")), MessageSpec.class); try { <START> new MessageDataGenerator("test").generate(testMessageSpec); <END> fail("Expected MessageDataGenerator#generate to fail"); } catch (Throwable e) { assertTrue("Invalid error message: " + e.getMessage(), e.getMessage().contains("Invalid default for int32")); } }</code><technical_language>This org.apache.kafka.common.message match directory generated source files outputted</technical_language>

Target:
public void testInvalidNullDefaultForInt() throws Exception { MessageSpec testMessageSpec = MessageGenerator.JSON_SERDE.readValue(String.join("", Arrays.asList( "{", " \"type\": \"request\",", " \"name\": \"FooBar\",", " \"validVersions\": \"0-2\",", " \"fields\": [", " { \"name\": \"field1\", \"type\": \"int32\", \"versions\": \"0+\", \"default\": \"null\" }", " ]", "}")), MessageSpec.class); try { new MessageDataGenerator("org.apache.kafka.common.message").generate(testMessageSpec); fail("Expected MessageDataGenerator#generate to fail"); } catch (Throwable e) { assertTrue("Invalid error message: " + e.getMessage(), e.getMessage().contains("Invalid default for int32")); } }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } <START> MetricOptions version = (MetricOptions) o; <END> return options.equals(version.options); }</code><technical_language>rename version "other" - version confusing in future :)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MetricOptions other = (MetricOptions) o; return options.equals(other.options); }
Source:
<code>public HttpPipeline build() { if (httpClient == null) { return new HttpPipeline(HttpClient.createDefault(), pipelinePolicies); } else { return new HttpPipeline(httpClient, pipelinePolicies); <START> } <END> }</code><technical_language>Move this inline a ternary operator if / else</technical_language>

Target:
public HttpPipeline build() { List<HttpPipelinePolicy> policies = (pipelinePolicies == null) ? new ArrayList<>() : pipelinePolicies; HttpClient client = (httpClient == null) ? HttpClient.createDefault() : httpClient; return new HttpPipeline(client, policies); }
Source:
<code>@SuppressWarnings("checkstyle:magicnumber") private void init(@NonNull String qNumber) { inflate(getContext(), R.layout.view_description_edit_revert_help, this); ButterKnife.bind(this); helpText.setMovementMethod(new LinkMovementMethod()); Spanned helpStr = StringUtil.fromHtml(getString(R.string.description_edit_revert_help_body) .replaceAll(":revertSubtitle", getString(R.string.description_edit_revert_subtitle)) .replaceAll(":revertIntro", getString(R.string.description_edit_revert_intro)) .replaceAll(":revertHistory", String.format(getString(R.string.description_edit_revert_history), getHistoryUri(qNumber)))); SpannableString revertReason1 = new SpannableString(StringUtil.fromHtml(String.format(getString(R.string.description_edit_revert_reason1), getString(R.string.wikidata_description_guide_url)))); SpannableString revertReason2 = new SpannableString(StringUtil.fromHtml(getString(R.string.description_edit_revert_reason2))); revertReason1.setSpan(new <START> BulletSpan(16), <END> 0, revertReason1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); revertReason2.setSpan(new BulletSpan(16), 0, revertReason2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); SpannableString helpSpan = new SpannableString(TextUtils.expandTemplate(helpStr, revertReason1, revertReason2)); helpText.setText(helpSpan); }</code><technical_language>Assuming this is supposed DP units, translate PX units, DimenUtil.roundedDpToPx()</technical_language>

Target:
@SuppressWarnings("checkstyle:magicnumber") private void init(@NonNull String qNumber) { inflate(getContext(), R.layout.view_description_edit_revert_help, this); ButterKnife.bind(this); helpText.setMovementMethod(new LinkMovementMethod()); Spanned helpStr = StringUtil.fromHtml(getString(R.string.description_edit_revert_help_body) .replaceAll(":revertSubtitle", getString(R.string.description_edit_revert_subtitle)) .replaceAll(":revertIntro", getString(R.string.description_edit_revert_intro)) .replaceAll(":revertHistory", String.format(getString(R.string.description_edit_revert_history), getHistoryUri(qNumber)))); int gapWidth = DimenUtil.roundedDpToPx(8); SpannableString revertReason1 = new SpannableString(StringUtil.fromHtml(String.format(getString(R.string.description_edit_revert_reason1), getString(R.string.wikidata_description_guide_url)))); SpannableString revertReason2 = new SpannableString(StringUtil.fromHtml(getString(R.string.description_edit_revert_reason2))); revertReason1.setSpan(new BulletSpan(gapWidth), 0, revertReason1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); revertReason2.setSpan(new BulletSpan(gapWidth), 0, revertReason2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); SpannableString helpSpan = new SpannableString(TextUtils.expandTemplate(helpStr, revertReason1, revertReason2)); helpText.setText(helpSpan); }
Source:
<code>public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { WarehouseInstance.Tuple tuple = primary.dump(primaryDbName, null); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); tuple = primary.dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); String testDbName = primaryDbName + "_test"; tuple = primary.run(" create database " + testDbName) .run("create table " + testDbName + ".tbl (fld int)") .dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); <START> Database replicaDb = replica.getDatabase(replicatedDbName); <END> assertTrue(replicaDb.getParameters().get("repl.last.id").equalsIgnoreCase(tuple.lastReplicationId)); tuple = primary.dump("someJunkDB", tuple.lastReplicationId); CommandProcessorResponse response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.metadata.hiveException: " + "database does not exist"); tuple = primary.dump("someJunkDB", null); response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.parse.semanticException:" + " no data to load in path"); primary.run(" drop database if exists " + testDbName + " cascade"); replica.run(" drop database if exists " + testDbName + " cascade"); }</code><technical_language>REPL STATUS called fetches Database object. This step needed here</technical_language>

Target:
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { WarehouseInstance.Tuple tuple = primary.dump(primaryDbName, null); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); tuple = primary.dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); String testDbName = primaryDbName + "_test"; tuple = primary.run(" create database " + testDbName) .run("create table " + testDbName + ".tbl (fld int)") .dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); tuple = primary.dump("someJunkDB", tuple.lastReplicationId); CommandProcessorResponse response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.metadata.hiveException: " + "database does not exist"); tuple = primary.dump("someJunkDB", null); response = replica.runCommand("REPL LOAD someJunkDB from " + tuple.dumpLocation); response.getErrorMessage().toLowerCase().contains("org.apache.hadoop.hive.ql.parse.semanticException:" + " no data to load in path"); primary.run(" drop database if exists " + testDbName + " cascade"); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.preview_image_fragment, container, false); mProgressBar = view.findViewById(R.id.syncProgressBar); DisplayUtils.colorPreLollipopHorizontalProgressBar(mProgressBar); mImageView = view.findViewById(R.id.photo_view); mImageView.setVisibility(View.GONE); mImageView.setOnClickListener(v -> { if(getActivity() != null) { ((PreviewImageActivity) getActivity()).toggleFullScreen(); } }); <START> TextView mMessageView = view.findViewById(R.id.message); <END> mMessageView.setVisibility(View.GONE); ProgressBar mProgressWheel = view.findViewById(R.id.progressWheel); mProgressWheel.setVisibility(View.VISIBLE); return view; }</code><technical_language>Rename messageView</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.preview_image_fragment, container, false); mProgressBar = view.findViewById(R.id.syncProgressBar); DisplayUtils.colorPreLollipopHorizontalProgressBar(mProgressBar); mImageView = view.findViewById(R.id.photo_view); mImageView.setVisibility(View.GONE); mImageView.setOnClickListener(v -> { if(getActivity() != null) { ((PreviewImageActivity) getActivity()).toggleFullScreen(); } }); TextView messageview = view.findViewById(R.id.message); messageview.setVisibility(View.GONE); ProgressBar progressWheel = view.findViewById(R.id.progressWheel); progressWheel.setVisibility(View.VISIBLE); return view; }
Source:
<code>protected Proc runSvnServe(File repo) throws Exception { LocalLauncher launcher = new LocalLauncher(StreamTaskListener.fromStdout()); try { launcher.launch().cmds("svnserve","--help").start().join(); } catch (IOException e) { Assert.fail("Failed to launch svnserve. Do you have subversion installed?\n" + e); } Socket s = null; try { s = new Socket("localhost", 3690); fail("Port 3690 is currently in use. Please kill anything running on this port and re-run."); } catch (IOException e) { } finally { if (s != null) { s.close(); } } <START> <END> return launcher.launch().cmds( "svnserve","-d","--foreground","-r",repo.getAbsolutePath()).pwd(repo).start(); }</code><technical_language>Is this change specific this PR, done separately in trunk? (BTW some point good replace usages of HudsonTestCase JenkinsRule; org.junit.Assume test considered skipped failed if is infrastructure problem. Of select arbitrary open port.)</technical_language>

Target:
protected Proc runSvnServe(File repo) throws Exception { LocalLauncher launcher = new LocalLauncher(StreamTaskListener.fromStdout()); try { launcher.launch().cmds("svnserve","--help").start().join(); } catch (IOException e) { Assert.fail("Failed to launch svnserve. Do you have subversion installed?\n" + e); } Socket s = null; ServerSocket serverSocket = null; int port = 3690; try { s = new Socket("localhost", 3690); System.err.println("Port 3690 is currently in use. Using a random port."); serverSocket = new ServerSocket(0); port = serverSocket.getLocalPort(); serverSocket.close(); } catch (IOException e) { } finally { if (s != null) { s.close(); } } return launcher.launch().cmds( "svnserve","-d","--foreground","-r",repo.getAbsolutePath(), "--listen-port", String.valueOf(port)).pwd(repo).start(); }
Source:
<code>private short readShort( long pageId, int pageOffset ) throws IOException { if ( pageSize - pageOffset < 2 ) { long originalPageId = currentPageId; int originalPageOffset = currentPageOffset; try { <START> currentPageId = pageId; <END> currentPageOffset = pageOffset; return super.readShort(); } finally { currentPageId = originalPageId; currentPageOffset = originalPageOffset; } } moveCursor( pageId, pageOffset ); short val; do { val = cursor.getShort( pageOffset ); } while ( cursor.shouldRetry() ); boundsCheck(); return val; }</code><technical_language>This produce torn reads shouldRetry protects individual bytes, word. Hmm technically fine, mapped files read-only, duking out eviction</technical_language>

Target:
private short readShort( long pageId, int pageOffset ) throws IOException { if ( pageSize - pageOffset < 2 ) { byte byte1 = readByte( pageId, pageOffset ); byte byte2 = readByte( pageId + 1, 0 ); return (short) (((byte1 & 0xFF) << 8) | (byte2 & 0xFF)); } moveCursorTo( pageId, pageOffset ); short val; do { val = cursor.getShort( pageOffset ); } while ( cursor.shouldRetry() ); if ( cursor.checkAndClearBoundsFlag() ) { throw newEOFException( "Cursor bounds check failed" ); } return val; }
Source:
<code>private int readNoFilter(int[] positions, int positionCount) throws IOException { int maxPositionCount = positions[positionCount - 1] + 1; <START> if (maxPositionCount * (1 - BATCH_EXECUTION_FILTERRATE_THRESHOLD) <= positionCount) { <END> if (presentStream != null) { int nonNullCount = maxPositionCount - presentStream.getUnsetBits(maxPositionCount, nulls); dataStream.next(values, nonNullCount); if (maxPositionCount != positionCount) { if (maxPositionCount != nonNullCount) { unpackByteNulls(values, nulls, maxPositionCount, nonNullCount); } packBytesForPositions(values, positions, positionCount); packBooleansForPositions(nulls, positions, positionCount); } else if (maxPositionCount != nonNullCount) { unpackByteNulls(values, nulls, maxPositionCount, nonNullCount); } } else { dataStream.next(values, maxPositionCount); if (maxPositionCount != positionCount) { packBytesForPositions(values, positions, positionCount); } } outputPositionCount = positionCount; return maxPositionCount; } int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { nulls[i] = true; } else { values[i] = dataStream.next(); if (presentStream != null) { nulls[i] = false; } } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }</code><technical_language>consider moving this a helper method in ReaderUtils</technical_language>

Target:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int totalPositionCount = positions[positionCount - 1] + 1; if (totalPositionCount * (1 - BATCH_EXECUTION_FILTERRATE_THRESHOLD) <= positionCount) { if (presentStream != null) { int nonNullCount = totalPositionCount - presentStream.getUnsetBits(totalPositionCount, nulls); dataStream.next(values, nonNullCount); unpackByteNulls(values, nulls, totalPositionCount, nonNullCount); if (totalPositionCount > positionCount) { packBytesForPositions(values, positions, positionCount); packBooleansForPositions(nulls, positions, positionCount); } } else { dataStream.next(values, totalPositionCount); if (totalPositionCount > positionCount) { packBytesForPositions(values, positions, positionCount); } } outputPositionCount = positionCount; return totalPositionCount; } int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { nulls[i] = true; } else { values[i] = dataStream.next(); if (presentStream != null) { nulls[i] = false; } } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }
Source:
<code>public StartAtlasDbTransactionResponse startAtlasDbTransaction(IdentifiedTimeLockRequest request) { if (shouldUseStartAtlasDbTransactionEndpoint()) { try { StartAtlasDbTransactionResponse response = delegate.startAtlasDbTransaction(request); serverSupportsStartAtlasDbTransaction = true; return response; } catch (AtlasDbRemoteException remoteException) { if (remoteException.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { <START> serverSupportsStartAtlasDbTransaction = false; <END> return startTransactionViaConstituentCalls(request); } throw remoteException; } } return startTransactionViaConstituentCalls(request); }</code><technical_language>confirm, if TimeLock get a 50X response</technical_language>

Target:
public StartAtlasDbTransactionResponse startAtlasDbTransaction(IdentifiedTimeLockRequest request) { if (shouldUseStartAtlasDbTransactionEndpoint()) { try { StartAtlasDbTransactionResponse response = delegate.startAtlasDbTransaction(request); serverSupportsStartAtlasDbTransaction = true; return response; } catch (AtlasDbRemoteException remoteException) { if (remoteException.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { serverSupportsStartAtlasDbTransaction = false; return startTransactionViaConstituentCalls(request); } throw remoteException; } } else { return startTransactionViaConstituentCalls(request); } }
Source:
<code>public static AssemblyRegion assemblyRegionWithWellMappedReads(final AssemblyRegion originalAssemblyRegion, final int minMappingQuality, final SAMFileHeader readsHeader) { final AssemblyRegion result = new AssemblyRegion(originalAssemblyRegion.getSpan(), originalAssemblyRegion.getSupportingStates(), originalAssemblyRegion.isActive(), originalAssemblyRegion.getExtension(), readsHeader); <START> for (final GATKRead rec : originalAssemblyRegion.getReads()) { <END> if (rec.getMappingQuality() >= minMappingQuality) { result.add(rec); } } return result; }</code><technical_language>a stream for this for loop? java originalAssemblyRegion.getReads().stream().filter(rec -> rec.getMappingQuality() >= minMappingQuality).forEach(rec -> result.add(rec));</technical_language>

Target:
public static AssemblyRegion assemblyRegionWithWellMappedReads(final AssemblyRegion originalAssemblyRegion, final int minMappingQuality, final SAMFileHeader readsHeader) { final AssemblyRegion result = new AssemblyRegion(originalAssemblyRegion.getSpan(), originalAssemblyRegion.getSupportingStates(), originalAssemblyRegion.isActive(), originalAssemblyRegion.getExtension(), readsHeader); originalAssemblyRegion.getReads().stream() .filter(rec -> rec.getMappingQuality() >= minMappingQuality) .forEach(result::add); return result; }
Source:
<code>public void testTrailingWildcardParameter_slashes() { ConjureRuntime runtime = DefaultConjureRuntime.builder().build(); <START> Channel channel = mock(Channel.class); <END> Response response = mock(Response.class); when(response.body()).thenReturn(new ByteArrayInputStream(new byte[0])); when(response.code()).thenReturn(204); when(response.headers()).thenReturn(ImmutableListMultimap.of()); when(channel.execute(any(Endpoint.class), any(Request.class))).thenReturn(Futures.immediateFuture(response)); StubService service = JaxRsClient.create(StubService.class, channel, runtime); service.complexPath("dynamic0", "dynamic1/dynamic2"); ArgumentCaptor<Endpoint> endpointCaptor = ArgumentCaptor.forClass(Endpoint.class); ArgumentCaptor<Request> requestCaptor = ArgumentCaptor.forClass(Request.class); verify(channel).execute(endpointCaptor.capture(), requestCaptor.capture()); UrlBuilder urlBuilder = mock(UrlBuilder.class); endpointCaptor.getValue().renderPath(ImmutableMap.of(), urlBuilder); verify(urlBuilder).pathSegment("foo"); verify(urlBuilder).pathSegment("static0"); verify(urlBuilder).pathSegment("dynamic0"); verify(urlBuilder).pathSegment("static1"); verify(urlBuilder).pathSegment("dynamic1/dynamic2"); }</code><technical_language>cleaner create mocks class level instead of test</technical_language>

Target:
public void testTrailingWildcardParameter_slashes() { Channel channel = stubNoContentResponseChannel(); StubService service = JaxRsClient.create(StubService.class, channel, runtime); service.complexPath("dynamic0", "dynamic1/dynamic2"); ArgumentCaptor<Endpoint> endpointCaptor = ArgumentCaptor.forClass(Endpoint.class); ArgumentCaptor<Request> requestCaptor = ArgumentCaptor.forClass(Request.class); verify(channel).execute(endpointCaptor.capture(), requestCaptor.capture()); UrlBuilder urlBuilder = mock(UrlBuilder.class); endpointCaptor.getValue().renderPath(ImmutableMap.of(), urlBuilder); verify(urlBuilder).pathSegment("foo"); verify(urlBuilder).pathSegment("static0"); verify(urlBuilder).pathSegment("dynamic0"); verify(urlBuilder).pathSegment("static1"); verify(urlBuilder).pathSegment("dynamic1/dynamic2"); }
Source:
<code>void reset(int startLine, int lineCount, boolean resetByStyles) { int endLine = startLine + lineCount; if (startLine < 0 || endLine > lineWidth.length) return; for (int i = startLine; i < endLine; i++) { <START> lineStylesDirty[i] = resetByStyles; <END> if (!resetByStyles) { lineWidth[i] = -1; lineHeight[i] = -1; } } if (startLine <= maxWidthLineIndex && maxWidthLineIndex < endLine) { maxWidth = 0; maxWidthLineIndex = -1; if (lineCount != this.lineCount) { for (int i = 0; i < this.lineCount; i++) { if (lineWidth[i] > maxWidth) { maxWidth = lineWidth[i]; maxWidthLineIndex = i; } } } } }</code><technical_language>I in case, true</technical_language>

Target:
void reset(int startLine, int lineCount, boolean resetByStyles) { int endLine = startLine + lineCount; if (startLine < 0 || endLine > lineSizes.length) return; for (int i = startLine; i < endLine; i++) { LineSizeInfo lineSize = getLineSize(i); if (resetByStyles) { int start = content.getOffsetAtLine(i); int length = content.getLine(i).length(); StyleRange[] ranges = getStyleRanges(start, length, false); lineSize.update(ranges); } else { lineSize.resetSize(); } } if (startLine <= maxWidthLineIndex && maxWidthLineIndex < endLine) { maxWidth = 0; maxWidthLineIndex = -1; if (lineCount != this.lineCount) { for (int i = 0; i < this.lineCount; i++) { LineSizeInfo lineSize = getLineSize(i); if (lineSize.width > maxWidth) { maxWidth = lineSize.width; maxWidthLineIndex = i; } } } } }
Source:
<code><START> static boolean onKeyUp(final HTMLInputElement input) { <END> final String oldValue = getOldAttribute(input); final int newValue = toInt(input.value); if (!isValidValue(input, newValue)) { input.value = oldValue; } return true; }</code><technical_language>please, onKeyDown is private onKeyUp is not</technical_language>

Target:
private static boolean onKeyUp(final HTMLInputElement input) { final String oldValue = getOldAttribute(input); final int newValue = toNonNullInt(input.value); if (!isValidValue(input, newValue)) { input.value = oldValue; } return true; }
Source:
<code>public String getProjectTemplateTitles(int id) { try { return serviceManager.getProjectService().getProjectTemplatesTitlesAsString(id); } catch (DAOException e) { logger.error(e.getMessage()); FacesContext facesContext = FacesContext.getCurrentInstance(); <START> FacesMessage facesMessage = new FacesMessage("ERROR: Unable to retrieve templates for project!"); <END> facesContext.addMessage(null, facesMessage); return null; } }</code><technical_language>Output message is translatable</technical_language>

Target:
public String getProjectTemplateTitles(int id) { try { return serviceManager.getProjectService().getProjectTemplatesTitlesAsString(id); } catch (DAOException e) { logger.error(e.getMessage()); FacesContext facesContext = FacesContext.getCurrentInstance(); FacesMessage facesMessage = new FacesMessage(Helper.getTranslation("unableToRetrieveTemplates")); facesContext.addMessage(null, facesMessage); return null; } }
Source:
<code><START> static int getStaged(@Nullable IndexDiffData indexDiff) { <END> if (indexDiff == null) { return 0; } int size = indexDiff.getAdded().size(); size += indexDiff.getChanged().size(); size += indexDiff.getRemoved().size(); return size; }</code><technical_language>this method declared private</technical_language>

Target:
private static int getStaged(@Nullable IndexDiffData indexDiff) { if (indexDiff == null) { return 0; } int size = indexDiff.getAdded().size(); size += indexDiff.getChanged().size(); size += indexDiff.getRemoved().size(); return size; }
Source:
<code>public Object evaluate(ProcessContext context) throws Exception { Map<String, Object> variables = new HashMap<>(); variables.put("kcontext", context); Globals globals = context.getKieRuntime().getGlobals(); if (globals != null && globals.getGlobalKeys() != null) { for (String gKey : globals.getGlobalKeys()) { variables.put(gKey, globals.get(gKey)); } } if (context.getProcessInstance() != null && context.getProcessInstance().getProcess() != null) { VariableScopeInstance variableScope = (VariableScopeInstance) ((WorkflowProcessInstance)context.getProcessInstance()) .getContextInstance(VariableScope.VARIABLE_SCOPE); if (variables != null ) { variables.putAll(variableScope.getVariables()); } } <START> FEEL feel = FEEL.newInstance(); <END> Object value = feel.evaluate(expr, variables); if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Constraints must return boolean values: " + expr + " returns " + value + (value == null? "" : " (type=" + value.getClass())); } return ((Boolean) value).booleanValue(); }</code><technical_language>Ideally, need cache, configurations (profiles) need enabled instantiation. @tarilabs show maciej this is configuration DMN engine? concern is: if a process invoking DMN decision services, FEEL instance configuration for both</technical_language>

Target:
public Object evaluate(ProcessContext context) throws Exception { Map<String, Object> variables = new HashMap<>(); variables.put("kcontext", context); Globals globals = context.getKieRuntime().getGlobals(); if (globals != null && globals.getGlobalKeys() != null) { for (String gKey : globals.getGlobalKeys()) { variables.put(gKey, globals.get(gKey)); } } if (context.getProcessInstance() != null && context.getProcessInstance().getProcess() != null) { VariableScopeInstance variableScope = (VariableScopeInstance) ((WorkflowProcessInstance)context.getProcessInstance()) .getContextInstance(VariableScope.VARIABLE_SCOPE); if (variables != null ) { variables.putAll(variableScope.getVariables()); } } DMNRuntime runtime = ((KieSession) context.getKieRuntime()).getKieRuntime(DMNRuntime.class); List<FEELProfile> profiles = (List)((DMNRuntimeImpl) runtime).getProfiles(); FEEL feel = FEEL.newInstance(runtime.getRootClassLoader(), profiles); Object value = feel.evaluate(expr, variables); if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Constraints must return boolean values: " + expr + " returns " + value + (value == null? "" : " (type=" + value.getClass())); } return ((Boolean) value).booleanValue(); }
Source:
<code>public void testOutExpire() { <START> sp.out ("PUSH", "ONE", 1000L); <END> sp.out ("PUSH", "TWO", 2000L); sp.out ("PUSH", "THREE", 3000L); sp.out ("PUSH", "FOUR", 4000L); assertEquals ("ONE", sp.rdp ("PUSH")); ISOUtil.sleep (1500L); assertEquals ("TWO", sp.rdp ("PUSH")); ISOUtil.sleep (1000L); assertEquals ("THREE", sp.rdp ("PUSH")); assertEquals ("THREE", sp.inp ("PUSH")); assertEquals ("FOUR", sp.inp ("PUSH")); assertNull (sp.rdp ("PUSH")); }</code><technical_language>a big deal, key name anything, "PUSH" in testOutExpire is confusing a new user. want "OUT" key, other key</technical_language>

Target:
public void testOutExpire() { sp.out ("OUT", "ONE", 1000L); sp.out ("OUT", "TWO", 2000L); sp.out ("OUT", "THREE", 3000L); sp.out ("OUT", "FOUR", 4000L); assertEquals ("ONE", sp.rdp ("OUT")); ISOUtil.sleep (1500L); assertEquals ("TWO", sp.rdp ("OUT")); ISOUtil.sleep (1000L); assertEquals ("THREE", sp.rdp ("OUT")); assertEquals ("THREE", sp.inp ("OUT")); assertEquals ("FOUR", sp.inp ("OUT")); assertNull (sp.rdp ("OUT")); }
Source:
<code><START> FunctionsMap getFunctions() { <END> return this.functions; }</code><technical_language>if sense extract interface clients modify instance anymore, i.e. return expose addAll( ) methods anymore</technical_language>

Target:
Functions getFunctions() { return this.functions; }
Source:
<code>protected void appendAllLocalVariableDefinitions(Map<String, Collection<String>> definitions, EObject context) { super.appendAllLocalVariableDefinitions(definitions, context); EditMaskVariables emv = null; if (context instanceof LabelEditTool) { emv = ((LabelEditTool) context).getMask(); <START> for (AbstractVariable subVar : ((LabelEditTool) context).getVariables()) { <END> availableVariables.put(subVar.getName(), AbstractInterpretedExpressionQuery.DEFAULT_VARIABLE_TYPE); } } else if (context instanceof CreateCellTool) { emv = ((CreateCellTool) context).getMask(); } if (emv != null) { appendEditMaskVariables(emv, definitions); } }</code><technical_language>If label edit tool extends AbstractToolDescription, need for this</technical_language>

Target:
protected void appendAllLocalVariableDefinitions(Map<String, Collection<String>> definitions, EObject context) { super.appendAllLocalVariableDefinitions(definitions, context); EditMaskVariables emv = null; if (context instanceof LabelEditTool) { emv = ((LabelEditTool) context).getMask(); for (AbstractVariable subVar : ((LabelEditTool) context).getVariables()) { availableVariables.put(subVar.getName(), getVariableTypeName(subVar)); } } else if (context instanceof CreateCellTool) { emv = ((CreateCellTool) context).getMask(); } if (emv != null) { appendEditMaskVariables(emv, definitions); } }
Source:
<code>public Map<String, String> getJobMessageProperties() { jobProperties = new HashMap<>(); List<PermissionSubject> subjects = getPermissionCheckSubjects(); <START> if (jobProperties == null && subjects != null && !subjects.isEmpty()) { <END> VdcObjectType entityType; Guid entityId; String value; for (PermissionSubject permSubject : subjects) { entityType = permSubject.getObjectType(); entityId = permSubject.getObjectId(); if (entityType != null && entityId != null) { value = DbFacade.getInstance().getEntityNameByIdAndType(entityId, entityType); if (value == null) { value = entityId.toString(); } jobProperties.put(entityType.name().toLowerCase(), value); } } } return jobProperties; }</code><technical_language>jobProperties null, instantiate lines up</technical_language>

Target:
public Map<String, String> getJobMessageProperties() { jobProperties = new HashMap<>(); List<PermissionSubject> subjects = getPermissionCheckSubjects(); if (!subjects.isEmpty()) { VdcObjectType entityType; Guid entityId; String value; for (PermissionSubject permSubject : subjects) { entityType = permSubject.getObjectType(); entityId = permSubject.getObjectId(); if (entityType != null && entityId != null) { value = DbFacade.getInstance().getEntityNameByIdAndType(entityId, entityType); if (value == null) { value = entityId.toString(); } jobProperties.put(entityType.name().toLowerCase(), value); } } } return jobProperties; }
Source:
<code>public void testTriggerMerge() throws Exception { boolean onlyTriggerPhrase = true; boolean onlyAdminsMerge = false; boolean disallowOwnCode = false; GhprbPullRequestMerge merger = setupMerger(onlyTriggerPhrase, onlyAdminsMerge, disallowOwnCode); setupConditions(adminLogin, committerName, committerEmail, triggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); setupConditions(adminLogin, committerName, committerEmail, nonTriggerPhrase); <START> assertThat(merger.perform(build, null, listener)).isEqualTo(true); <END> }</code><technical_language>intentions verify merge happen. verify merge attempted</technical_language>

Target:
public void testTriggerMerge() throws Exception { boolean onlyTriggerPhrase = true; boolean onlyAdminsMerge = false; boolean disallowOwnCode = false; GhprbPullRequestMerge merger = setupMerger(onlyTriggerPhrase, onlyAdminsMerge, disallowOwnCode); setupConditions(adminLogin, committerName, committerEmail, triggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); verify(pr, times(1)).merge(mergeComment); setupConditions(adminLogin, committerName, committerEmail, nonTriggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); verify(pr, times(1)).merge(mergeComment); }
Source:
<code>public String toString() { List<String> allConstraints = Lists2.map(typeVariableConstraints, TypeVariableConstraint::toString); return name + (allConstraints.isEmpty() ? "" : "<" + String.join(",", allConstraints) + ">") + <START> "(" + String.join(",", Lists2.map(argumentTypes, TypeSignature::toString)) + "):" + returnType; <END> }</code><technical_language>need change fyi: I added a Lists2.joinOn</technical_language>

Target:
public String toString() { List<String> allConstraints = Lists2.map(typeVariableConstraints, TypeVariableConstraint::toString); return name + (allConstraints.isEmpty() ? "" : "<" + String.join(",", allConstraints) + ">") + "(" + Lists2.joinOn(",", argumentTypes, TypeSignature::toString) + "):" + returnType; }
Source:
<code>private AlertDialog showInstallPsmartAppDownloadDialog() { AlertDialog.Builder downloadDialog = new AlertDialog.Builder(activity); downloadDialog.setTitle("Install P-Smart app"); downloadDialog.setMessage("Would you like to install P-Smart app?"); downloadDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { <START> String packageName = "org.kenyahmis.psmart"; <END> Uri uri = Uri.parse("market://details?id=" + packageName); Intent intent = new Intent(Intent.ACTION_VIEW, uri); try { activity.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(TAG, "Google Play is not installed; cannot install " + packageName, e); } } }); downloadDialog.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); return downloadDialog.show(); }</code><technical_language>package name a literal string</technical_language>

Target:
private AlertDialog showInstallPsmartAppDownloadDialog() { AlertDialog.Builder downloadDialog = new AlertDialog.Builder(activity); downloadDialog.setTitle(activity.getString(R.string.title_install_psmart)); downloadDialog.setMessage(activity.getString(R.string.hint_install_psmart)); downloadDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { String packageName = "org.kenyahmis.psmart"; Uri uri = Uri.parse("market://details?id=" + packageName); Intent intent = new Intent(Intent.ACTION_VIEW, uri); try { activity.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(TAG, "Google Play is not installed; cannot install " + packageName, e); } } }); downloadDialog.setNegativeButton(R.string.general_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); return downloadDialog.show(); }
Source:
<code>public void run() { boolean terminate = !readState(); <START> setChecked(terminate); <END> IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID); if (preferences != null) { preferences.putBoolean(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, terminate); try { preferences.flush(); } catch (BackingStoreException e) { } } }</code><technical_language>I need call setChecked() is done automatically for a checkbox. Notice call in GdbConsoleScrollLockAction</technical_language>

Target:
public void run() { IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID); if (preferences != null) { preferences.putBoolean(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, !readState()); try { preferences.flush(); } catch (BackingStoreException e) { } } }
Source:
<code>public void stop() throws Exception { <START> this.zooKeeperClient.getConnectionStateListenable().removeListener(connectionStateListener); <END> }</code><technical_language>scheduler.shutdownNow();</technical_language>

Target:
public void stop() throws Exception { zooKeeperClient.getConnectionStateListenable().removeListener(connectionStateListener); scheduler.shutdown(); }