auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String getValidReferenceId(Client client) throws AvroRemoteException { final SearchReferenceSetsRequest refSetsReq = SearchReferenceSetsRequest.newBuilder() .setAssemblyId(TestData.REFERENCESET_ASSEMBLY_ID) .build(); final SearchReferenceSetsResponse refSetsResp = client.references.searchReferenceSets(refSetsReq); <START> final List<ReferenceSet> refSets = refSetsResp.getReferenceSets(); <END> final SearchReferencesRequest refsReq = SearchReferencesRequest .newBuilder() .setReferenceSetId(refSets.get(0).getId()) .setMd5checksum(TestData.REFERENCE_BRCA1_MD5_CHECKSUM) .build(); final SearchReferencesResponse refsResp = client.references.searchReferences(refsReq); assertThat(refsResp).isNotNull(); final List<Reference> references = refsResp.getReferences(); assertThat(references).isNotNull().isNotEmpty(); assertThat(references).hasSize(1); return references.get(0).getId(); }</code><technical_language>assert size 1 here</technical_language>

Target:
public static String getValidReferenceId(Client client) throws AvroRemoteException { final SearchReferencesRequest refsReq = SearchReferencesRequest .newBuilder() .setReferenceSetId(Utils.getReferenceSetIdByAssemblyId(client, TestData.REFERENCESET_ASSEMBLY_ID)) .setMd5checksum(TestData.REFERENCE_BRCA1_MD5_CHECKSUM) .build(); final SearchReferencesResponse refsResp = client.references.searchReferences(refsReq); assertThat(refsResp).isNotNull(); final List<Reference> references = refsResp.getReferences(); assertThat(references).isNotNull().isNotEmpty(); assertThat(references).hasSize(1); return references.get(0).getId(); }
Source:
<code>public void testBasicAsync() throws IOException, InterruptedException, KeeperException { ZooKeeper zk = null; try { zk = createClient(new CountdownWatcher(), hostPort); final CountDownLatch latch = new CountDownLatch(1); AsyncCallback.VoidCallback cb = new AsyncCallback.VoidCallback() { @Override public void processResult(int rc, String path, Object ctx) { <START> if ( rc == 0 ) { <END> latch.countDown(); } } }; zk.addPersistentWatch("/a/b", persistentWatcher, cb, null); Assert.assertTrue(latch.await(5, TimeUnit.SECONDS)); internalTestBasic(zk); } finally { if (zk != null) { zk.close(); } } }</code><technical_language>nit: if expression extra spaces</technical_language>

Target:
public void testBasicAsync() throws IOException, InterruptedException, KeeperException { try ( ZooKeeper zk = createClient(new CountdownWatcher(), hostPort) ) { final CountDownLatch latch = new CountDownLatch(1); AsyncCallback.VoidCallback cb = new AsyncCallback.VoidCallback() { @Override public void processResult(int rc, String path, Object ctx) { if (rc == 0) { latch.countDown(); } } }; zk.addPersistentWatch("/a/b", persistentWatcher, false, cb, null); Assert.assertTrue(latch.await(5, TimeUnit.SECONDS)); internalTestBasic(zk); } }
Source:
<code>public void read(BitBuffer input) throws CTFReaderException { alignRead(input, this.declaration); boolean signed = declaration.isSigned(); int length = declaration.getLength(); long bits = 0; ByteOrder previousByteOrder = input.getByteOrder(); if ((this.declaration.getByteOrder() != null) && (this.declaration.getByteOrder() != input.getByteOrder())) { input.setByteOrder(this.declaration.getByteOrder()); } if (length > 64) { throw new CTFReaderException("Cannot read an integer with over 64 bits. Length given: " + length); <START> } else if (length > 32) { <END> bits = input.get(length, signed); } else { bits = input.get(length, signed); if (!signed) { bits = bits & 0x00000000FFFFFFFFL; } } if (previousByteOrder != input.getByteOrder()) { input.setByteOrder(previousByteOrder); } value = bits; }</code><technical_language>If fix bug I in other patch-set. cases length > 32 "else" useless. previous "if" throw exception, remove "if"</technical_language>

Target:
public void read(BitBuffer input) throws CTFReaderException { alignRead(input, this.declaration); boolean signed = declaration.isSigned(); int length = declaration.getLength(); long bits = 0; ByteOrder previousByteOrder = input.getByteOrder(); if ((this.declaration.getByteOrder() != null) && (this.declaration.getByteOrder() != input.getByteOrder())) { input.setByteOrder(this.declaration.getByteOrder()); } if (length > 64) { throw new CTFReaderException("Cannot read an integer with over 64 bits. Length given: " + length); } bits = input.get(length, signed); if (previousByteOrder != input.getByteOrder()) { input.setByteOrder(previousByteOrder); } value = bits; }
Source:
<code>public void testRetainedSizeInBytes() { <START> final int expectedEntries = 1000; <END> BlockBuilder arrayBlockBuilder = new ArrayBlockBuilder(BIGINT, new BlockBuilderStatus(), expectedEntries); long initialRetainedSize = arrayBlockBuilder.getRetainedSizeInBytes(); for (int i = 0; i < expectedEntries; i++) { BlockBuilder arrayElementBuilder = arrayBlockBuilder.beginBlockEntry(); BIGINT.writeLong(arrayElementBuilder, i); arrayBlockBuilder.closeEntry(); } assertTrue(arrayBlockBuilder.getRetainedSizeInBytes() >= (expectedEntries * Long.BYTES + ClassLayout.parseClass(LongArrayBlockBuilder.class).instanceSize() + initialRetainedSize)); }</code><technical_language>generally write final for local variables</technical_language>

Target:
public void testRetainedSizeInBytes() { int expectedEntries = 1000; BlockBuilder arrayBlockBuilder = new ArrayBlockBuilder(BIGINT, new BlockBuilderStatus(), expectedEntries); long initialRetainedSize = arrayBlockBuilder.getRetainedSizeInBytes(); for (int i = 0; i < expectedEntries; i++) { BlockBuilder arrayElementBuilder = arrayBlockBuilder.beginBlockEntry(); BIGINT.writeLong(arrayElementBuilder, i); arrayBlockBuilder.closeEntry(); } assertTrue(arrayBlockBuilder.getRetainedSizeInBytes() >= (expectedEntries * Long.BYTES + ClassLayout.parseClass(LongArrayBlockBuilder.class).instanceSize() + initialRetainedSize)); }
Source:
<code>public StructureData copy() { <START> return new SpongeStructureData(); <END> }</code><technical_language>This copying is it...</technical_language>

Target:
public StructureData copy() { return new SpongeStructureData(this.author, this.ignoreEntities, this.integrity, this.mode, this.position, this.powered, this.showAir, this.showBoundingBox, this.seed, this.size); }
Source:
<code>public void rxFactory_nullThrows() { try { <START> configFactory.createConfigurationBuilder() <END> .rxFactory(null); fail("Setting a null factory from Java should fail."); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains("null")); } }</code><technical_language>do this prevent accidental bugs trigger wrong failure: private RealmConfiguration.Builder builder = configFactory.createConfigurationBuilder() try { builder.rxFactory(null) } catch (IllegalArgumentException e { //... }</technical_language>

Target:
public void rxFactory_nullThrows() { RealmConfiguration.Builder builder = configFactory.createConfigurationBuilder(); try { builder.rxFactory(null); fail("Setting a null factory from Java should fail."); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains("null")); } }
Source:
<code>public X509Certificate[] getAcceptedIssuers() { X509Certificate[] X509Certs = null; try { int numberOfEntry = allStore.size(); if (numberOfEntry > 0) { X509Certs = new X509Certificate[numberOfEntry]; Enumeration<String> aliases = allStore.aliases(); int i = 0; while (aliases.hasMoreElements()) { X509Certs[i] = (X509Certificate) allStore.getCertificate((String) aliases.nextElement()); i++; } } } catch (Exception e) { <START> Log.error(e.getMessage(), e); <END> X509Certs = null; } return X509Certs; }</code><technical_language>I Log.error( e.getMessage(), e), lead duplicate text in error. change e.getMessage() a short text describing code failed do</technical_language>

Target:
public X509Certificate[] getAcceptedIssuers() { X509Certificate[] X509Certs = null; try { int numberOfEntry = allStore.size(); if (numberOfEntry > 0) { X509Certs = new X509Certificate[numberOfEntry]; Enumeration<String> aliases = allStore.aliases(); int i = 0; while (aliases.hasMoreElements()) { X509Certs[i] = (X509Certificate) allStore.getCertificate((String) aliases.nextElement()); i++; } } } catch (KeyStoreException e) { Log.error("Cannot create accepted issuers list", e); X509Certs = null; } return X509Certs; }
Source:
<code>static int dropAllExpiredRecords(@NonNull final SQLiteDatabase db) { final Cursor cursor = db.query(NetworkAttributesContract.TABLENAME, null, null, null, null, null, null); if (cursor == null || cursor.getCount() <= 0) return Status.ERROR_STORAGE; cursor.moveToFirst(); final ArrayList<String> l2Keys = new ArrayList<>(); while (!cursor.isAfterLast()) { final long expiry = getLong(cursor, NetworkAttributesContract.COLNAME_EXPIRYDATE, 0); <START> final int relevance = expiry < 0 ? (int) expiry : RelevanceUtils.computeRelevanceForNow(expiry); if (relevance <= 0) { l2Keys.add(getString(cursor, NetworkAttributesContract.COLNAME_L2KEY)); } cursor.moveToNext(); <END> } cursor.close(); int result = Status.SUCCESS; for (String key : l2Keys) { if (delteData(db, key) != Status.SUCCESS) { result = Status.ERROR_GENERIC; } } return result; }</code><technical_language>1. if relevance < 0 means error case. log.wtf instead of add this key? 2. expiry instead of compute relevance</technical_language>

Target:
static int dropAllExpiredRecords(@NonNull final SQLiteDatabase db) { final Cursor cursor = db.query(NetworkAttributesContract.TABLENAME, L2KEY_AND_EXPIRYDATE_COLUMN, null, null, null, null, NetworkAttributesContract.COLNAME_EXPIRYDATE); if (cursor == null || cursor.getCount() <= 0) return Status.ERROR_STORAGE; cursor.moveToFirst(); final ArrayList<String> l2Keys = new ArrayList<>(); while (!cursor.isAfterLast()) { final long expiry = getLong(cursor, NetworkAttributesContract.COLNAME_EXPIRYDATE, 0); final int relevance = RelevanceUtils.computeRelevanceForNow(expiry); if (relevance <= 0) { final String key = getString(cursor, NetworkAttributesContract.COLNAME_L2KEY); if (relevance < 0) Log.wtf(TAG, "Relevance is lower than 0 for L2key=" + key); l2Keys.add(key); } else { break; } cursor.moveToNext(); } cursor.close(); return deleteData(db, l2Keys); }
Source:
<code>private static SortedSet<MediaType> parse(final String text) { final SortedSet<MediaType> list = new TreeSet<MediaType>(); <START> final String[] split = new EnglishLowerCase(text).string().split(","); <END> for (final String name : split) { if (!name.isEmpty()) { list.add(new MediaType(name)); } } return list; }</code><technical_language>@dalifreire get rid time variable</technical_language>

Target:
private static SortedSet<MediaType> parse(final String text) { final SortedSet<MediaType> list = new TreeSet<MediaType>(); for (final String name : new EnglishLowerCase(text).string().split(",")) { if (!name.isEmpty()) { list.add(new MediaType(name)); } } return list; }
Source:
<code>public Set<String> getAlternativeSequenceNames() { final String anTag = getAttribute(ALTERNATIVE_SEQUENCE_NAME_TAG); return (anTag == null) ? Collections.emptySet() <START> : Collections.unmodifiableSet(new HashSet<>(Arrays.asList(anTag.split(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR)))); <END> }</code><technical_language>This coerced a HashSet, shuffle order. a LinkedHashSet instead</technical_language>

Target:
public Set<String> getAlternativeSequenceNames() { final String anTag = getAttribute(ALTERNATIVE_SEQUENCE_NAME_TAG); return (anTag == null) ? Collections.emptySet() : Collections.unmodifiableSet(new LinkedHashSet<>(Arrays.asList(anTag.split(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR)))); }
Source:
<code>private void finishClose() { <START> shutdown.set(true); <END> synchronized (shutdown) { shutdown.notifyAll(); } }</code><technical_language>shutdown here. rename variables; close closingStarted, shutdown closingFinished, for example</technical_language>

Target:
private synchronized void finishClose() { stateMachine.setState(STATE_CLOSED); notifyAll(); }
Source:
<code>public boolean test() { <START> List<Shell> s2List = new ArrayList<Shell>(Arrays.asList(ShellLookup.getInstance().getShells())); <END> if (!s2List.contains(oldShell)) { return true; } s2List.removeAll(previousShells); if (s2List.size() == 1) { newShell = s2List.get(0); return true; } return false; }</code><technical_language>some more meaningful name instead of 's2List'</technical_language>

Target:
public boolean test() { List<Shell> currentShells = new ArrayList<Shell>(Arrays.asList(ShellLookup.getInstance().getShells())); if (!currentShells.contains(oldShell)) { return true; } currentShells.removeAll(previousShells); if (currentShells.size() == 1) { newShell = currentShells.get(0); return true; } return false; }
Source:
<code>public Map<Integer, Map<Version, Boolean>> getSoundDeviceSupportMap() { Map<Integer, Map<Version, Boolean>> soundDeviceSupportMap = new HashMap<Integer, Map<Version, Boolean>>(); Set<Version> versionsWithNull = new HashSet<Version>(Version.ALL); versionsWithNull.add(null); <START> Set<Integer> osIds = new HashSet<Integer>(getOsIds()); <END> for (Integer osId : osIds) { soundDeviceSupportMap.put(osId, new HashMap<Version, Boolean>()); for (Version ver : versionsWithNull) { soundDeviceSupportMap.get(osId).put(ver, isSoundDeviceEnabled(osId, ver)); } } return soundDeviceSupportMap; }</code><technical_language>need add map in order remove duplications, currently is duplicated key in list (since is derived a set) if list duplicated values a bug resolved (maybe type of getOsIds replaced a set..)</technical_language>

Target:
public Map<Integer, Map<Version, Boolean>> getSoundDeviceSupportMap() { Map<Integer, Map<Version, Boolean>> soundDeviceSupportMap = new HashMap<>(); Set<Version> versionsWithNull = new HashSet<>(Version.ALL); versionsWithNull.add(null); for (Integer osId : getOsIds()) { soundDeviceSupportMap.put(osId, new HashMap<Version, Boolean>()); for (Version ver : versionsWithNull) { soundDeviceSupportMap.get(osId).put(ver, isSoundDeviceEnabled(osId, ver)); } } return soundDeviceSupportMap; }
Source:
<code>public void renderFrame(int frameNumber, Bitmap bitmap) { Canvas canvas = new Canvas(bitmap); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC); int nextIndex; if (!isKeyFrame(frameNumber)) { nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas); } else { nextIndex = frameNumber; } for (int index = nextIndex; index < frameNumber; index++) { <START> AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(index); <END> DisposalMethod disposalMethod = frameInfo.disposalMethod; if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) { continue; } if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(index, canvas); mCallback.onIntermediateResult(index, bitmap); if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) { disposeToBackground(canvas, frameInfo); } } AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber); if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(frameNumber, canvas); }</code><technical_language>a small here. Instead of create a AnimatedDrawableFrameInfo reference looping, move of loop</technical_language>

Target:
public void renderFrame(int frameNumber, Bitmap bitmap) { Canvas canvas = new Canvas(bitmap); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC); int nextIndex; if (!isKeyFrame(frameNumber)) { nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas); } else { nextIndex = frameNumber; } AnimatedDrawableFrameInfo frameInfo; for (int index = nextIndex; index < frameNumber; index++) { frameInfo = mAnimatedDrawableBackend.getFrameInfo(index); DisposalMethod disposalMethod = frameInfo.disposalMethod; if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) { continue; } if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(index, canvas); mCallback.onIntermediateResult(index, bitmap); if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) { disposeToBackground(canvas, frameInfo); } } frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber); if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(frameNumber, canvas); }
Source:
<code>void apply(T t) throws Exception; } protected final void run(final Application app, final String url, final CheckedConsumer<WSRequest> test) { running(testServer(3333, app), () -> { try { test.apply(WS.url("http://localhost:3333" + url)); <START> } catch (Throwable t) { <END> throw new RuntimeException(t); } }); }</code><technical_language>do need catch Throwable? Some code checking utils consider this code smell. Exception suffice</technical_language>

Target:
void apply(T t) throws Exception; } protected static void run(final Application app, final String url, final CheckedConsumer<WSRequest> test) { final int port = 3333; running(testServer(port, app), () -> { try { test.apply(WS.url("http://localhost:" + port + url)); } catch (Exception e) { throw new RuntimeException(e); } }); }
Source:
<code>public boolean applyDetermination(ScriptContainer container, String determination) { <START> Element mana = new Element(determination); <END> if (!mana.isInt()) { dB.echoError("Determination for 'mana' must be a valid number."); return false; } new_mana = mana.asInt(); return super.applyDetermination(container, determination); }</code><technical_language>check if (determination.length() > 0 && !isDefaultDetermination(determination)) {</technical_language>

Target:
public boolean applyDetermination(ScriptContainer container, String determination) { if (determination.length() > 0 && !isDefaultDetermination(determination)) { Element mana = new Element(determination); if (!mana.isInt()) { dB.echoError("Determination for 'mana' must be a valid number."); return false; } new_mana = mana.asInt(); } return super.applyDetermination(container, determination); }
Source:
<code>public void setIsTable(String table) { if ("true".equalsIgnoreCase(table)) { this.m_isTable = true; } else { this.m_isTable = false; } <START> } <END></code><technical_language>This refactored m_isTable = "true".equalsIgnoreCase(table)</technical_language>

Target:
public void setIsTable(String table) { m_isTable = "true".equalsIgnoreCase(table); }
Source:
<code>private Repository createNestedRepo() throws IOException { File gitdir = createUniqueTestGitDir(false); FileRepositoryBuilder builder = new FileRepositoryBuilder(); builder.setGitDir(gitdir); Repository nestedRepo = builder.build(); nestedRepo.create(); <START> FileUtils.mkdir(new File(nestedRepo.getWorkTree(), "sub")); <END> File file = new File(nestedRepo.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File nestedRepoPath = new File(nestedRepo.getWorkTree(), "sub/nested"); FileRepositoryBuilder nestedBuilder = new FileRepositoryBuilder(); nestedBuilder.setWorkTree(nestedRepoPath); nestedBuilder.build().create(); File file2 = new File(nestedRepo.getWorkTree(), "sub/nested/b.txt"); FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); return nestedRepo; }</code><technical_language>writeTrashFile shorten this code</technical_language>

Target:
private Repository createNestedRepo() throws IOException { File gitdir = createUniqueTestGitDir(false); FileRepositoryBuilder builder = new FileRepositoryBuilder(); builder.setGitDir(gitdir); Repository nestedRepo = builder.build(); nestedRepo.create(); JGitTestUtil.writeTrashFile(nestedRepo, "sub", "a.txt", "content"); File nestedRepoPath = new File(nestedRepo.getWorkTree(), "sub/nested"); FileRepositoryBuilder nestedBuilder = new FileRepositoryBuilder(); nestedBuilder.setWorkTree(nestedRepoPath); nestedBuilder.build().create(); JGitTestUtil.writeTrashFile(nestedRepo, "sub/nested", "b.txt", "content b"); return nestedRepo; }
Source:
<code>public RespondingGatewayCrossGatewayBatchSubmissionResponseMessageSecuredRequestType batchSubmitTransaction(RespondingGatewayCrossGatewayBatchSubmissionSecuredRequestType body, WebServiceContext context) { RespondingGatewayCrossGatewayBatchSubmissionResponseMessageSecuredRequestType oResponse = null; try { AssertionType assertion = getAssertion(context, null); COREEnvelopeBatchSubmissionResponse oBatchSubmissionResponse = outboundCORE_X12DSGenericBatchRequest.batchSubmitTransaction(body.getCOREEnvelopeBatchSubmission(), assertion, body.getNhinTargetCommunities(), null); oResponse = new RespondingGatewayCrossGatewayBatchSubmissionResponseMessageSecuredRequestType(); oResponse.setCOREEnvelopeBatchSubmissionResponse(oBatchSubmissionResponse); oResponse.setNhinTargetCommunities(body.getNhinTargetCommunities()); } catch (Exception e) { <START> e.printStackTrace(); <END> LOG.error("Failed to send X12DS request to Nwhin. " + e); } return oResponse; }</code><technical_language>remove</technical_language>

Target:
public RespondingGatewayCrossGatewayBatchSubmissionResponseMessageSecuredRequestType batchSubmitTransaction(RespondingGatewayCrossGatewayBatchSubmissionSecuredRequestType body, WebServiceContext context) { RespondingGatewayCrossGatewayBatchSubmissionResponseMessageSecuredRequestType oResponse = null; try { AssertionType assertion = getAssertion(context, null); COREEnvelopeBatchSubmissionResponse oBatchSubmissionResponse = outboundCORE_X12DSGenericBatchRequest.batchSubmitTransaction(body.getCOREEnvelopeBatchSubmission(), assertion, body.getNhinTargetCommunities(), null); oResponse = new RespondingGatewayCrossGatewayBatchSubmissionResponseMessageSecuredRequestType(); oResponse.setCOREEnvelopeBatchSubmissionResponse(oBatchSubmissionResponse); oResponse.setNhinTargetCommunities(body.getNhinTargetCommunities()); } catch (Exception e) { LOG.error("Failed to send X12DS request to Nwhin. " + e); } return oResponse; }
Source:
<code>protected ShardConsumer buildConsumer(@NonNull final ShardInfo shardInfo, @NonNull final ShardRecordProcessorFactory shardRecordProcessorFactory) { RecordsPublisher cache = retrievalConfig.retrievalFactory().createGetRecordsCache(shardInfo, metricsFactory); ShardRecordProcessorCheckpointer checkpointer = coordinatorConfig.coordinatorFactory().createRecordProcessorCheckpointer(shardInfo, checkpoint); ShardConsumerArgument argument = new ShardConsumerArgument(shardInfo, streamName, leaseRefresher, executorService, cache, shardRecordProcessorFactory.shardRecordProcessor(), checkpoint, checkpointer, parentShardPollIntervalMillis, taskBackoffTimeMillis, skipShardSyncAtWorkerInitializationIfLeasesExist, listShardsBackoffTimeMillis, maxListShardsRetryAttempts, processorConfig.callProcessRecordsEvenForEmptyRecordList(), shardConsumerDispatchPollIntervalMillis, initialPosition, cleanupLeasesUponShardCompletion, ignoreUnexpetedChildShards, shardDetector, metricsFactory, aggregatorUtil); return new ShardConsumer(cache, executorService, shardInfo, lifecycleConfig.logWarningForTaskAfterMillis(), <START> argument, lifecycleConfig.taskExecutionListener()); <END> }</code><technical_language>Add listener ShardConsumerArgument. argument created for scenarios if new parameters need added be</technical_language>

Target:
protected ShardConsumer buildConsumer(@NonNull final ShardInfo shardInfo, @NonNull final ShardRecordProcessorFactory shardRecordProcessorFactory) { RecordsPublisher cache = retrievalConfig.retrievalFactory().createGetRecordsCache(shardInfo, metricsFactory); ShardRecordProcessorCheckpointer checkpointer = coordinatorConfig.coordinatorFactory().createRecordProcessorCheckpointer(shardInfo, checkpoint); ShardConsumerArgument argument = new ShardConsumerArgument(shardInfo, streamName, leaseRefresher, executorService, cache, shardRecordProcessorFactory.shardRecordProcessor(), checkpoint, checkpointer, parentShardPollIntervalMillis, taskBackoffTimeMillis, skipShardSyncAtWorkerInitializationIfLeasesExist, listShardsBackoffTimeMillis, maxListShardsRetryAttempts, processorConfig.callProcessRecordsEvenForEmptyRecordList(), shardConsumerDispatchPollIntervalMillis, initialPosition, cleanupLeasesUponShardCompletion, ignoreUnexpetedChildShards, shardDetector, aggregatorUtil, hierarchicalShardSyncer, metricsFactory); return new ShardConsumer(cache, executorService, shardInfo, lifecycleConfig.logWarningForTaskAfterMillis(), argument, lifecycleConfig.taskExecutionListener()); }
Source:
<code>public Resource getResource(String resourceUri) { Assert.isTrue(StringUtils.hasText(resourceUri), "Resource URI must not be empty"); try { URI uri = new URI(resourceUri); String scheme = uri.getScheme(); Assert.notNull(scheme, "a scheme (prefix) is required"); if (scheme.equals("maven")) { String coordinates = resourceUri.replaceFirst("maven:\\/*", ""); MavenResource mavenResource = MavenResource.parse(coordinates, mavenProperties); return mavenResource; } else if (scheme.equals("docker")) { String dockerUri = resourceUri.replaceFirst("docker:\\/*", ""); return new DockerResource(dockerUri); } else { ResourceLoader resourceLoader = null; if (!scheme.equalsIgnoreCase("http") && !scheme.equalsIgnoreCase("https")) { resourceLoader = new DefaultResourceLoader(); } else { resourceLoader = new DownloadingUrlResourceLoader(); } <START> return resourceLoader.getResource(resourceUri); <END> } } catch (URISyntaxException e) { throw new RuntimeException(e); } }</code><technical_language>a biggie rename resourceLoader locally symbol resourceLoader is a class field. easy mix eyeballing this section</technical_language>

Target:
public Resource getResource(String resourceUri) { Assert.isTrue(StringUtils.hasText(resourceUri), "Resource URI must not be empty"); try { String scheme = new URI(resourceUri).getScheme().toLowerCase(); Assert.notNull(scheme, "a scheme (prefix) is required"); switch (scheme) { case "maven": String coordinates = resourceUri.replaceFirst("maven:\\/*", ""); return MavenResource.parse(coordinates, mavenProperties); case "docker": String dockerUri = resourceUri.replaceFirst("docker:\\/*", ""); return new DockerResource(dockerUri); case "http": case "https": return new DownloadingUrlResourceLoader().getResource(resourceUri); default: return new DefaultResourceLoader().getResource(resourceUri); } } catch (URISyntaxException e) { throw new RuntimeException(e); } }
Source:
<code>public void run() { try { synchronized (lock) { final LeaderLatch latch = leaderLatch.get(); if (latch == null || !latch.hasLeadership()) { log.info("LEGGO MY EGGO. [%s] is master.", latch == null ? null : latch.getLeader().getId()); stopBeingMaster(); return; } } List<Boolean> allStarted = Arrays.asList( databaseSegmentManager.isStarted(), serverInventoryView.isStarted() ); for (Boolean aBoolean : allStarted) { if (!aBoolean) { log.error("InventoryManagers not started[%s]", allStarted); stopBeingMaster(); return; } } DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withStartTime(startTime) .withDatasources(databaseSegmentManager.getInventory()) .withMillisToWaitBeforeDeleting(config.getMillisToWaitBeforeDeleting()) .withEmitter(emitter) .withMergeBytesLimit(config.getMergeBytesLimit()) .withMergeSegmentsLimit(config.getMergeSegmentsLimit()) .withMaxSegmentsToMove(config.getMaxSegmentsToMove()) <START> .withEmitBalancingCostParams(config.getEmitStats()) <END> .build(); for (DruidMasterHelper helper : helpers) { params = helper.run(params); } } catch (Exception e) { log.makeAlert(e, "Caught exception, ignoring so that schedule keeps going.").emit(); } }</code><technical_language>This feels weird me</technical_language>

Target:
public void run() { try { synchronized (lock) { final LeaderLatch latch = leaderLatch.get(); if (latch == null || !latch.hasLeadership()) { log.info("LEGGO MY EGGO. [%s] is master.", latch == null ? null : latch.getLeader().getId()); stopBeingMaster(); return; } } List<Boolean> allStarted = Arrays.asList( databaseSegmentManager.isStarted(), serverInventoryView.isStarted() ); for (Boolean aBoolean : allStarted) { if (!aBoolean) { log.error("InventoryManagers not started[%s]", allStarted); stopBeingMaster(); return; } } DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withStartTime(startTime) .withDatasources(databaseSegmentManager.getInventory()) .withMasterSegmentSettings(segmentSettingsAtomicReference.get()) .withEmitter(emitter) .build(); for (DruidMasterHelper helper : helpers) { params = helper.run(params); } } catch (Exception e) { log.makeAlert(e, "Caught exception, ignoring so that schedule keeps going.").emit(); } }
Source:
<code>public String getAccountSid() throws UnknownHostException{ RCLogger.v(TAG, "getAccountSid method started"); String accountSid = null; HttpURLConnection connection = null; try { String encodedEmail = URLEncoder.encode(accountEmail, "UTF-8"); String url = "https://" + restcommDomain + ACCOUNT_SID_URL + "/" + encodedEmail; RCLogger.v(TAG, "calling url: " + url); connection = createUrlRequestWithUrl(url); connection.setRequestMethod("GET"); int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { String jsonString = getJsonFromStream(connection.getInputStream()); if (jsonString.length() > 0) { JSONObject inputJson = new JSONObject(jsonString); accountSid = inputJson.getString("sid"); } } } catch (Exception ex){ RCLogger.e(TAG, ex.toString()); <START> if (ex instanceof UnknownHostException){ <END> throw (UnknownHostException)ex; } } finally { if (connection != null) { connection.disconnect(); } } RCLogger.v(TAG, "getAccountSid method ended; returning account sid: " + accountSid); return accountSid; }</code><technical_language>other additional exceptions interested in catching returning error code for UnknownHostException? stuff wrong for want ready for? For example if request times out</technical_language>

Target:
public String getAccountSid() throws RCException{ RCLogger.v(TAG, "getAccountSid method started"); String accountSid = null; HttpURLConnection connection = null; try { String encodedEmail = URLEncoder.encode(accountEmail, "UTF-8"); String url = "https://" + restcommDomain + ACCOUNT_SID_URL + "/" + encodedEmail; RCLogger.v(TAG, "calling url: " + url); connection = createUrlRequestWithUrl(url); connection.setRequestMethod("GET"); checkStatusCode(connection); String jsonString = getJsonFromStream(connection.getInputStream()); if (jsonString.length() > 0) { JSONObject inputJson = new JSONObject(jsonString); accountSid = inputJson.getString("sid"); } } catch (Exception ex){ handleException(ex, false); } finally { if (connection != null) { connection.disconnect(); } } RCLogger.v(TAG, "getAccountSid method ended; returning account sid: " + accountSid); return accountSid; }
Source:
<code>private static void logMasterConfiguration(JobManagerProcessSpec spec) { JobManagerFlinkMemory flinkMemory = spec.getFlinkMemory(); LOG.info("Final Master Memory configuration:"); LOG.info(" Total Process Memory: {}", spec.getTotalProcessMemorySize().toHumanReadableString()); LOG.info(" Total Flink Memory: {}", flinkMemory.getTotalFlinkMemorySize().toHumanReadableString()); <START> LOG.info(" Heap: {}", flinkMemory.getJvmHeapMemorySize().toHumanReadableString()); <END> LOG.info(" Off-heap: {}", flinkMemory.getJvmDirectMemorySize().toHumanReadableString()); LOG.info(" JVM Metaspace: {}", spec.getJvmMetaspaceSize().toHumanReadableString()); LOG.info(" JVM Overhead: {}", spec.getJvmOverheadSize().toHumanReadableString()); }</code><technical_language>suggestion LOG.info(" JVM Heap: {}", flinkMemory.getJvmHeapMemorySize().toHumanReadableString());</technical_language>

Target:
private static void logMasterConfiguration(JobManagerProcessSpec spec) { JobManagerFlinkMemory flinkMemory = spec.getFlinkMemory(); LOG.info("Final Master Memory configuration:"); LOG.info(" Total Process Memory: {}", spec.getTotalProcessMemorySize().toHumanReadableString()); LOG.info(" Total Flink Memory: {}", flinkMemory.getTotalFlinkMemorySize().toHumanReadableString()); LOG.info(" JVM Heap: {}", flinkMemory.getJvmHeapMemorySize().toHumanReadableString()); LOG.info(" Off-heap: {}", flinkMemory.getJvmDirectMemorySize().toHumanReadableString()); LOG.info(" JVM Metaspace: {}", spec.getJvmMetaspaceSize().toHumanReadableString()); LOG.info(" JVM Overhead: {}", spec.getJvmOverheadSize().toHumanReadableString()); }
Source:
<code>public void suggestArticleTypeIntoWhatVideoField(String text) { suggestArticleWhatInput.sendKeys(text); <START> PageObjectLogging.log("SuggestArticleTypeIntoWhatVideoField", "Type '"+text+"' into 'What Video' field on 'Suggest Article Modal'", true, driver); <END> }</code><technical_language>1. line shorter, 2. methods name changed, change parameter Suggest suggest</technical_language>

Target:
public void suggestArticleTypeIntoWhatVideoField(String text) { suggestArticleWhatInput.sendKeys(text); PageObjectLogging.log( "suggestArticleTypeIntoWhatVideoField", "Type '"+text+"' into 'What Video' field on 'Suggest Article Modal'", true ); }
Source:
<code>private void resolveSecretParams(Material material) { if ((material instanceof SecretParamAware) && ((SecretParamAware) material).hasSecretParams()) { if (material instanceof ScmMaterial) { <START> this.secretParamResolver.resolve((ScmMaterial) material); <END> } else if (material instanceof PluggableSCMMaterial) { this.secretParamResolver.resolve((PluggableSCMMaterial) material); } } }</code><technical_language>a resolve method SecretParamResolver takes type of material multiple methods for material type</technical_language>

Target:
private void resolveSecretParams(Material material) { if ((material instanceof SecretParamAware)) { this.secretParamResolver.resolve(material); } }
Source:
<code>public DecimalDataRandomGenerator(int precision, int scale, double min, double max) { <START> double largest = largestValue(precision, scale); <END> this.precision = precision; this.scale = scale; this.min = Math.min(-1 * largest, min); this.max = Math.min(largest, max); this.fmt = "%" + precision + "." + scale + "f"; }</code><technical_language>suggestion double largest = Math.pow(10,precision-scale) - Math.pow(10,-scale);</technical_language>

Target:
public DecimalDataRandomGenerator(int precision, int scale, double min, double max) { Preconditions.checkState(min < max, String.format("min bound must be less than max [%f, %f]", min, max)); double largest = Math.pow(10, precision - scale) - Math.pow(10, -scale); this.precision = precision; this.scale = scale; this.min = Math.max(-1 * largest, min); this.max = Math.min(largest, max); }
Source:
<code>public Observable<List<Product>> getProducts(final int page, final Set<String> tags) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } <START> final String tagsQueryStr = tags != null && !tags.isEmpty() ? TextUtils.join(",", tags.toArray()) : null; <END> return retrofitService .getProducts(appId, null, tagsQueryStr, null, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }</code><technical_language>I prefer this logic broken a couple of lines, is a bit hard parse. well, avoid need create empty set pass in for other getProducts(page) call</technical_language>

Target:
public Observable<List<Product>> getProducts(final int page, final Set<String> tags) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } final String tagsQueryStr = formatQueryString(tags); return retrofitService .getProducts(appId, null, tagsQueryStr, null, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }
Source:
<code>public void activate() { Image mapImage = new Image("images/map_field.png"); animationTimer = new AnimationTimer() { int frames = 0; public void handle(long currentNanoTime) { gc.drawImage(mapImage, 0, 0, mapWidth, mapHeight); for (GameObject go : gameObjects.values()) { if (go != clientChar) { go.update(gc); } } if (!clientChar.isDestroyed()) { clientChar.updateWithCollision(gc, gameObjects); } if (timer.getDuration() > 250) { fpsLabel.setText("fps: " + frames * 4); scoreLabel.setText("Score: " + (int)clientChar.getScore()); if(!clientChar.isDestroyed()) { <START> healthLabel.setText("Health: " + (int)clientChar.getHealth().getValue()); <END> } else { healthLabel.setText("Health: DEAD"); } timer.reset(); frames = 0; } else { frames++; } } }; animationTimer.start(); updateThread = new Thread(() -> { while (mapActive) { sendUpdate(); } }); updateThread.start(); }</code><technical_language>isnt this int value</technical_language>

Target:
public void activate() { Image mapImage = new Image("images/map_field.png"); animationTimer = new AnimationTimer() { int frames = 0; public void handle(long currentNanoTime) { gc.drawImage(mapImage, 0, 0, mapWidth, mapHeight); for (GameObject go : gameObjects.values()) { if (go != clientChar) { go.update(gc); } } if (!clientChar.isDestroyed()) { clientChar.updateWithCollision(gc, gameObjects); } if (timer.getDuration() > 250) { fpsLabel.setText("fps: " + frames * 4); scoreLabel.setText("Score: " + (int)clientChar.getScore()); if (!clientChar.isDestroyed()) { healthLabel.setText("Health: " +clientChar.getHealth().getValue()); } else { healthLabel.setText("Health: DEAD"); } timer.reset(); frames = 0; } else { frames++; } } }; animationTimer.start(); updateThread = new Thread(() -> { while (mapActive) { sendUpdate(); } }); updateThread.start(); }
Source:
<code>private static void main(InetSocketAddress address, int packets, int packetsPerSecond) throws IOException { try (final Client client = Client.connect(address)) { ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); System.out.println("Warming up..."); for (long sendAt = System.nanoTime(); client.receiveCount() < packets; client.receive()) { if (System.nanoTime() >= sendAt) { <START> buffer.asLongBuffer().put(sendAt); <END> client.send(buffer); buffer.flip(); sendAt += 1_000_000_000 / packetsPerSecond; } } client.resetMeasurements(); System.out.println("Benchmarking..."); for (long sendAt = System.nanoTime(); client.receiveCount() < packets; client.receive()) { if (System.nanoTime() >= sendAt) { buffer.asLongBuffer().put(sendAt); client.send(buffer); buffer.flip(); sendAt += 1_000_000_000 / packetsPerSecond; } } System.out.printf("Results (n = %d)\n", packets); System.out.printf("\n"); System.out.printf( " Min: %10.2f µs\n", client.getHistogram().getMinValue() / 1000.0); System.out.printf(" 50.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(50.00) / 1000.0); System.out.printf(" 90.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(90.00) / 1000.0); System.out.printf(" 99.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(99.00) / 1000.0); System.out.printf(" 99.90%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(99.90) / 1000.0); System.out.printf(" 99.99%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(99.99) / 1000.0); System.out.printf(" 100.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(100.00) / 1000.0); System.out.printf("\n"); } }</code><technical_language>Please ByteBuffer#putLong() asLongBuffer() here</technical_language>

Target:
private static void main(InetSocketAddress address, int packets, int packetsPerSecond) throws IOException { try (final TestClient client = TestClient.connect(address)) { long intervalNanos = 1_000_000_000 / packetsPerSecond; ByteBuffer buffer = ByteBuffer.allocateDirect(Long.BYTES); System.out.println("Warming up..."); client.sendAndReceive(buffer, packets, intervalNanos); client.reset(); System.out.println("Benchmarking..."); client.sendAndReceive(buffer, packets, intervalNanos); System.out.printf("Results (n = %d)\n", packets); System.out.printf("\n"); System.out.printf( " Min: %10.2f µs\n", client.histogram.getMinValue() / 1000.0); System.out.printf(" 50.00%%: %10.2f µs\n", client.histogram.getValueAtPercentile(50.00) / 1000.0); System.out.printf(" 90.00%%: %10.2f µs\n", client.histogram.getValueAtPercentile(90.00) / 1000.0); System.out.printf(" 99.00%%: %10.2f µs\n", client.histogram.getValueAtPercentile(99.00) / 1000.0); System.out.printf(" 99.90%%: %10.2f µs\n", client.histogram.getValueAtPercentile(99.90) / 1000.0); System.out.printf(" 99.99%%: %10.2f µs\n", client.histogram.getValueAtPercentile(99.99) / 1000.0); System.out.printf(" 100.00%%: %10.2f µs\n", client.histogram.getValueAtPercentile(100.00) / 1000.0); System.out.printf("\n"); } }
Source:
<code>public void addString(String string, float x, float y, Font font) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); x = DPIUtil.autoScaleUp(x); y = DPIUtil.autoScaleUp(y); FontData fd = font.getFontData()[0]; Font scaledFont = <START> new Font(font.getDevice(), <END> fd.getName(), DPIUtil.autoScaleUp(fd.getHeight()), fd.getStyle()); addStringInPixels(string, x, y, scaledFont); }</code><technical_language>this font disposed in finally block addStringInPixels() call</technical_language>

Target:
public void addString(String string, float x, float y, Font font) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); x = DPIUtil.autoScaleUp(x); y = DPIUtil.autoScaleUp(y); FontData fd = font.getFontData()[0]; Font scaledFont = new Font(font.getDevice(), fd.getName(), DPIUtil.autoScaleUp(fd.getHeight()), fd.getStyle()); addStringInPixels(string, x, y, scaledFont); scaledFont.dispose(); }
Source:
<code>public Optional<UsernamePasswordCredentials> extract(WebContext context) { <START> final Optional<TokenCredentials> credentials = this.extractor.extract(context); <END> return credentials.map(c -> { final byte[] decoded = Base64.getDecoder().decode(c.getToken()); String token; try { token = new String(decoded, "UTF-8"); } catch (final UnsupportedEncodingException e) { throw new CredentialsException("Bad format of the basic auth header"); } final int delim = token.indexOf(":"); if (delim < 0) { throw new CredentialsException("Bad format of the basic auth header"); } return new UsernamePasswordCredentials( token.substring(0, delim), token.substring(delim + 1) ); }); }</code><technical_language>do intermediary variable, for this.extractor.extract(context).map ..</technical_language>

Target:
public Optional<UsernamePasswordCredentials> extract(WebContext context) { return this.extractor.extract(context).map(c -> { final byte[] decoded = Base64.getDecoder().decode(c.getToken()); String token; try { token = new String(decoded, "UTF-8"); } catch (final UnsupportedEncodingException e) { throw new CredentialsException("Bad format of the basic auth header"); } final int delim = token.indexOf(":"); if (delim < 0) { throw new CredentialsException("Bad format of the basic auth header"); } return new UsernamePasswordCredentials( token.substring(0, delim), token.substring(delim + 1) ); }); }
Source:
<code>public void handleMessage(Message msg) { thiz.client = msg.replyTo; if (thiz.client == null) { throw new RuntimeException("Message with an empty client."); } Step step = stepMap.get(msg.what); Throwable throwable = null; if (step != null) { try { step.run(); } catch (Throwable t) { throwable = t; } finally { if (throwable != null) { StringWriter sw = new StringWriter(); <START> throwable.printStackTrace(new PrintWriter(sw)); <END> String exceptionAsString = sw.toString(); step.response(throwable.getMessage() + "\n" + exceptionAsString); } else { step.response(null); } } } else { throw new RuntimeException("Cannot find corresponding step to message " + msg.what + "."); } }</code><technical_language>Util.getStackTrace(throwable)) implement this logic</technical_language>

Target:
public void handleMessage(Message msg) { thiz.client = msg.replyTo; if (thiz.client == null) { throw new RuntimeException("Message with an empty client."); } Step step = stepMap.get(msg.what); Throwable throwable = null; if (step != null) { try { step.run(); } catch (Throwable t) { throwable = t; } finally { if (throwable != null) { step.response(throwable.getMessage() + "\n" + Util.getStackTrace(throwable)); } else { step.response(null); } } } else { throw new RuntimeException("Cannot find corresponding step to message " + msg.what + "."); } }
Source:
<code><START> public static BondMode getBondMode(String bondOptions){ <END> if(bondOptions == null){ return null; } String bondModeValue = findMode(bondOptions); if (bondModeValue == null){ return null; } for (BondMode bondMode : BondMode.values()){ if (bondMode.getValue().equals(bondModeValue)){ return bondMode; } } return null; }</code><technical_language>is public. Why</technical_language>

Target:
static BondMode getBondMode(String bondOptions){ if(bondOptions == null){ return null; } String bondModeValue = findMode(bondOptions); if (bondModeValue == null){ return null; } for (BondMode bondMode : BondMode.values()){ if (bondMode.getValue().equals(bondModeValue)){ return bondMode; } } return null; }
Source:
<code>public static PlayerChatEvent createPlayerChat(Game game, Player player, CommandSource source, Text message) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("user", player); values.put("entity", player); <START> values.put("user", player); <END> values.put("source", source); values.put("message", message); return createEvent(PlayerChatEvent.class, values); }</code><technical_language>uh, is this intended? user added lines :)</technical_language>

Target:
public static PlayerChatEvent createPlayerChat(Game game, Player player, CommandSource source, Text message) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("entity", player); values.put("source", source); values.put("message", message); values.put("user", player); return createEvent(PlayerChatEvent.class, values); }
Source:
<code><START> protected ConvertingVisitor() { <END> super(false); }</code><technical_language>of protected</technical_language>

Target:
ConvertingVisitor() { super(false); }
Source:
<code>public void testNoHorizontalRuleTextBefore() { String text = "x '''"; String html = parseToHtml(text); assertFalse("HTML contains <hr/>", <START> html.contains("<hr/>")); <END> }</code><technical_language>consider assertEquals instead, easier maintain here,</technical_language>

Target:
public void testNoHorizontalRuleTextBefore() { String text = "x '''"; String html = parseToHtml(text); assertEquals("<p>x '''</p>\n", html); }
Source:
<code>synchronized public Instance getInstance() { if (cachedInstance != null) return cachedInstance; if (mock) return cachedInstance = DeprecationUtil.makeMockInstance(instance); if (instance == null) { return cachedInstance = HdfsZooInstance.getInstance(); } try { return cachedInstance = getConnector().getInstance(); } catch (Exception e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>This is a bad pattern follow, for a reasons: 1. multi-catch blocks now, reason do blanket catch this, 2. This unnecessarily wrap RuntimeExceptions another RuntimeException, 3. call new RuntimeException(...); instead, pick a specific runtime exception circumstance</technical_language>

Target:
synchronized public Instance getInstance() { if (cachedInstance != null) return cachedInstance; if (instance == null) { return cachedInstance = HdfsZooInstance.getInstance(); } try { return cachedInstance = getConnector().getInstance(); } catch (AccumuloSecurityException | AccumuloException e) { throw new IllegalStateException(e); } }
Source:
<code>public @NonNull String getHelpText() { return <START> "Performance counter for " + <END> getName(); }</code><technical_language>please remove "Performance"</technical_language>

Target:
public @NonNull String getHelpText() { return "Counter for " + getName(); }