auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>Mono<PiiEntityCollection> recognizePiiEntities(String document, String language) { try { Objects.requireNonNull(document, "'document' cannot be null."); <START> final TextDocumentInput textDocumentInput = new TextDocumentInput("0", document).setLanguage(language); <END> return recognizePiiEntitiesBatch(Collections.singletonList(textDocumentInput), null) .map(resultCollectionResponse -> { PiiEntityCollection entityCollection = null; for (RecognizePiiEntitiesResult entitiesResult : resultCollectionResponse.getValue()) { if (entitiesResult.isError()) { throw logger.logExceptionAsError(toTextAnalyticsException(entitiesResult.getError())); } entityCollection = new PiiEntityCollection(entitiesResult.getEntities(), entitiesResult.getEntities().getWarnings()); } return entityCollection; }); } catch (RuntimeException ex) { return monoError(logger, ex); } }</code><technical_language>nit: need for extra variable creation here</technical_language>

Target:
Mono<PiiEntityCollection> recognizePiiEntities(String document, String language) { try { Objects.requireNonNull(document, "'document' cannot be null."); return recognizePiiEntitiesBatch( Collections.singletonList(new TextDocumentInput("0", document).setLanguage(language)), null) .map(resultCollectionResponse -> { PiiEntityCollection entityCollection = null; for (RecognizePiiEntitiesResult entitiesResult : resultCollectionResponse.getValue()) { if (entitiesResult.isError()) { throw logger.logExceptionAsError(toTextAnalyticsException(entitiesResult.getError())); } entityCollection = new PiiEntityCollection(entitiesResult.getEntities(), entitiesResult.getEntities().getWarnings()); } return entityCollection; }); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public synchronized long startForwarding(LearnerHandler learnerHandler, long lastSeenZxid) { Iterator<QuorumPacket> itr = committedPkts.iterator(); if (itr.hasNext()) { QuorumPacket packet = itr.next(); if (packet.getZxid() > lastSeenZxid + 1) { LOG.error( <START> "LearnerHandler is too far behind ({} < {}), disconnecting at {}", <END> Long.toHexString(lastSeenZxid + 1), Long.toHexString(packet.getZxid()), learnerHandler.getSid(), learnerHandler.getRemoteAddress()); learnerHandler.shutdown(); return -1; } else if (packet.getZxid() == lastSeenZxid + 1) { learnerHandler.queuePacket(packet); } long queueHeadZxid = packet.getZxid(); long queueBytesUsed = LearnerHandler.packetSize(packet); while (itr.hasNext()) { packet = itr.next(); if (packet.getZxid() <= lastSeenZxid) { continue; } learnerHandler.queuePacket(packet); queueBytesUsed += LearnerHandler.packetSize(packet); } LOG.info( "finished syncing observer from retained commit queue: sid {}, " + "queue head 0x{}, queue tail 0x{}, sync position 0x{}, num packets used {}, " + "num bytes used {}", learnerHandler.getSid(), Long.toHexString(queueHeadZxid), Long.toHexString(packet.getZxid()), Long.toHexString(lastSeenZxid), packet.getZxid() - lastSeenZxid, queueBytesUsed); } activeObservers.add(learnerHandler); return lastProposedZxid; }</code><technical_language>Add "0x"'s for hex</technical_language>

Target:
public synchronized long startForwarding(LearnerHandler learnerHandler, long lastSeenZxid) { Iterator<QuorumPacket> itr = committedPkts.iterator(); if (itr.hasNext()) { QuorumPacket packet = itr.next(); if (packet.getZxid() > lastSeenZxid + 1) { LOG.error( "LearnerHandler is too far behind (0x{} < 0x{}), disconnecting at {}", Long.toHexString(lastSeenZxid + 1), Long.toHexString(packet.getZxid()), learnerHandler.getSid(), learnerHandler.getRemoteAddress()); learnerHandler.shutdown(); return -1; } else if (packet.getZxid() == lastSeenZxid + 1) { learnerHandler.queuePacket(packet); } long queueHeadZxid = packet.getZxid(); long queueBytesUsed = LearnerHandler.packetSize(packet); while (itr.hasNext()) { packet = itr.next(); if (packet.getZxid() <= lastSeenZxid) { continue; } learnerHandler.queuePacket(packet); queueBytesUsed += LearnerHandler.packetSize(packet); } LOG.info( "finished syncing observer from retained commit queue: sid {}, " + "queue head 0x{}, queue tail 0x{}, sync position 0x{}, num packets used {}, " + "num bytes used {}", learnerHandler.getSid(), Long.toHexString(queueHeadZxid), Long.toHexString(packet.getZxid()), Long.toHexString(lastSeenZxid), packet.getZxid() - lastSeenZxid, queueBytesUsed); } activeObservers.add(learnerHandler); return lastProposedZxid; }
Source:
<code>public void validatesInMultipleThreadsAgain() throws Exception { final int zero = 0; final int ten = 10; final int hundred = 100; final int fifty = 50; final Random rand = new SecureRandom(); final XSD xsd = new XSDDocument( StringUtils.join( "<xs:schema xmlns:xs ='<LINK_0>' >", "<xs:element name='r'><xs:complexType><xs:sequence>", "<xs:element name='x' type='xs:integer'", " minOccurs='0' maxOccurs='unbounded'/>", "</xs:sequence></xs:complexType></xs:element></xs:schema>" ) ); final Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { final int cnt = rand.nextInt(hundred); MatcherAssert.assertThat( xsd.validate( new DOMSource( new XMLDocument( StringUtils.join( "<r>", StringUtils.repeat("<x>hey</x>", cnt), "</r>" ) ).node() ) ), Matchers.hasSize(cnt << 1) ); return null; } }; final ExecutorService executorService = Executors.newFixedThreadPool(5); for (int count = zero; count < fifty; count = count + 1) { executorService.submit(callable); } <START> executorService.awaitTermination(ten, TimeUnit.SECONDS); <END> executorService.shutdown(); }</code><technical_language>@tmjee awaitTermination call shutdown assert awaitTermination returned true shutdownNow</technical_language>

Target:
public void validatesInMultipleThreadsAgain() throws Exception { final int timeout = 10; final int random = 100; final int loop = 50; final Random rand = new SecureRandom(); final XSD xsd = new XSDDocument( StringUtils.join( "<xs:schema xmlns:xs ='<LINK_0>' >", "<xs:element name='r'><xs:complexType><xs:sequence>", "<xs:element name='x' type='xs:integer'", " minOccurs='0' maxOccurs='unbounded'/>", "</xs:sequence></xs:complexType></xs:element></xs:schema>" ) ); final Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { final int cnt = rand.nextInt(random); MatcherAssert.assertThat( xsd.validate( new DOMSource( new XMLDocument( StringUtils.join( "<r>", StringUtils.repeat("<x>hey</x>", cnt), "</r>" ) ).node() ) ), Matchers.hasSize(cnt << 1) ); return null; } }; final ExecutorService executorService = Executors.newFixedThreadPool(5); for (int count = 0; count < loop; count = count + 1) { executorService.submit(callable); } executorService.shutdown(); MatcherAssert.assertThat( executorService.awaitTermination(timeout, TimeUnit.SECONDS), Matchers.is(true) ); executorService.shutdownNow(); }
Source:
<code>boolean sameField(ArgumentFilter another) { if (field == null) { return another.field == null; <START> } <END> boolean result = field.equals(another.field); return result; }</code><technical_language>Please Objects.equal instead</technical_language>

Target:
boolean sameField(ArgumentFilter another) { return Objects.equals(field, another.field); }
Source:
<code>void counterGet(Consumer<Response> sendResponse) { String name = operationContext(); CounterConfiguration config = counterManager.getConfiguration(name); if (config == null) { sendResponse.accept(missingCounterResponse()); return; } switch (config.type()) { case UNBOUNDED_STRONG: case BOUNDED_STRONG: counterManager.getStrongCounter(name).getValue().whenComplete((value, throwable) -> { if (throwable != null) { <START> checkCounterThrowable(sendResponse, throwable); <END> } else { sendResponse.accept(new CounterValueResponse(header, value)); } }); break; case WEAK: long value = counterManager.getWeakCounter(name).getValue(); sendResponse.accept(new CounterValueResponse(header, value)); break; } }</code><technical_language>counter* methods deserve a refactoring..</technical_language>

Target:
void counterGet(Consumer<Response> sendResponse) { applyCounter(operationContext(), sendResponse, (counter, responseConsumer) -> counter.getValue().whenComplete(longResultHandler(responseConsumer)), (counter, responseConsumer) -> longResultHandler(responseConsumer).accept(counter.getValue(), null) ); }
Source:
<code>private static boolean visitDelta(IResourceDelta delta) { IResource resource = delta.getResource(); <START> if ((resource.getType() & IResource.PROJECT) != 0 && (delta.getFlags() & IResourceDelta.OPEN) != 0) { <END> ISonarLintProject project = Adapters.adapt(delta.getResource(), ISonarLintProject.class); if (project != null && project.isBound()) { SonarLintProjectConfiguration config = SonarLintProjectConfiguration.read(project.getScopeContext()); String moduleKey = config.getModuleKey(); Server server = (Server) SonarLintCorePlugin.getServersManager().getServer(config.getServerId()); System.out.printf("Register %s for server %s? -> %s\n", moduleKey, server.getId(), project.isOpen()); if (project.isOpen()) { } else { } } return false; } return true; }</code><technical_language>filter PROJECT, for example IBM IDz, SonarLint projects mapped differents ressources (IDzSubProjects) I return for resource.getType() (maybe FOLDER). This is optimal filter resource type here</technical_language>

Target:
private static boolean visitDelta(IResourceDelta delta) { if ((delta.getFlags() & IResourceDelta.OPEN) != 0) { ISonarLintProject project = Adapters.adapt(delta.getResource(), ISonarLintProject.class); if (project != null && project.isBound()) { if (project.isOpen()) { SonarLintUiPlugin.subscribeToNotifications(project); } else { SonarLintCorePlugin.getInstance().notificationsManager().unsubscribe(project); } } return false; } return true; }
Source:
<code>public PlanWithProperties visitExchange(ExchangeNode node, StreamPreferredProperties parentPreferences) { checkArgument(node.getScope() != LOCAL, "AddLocalExchanges can not process a plan containing a local exchange"); if (node.isOrderSensitive()) { return planAndEnforceChildren( node, <START> parentPreferences.withoutPreference().withDefaultParallelism(session), <END> parentPreferences.withDefaultParallelism(session)); } return planAndEnforceChildren(node, any(), defaultParallelism(session)); }</code><technical_language>In LocalExecutionPlanner isOrderSensitive is set, driver instance count is set 1. is this passing preferences different</technical_language>

Target:
public PlanWithProperties visitExchange(ExchangeNode node, StreamPreferredProperties parentPreferences) { checkArgument(node.getScope() != LOCAL, "AddLocalExchanges can not process a plan containing a local exchange"); if (node.isOrderSensitive()) { return planAndEnforceChildren( node, singleStream().withOrderSensitivity(), singleStream().withOrderSensitivity()); } return planAndEnforceChildren(node, any(), defaultParallelism(session)); }
Source:
<code>public Translation itemstack$getTranslation() { <START> String id; <END> if (shadow$getItem() instanceof ItemBed) { id = shadow$getItem().getUnlocalizedName((net.minecraft.item.ItemStack) (IMixinItemStack) this) + ".name"; } else if (shadow$getItem() instanceof ItemBanner) { EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(this.getMetadata() & 15); id = "item.banner." + enumdyecolor.getUnlocalizedName() + ".name"; } else if (shadow$getItem() instanceof ItemTippedArrow) { id = PotionUtils.getPotionFromItem((net.minecraft.item.ItemStack) (IMixinItemStack) this).getNamePrefixed("tipped_arrow.effect."); } else if (shadow$getItem() instanceof ItemSplashPotion) { id = PotionUtils.getPotionFromItem((net.minecraft.item.ItemStack) (IMixinItemStack) this).getNamePrefixed("splash_potion.effect."); } else if (shadow$getItem() instanceof ItemLingeringPotion) { id = PotionUtils.getPotionFromItem((net.minecraft.item.ItemStack) (IMixinItemStack) this).getNamePrefixed("lingering_potion.effect."); } else if (shadow$getItem() instanceof ItemPotion) { id = PotionUtils.getPotionFromItem((net.minecraft.item.ItemStack) (IMixinItemStack) this).getNamePrefixed("potion.effect."); } else { id = shadow$getItem().getUnlocalizedNameInefficiently((net.minecraft.item.ItemStack) (IMixinItemStack) this) + ".name"; } return new SpongeTranslation(id); }</code><technical_language>Cache this</technical_language>

Target:
public Translation itemstack$getTranslation() { if (this.translation == null) { this.translation = ((ItemType) shadow$getItem()).getTranslation((ItemStack) this); } return this.translation; }
Source:
<code>public VersionInfo versionInfoForUpdate() { if (isDevelopmentServer() || isVersionInfoUpdatedToday() || isUpdateInProgress()) return null; <START> versionInfoUpdatingFrom = clock.currentDateTime(); <END> return this.serverVersionInfo; }</code><technical_language>this method is thread safe</technical_language>

Target:
public VersionInfo versionInfoForUpdate() { synchronized (VERSION_INFO_MUTEX) { if (isDevelopmentServer() || isVersionInfoUpdatedToday() || isUpdateInProgress()) return null; versionInfoUpdatingFrom = clock.currentDateTime(); return this.serverVersionInfo; } }
Source:
<code>public LabelStyleDescription createLabelStyleDescription() { <START> LabelStyleDescriptionImpl labelStyleDescription = new LabelStyleDescriptionImpl(); <END> return labelStyleDescription; }</code><technical_language>in review of patch set 2: not-generated code missed</technical_language>

Target:
public LabelStyleDescription createLabelStyleDescription() { LabelStyleDescriptionImpl labelStyleDescription = new LabelStyleDescriptionImpl(); new DefaultColorStyleDescription().setDefaultColors(labelStyleDescription); return labelStyleDescription; }
Source:
<code>public void setUp() throws Exception { buildFlowProject = jenkinsRule.createBuildFlowProject(); jenkinsRule.createFreeStyleProject("downstreamProject1"); jenkinsRule.createFreeStyleProject("downstreamProject2"); jenkinsRule.createFreeStyleProject("downstreamProject3"); <START> String dsl = "parallel (" + <END> " { build(\"downstreamProject1\") }," + " { build(\"downstreamProject2\") }" + ")" + "{ build(\"downstreamProject3\") }"; buildFlowProject.setDsl(dsl); given(ghPullRequest.getNumber()).willReturn(1); given(ghRepository.getPullRequest(1)).willReturn(ghPullRequest); super.beforeTest(null, null, buildFlowProject); }</code><technical_language>Again, StringBuilder is faster cleaner read</technical_language>

Target:
public void setUp() throws Exception { buildFlowProject = jenkinsRule.createBuildFlowProject(); jenkinsRule.createFreeStyleProject("downstreamProject1"); jenkinsRule.createFreeStyleProject("downstreamProject2"); jenkinsRule.createFreeStyleProject("downstreamProject3"); StringBuilder dsl = new StringBuilder(); dsl.append("parallel ("); dsl.append(" { build(\"downstreamProject1\") },"); dsl.append(" { build(\"downstreamProject2\") }"); dsl.append(")"); dsl.append("{ build(\"downstreamProject3\") }"); buildFlowProject.setDsl(dsl.toString()); given(ghPullRequest.getNumber()).willReturn(1); given(ghRepository.getPullRequest(1)).willReturn(ghPullRequest); super.beforeTest(null, null, buildFlowProject); }
Source:
<code>public double getEnergyDemand( final double maxRequired ) { <START> final Queue<IEnergyGridProvider> toVisit = new LinkedList<>(); <END> final Set<IEnergyGridProvider> visited = new HashSet<>(); toVisit.add( this ); double required = this.buffer() - this.extra; while( !toVisit.isEmpty() && required < maxRequired ) { final IEnergyGridProvider next = toVisit.poll(); visited.add( next ); required += next.getProviderEnergyDemand( maxRequired - required, visited ); for( IEnergyGridProvider iEnergyGridProvider : next.providers() ) { if( !visited.contains( iEnergyGridProvider ) ) { toVisit.add( iEnergyGridProvider ); } } } return required; }</code><technical_language>a stack enough (for performance)? Evaluation order differ, i matters</technical_language>

Target:
public double getEnergyDemand( final double maxRequired ) { final Queue<IEnergyGridProvider> toVisit = new ArrayDeque<>(); final Set<IEnergyGridProvider> visited = new HashSet<>(); toVisit.add( this ); double required = 0; while( !toVisit.isEmpty() && required < maxRequired ) { final IEnergyGridProvider next = toVisit.poll(); visited.add( next ); required += next.getProviderEnergyDemand( maxRequired - required, visited ); for( IEnergyGridProvider iEnergyGridProvider : next.providers() ) { if( !visited.contains( iEnergyGridProvider ) ) { toVisit.add( iEnergyGridProvider ); } } } return required; }
Source:
<code>public void close() throws IOException { <START> addEml(); <END> addMeta(); flushLastCoreRecord(); for (TabWriter w : writers.values()) { w.close(); } }</code><technical_language>Encapsulate calls in try-finally ensure cleanup completes possible</technical_language>

Target:
public void close() throws IOException { try { addEml(); addMeta(); flushLastCoreRecord(); } finally { for (TabWriter w : writers.values()) { try { w.close(); } catch (Exception ex) { log.error("Unable to close writer " + w, ex); } } } }
Source:
<code>private ClusterSearchShardsResponse getSearchShardsResponse(TransportClient client, ClusterSearchShardsRequest request) { try { return retry() .maxAttempts(maxAttempts) <START> .exponentialBackoff(maxRetryTime, 2.0) <END> .run("getSearchShardsResponse", () -> { return client.admin() .cluster() .searchShards(request) .actionGet(requestTimeout.toMillis()); }); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>scale factor of 2.0 do a parameter exponentialBackoff method</technical_language>

Target:
private ClusterSearchShardsResponse getSearchShardsResponse(TransportClient client, ClusterSearchShardsRequest request) { try { return retry() .maxAttempts(maxAttempts) .exponentialBackoff(maxRetryTime) .run("getSearchShardsResponse", () -> client.admin() .cluster() .searchShards(request) .actionGet(requestTimeout.toMillis())); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public static List<PostAggregator> pruneDependentPostAgg(List<PostAggregator> postAggregatorList, String postAggName) { LinkedList<PostAggregator> rv = Lists.newLinkedList(); Set<String> deps = new HashSet<>(); deps.add(postAggName); <START> for (int i = postAggregatorList.size() - 1; i >= 0; i--) { <END> PostAggregator agg = postAggregatorList.get(i); if (deps.contains(agg.getName())) { rv.addFirst(agg); deps.remove(agg.getName()); deps.addAll(agg.getDependentFields()); } } return rv; }</code><technical_language>for(PostAggregator agg : Lists.reverse(postAggregatorList))</technical_language>

Target:
public static List<PostAggregator> pruneDependentPostAgg(List<PostAggregator> postAggregatorList, String postAggName) { LinkedList<PostAggregator> rv = Lists.newLinkedList(); Set<String> deps = new HashSet<>(); deps.add(postAggName); for (PostAggregator agg : Lists.reverse(postAggregatorList)) { if (deps.contains(agg.getName())) { rv.addFirst(agg); deps.remove(agg.getName()); deps.addAll(agg.getDependentFields()); } } return rv; }
Source:
<code>protected abstract ProjectLauncher getProjectLauncher() throws CoreException; protected abstract void initialiseBndLauncher(ILaunchConfiguration configuration, Project model) throws Exception; protected abstract IStatus getLauncherStatus(); @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { BndPreferences prefs = new BndPreferences(); boolean result = !prefs.getBuildBeforeLaunch() || super.buildForLaunch(configuration, mode, monitor); try { model = LaunchUtils.getBndProject(configuration); <START> for (Object service : launchListeners.getServices()) { <END> if (service instanceof LaunchListener) { LaunchListener launchListener = (LaunchListener) service; try { launchListener.buildForLaunch(model); } catch (Throwable t) { logger.logError("Error in launch listener", t); } } } initialiseBndLauncher(configuration, model); } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error initialising bnd launcher", e)); } return result; }</code><technical_language>is for (LaunchListener launchListener: ? ST is generically typed</technical_language>

Target:
protected abstract ProjectLauncher getProjectLauncher() throws CoreException; protected abstract void initialiseBndLauncher(ILaunchConfiguration configuration, Project model) throws Exception; protected abstract IStatus getLauncherStatus(); @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { BndPreferences prefs = new BndPreferences(); boolean result = !prefs.getBuildBeforeLaunch() || super.buildForLaunch(configuration, mode, monitor); try { run = LaunchUtils.createRun(configuration); initialiseBndLauncher(configuration, run); } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error initialising bnd launcher", e)); } return result; }
Source:
<code>public void testLHSConflictsArePickedUpForEachFieldOfAPattern() throws Exception { final String xml = loadResource("GUVNOR-3513.gdst"); final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance() .unmarshal(xml); final Analyzer analyzer = analyzerProvider.makeAnalyser(table52); analyzer.resetChecks(); analyzer.analyze(); <START> analyzerProvider.getAnalysisReport().stream().forEach(i->System.out.println(i.getCheckType())); <END> assertTrue(analyzerProvider.getAnalysisReport().isEmpty()); }</code><technical_language>I System.out.println(i.getCheckType() is useful fixing/investigating some bug, test is run automatically a machine, checking output. Is chance for some debug level log some assertion instead of System.out.println</technical_language>

Target:
public void testLHSConflictsArePickedUpForEachFieldOfAPattern() throws Exception { final String xml = loadResource("GUVNOR-3513.gdst"); final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance() .unmarshal(xml); final Analyzer analyzer = analyzerProvider.makeAnalyser(table52); analyzer.resetChecks(); analyzer.analyze(); assertResultIsEmpty(analyzerProvider.getAnalysisReport()); }
Source:
<code>public void createFBInstance(final FBDeploymentData fbData, final Resource res) throws DeploymentException { Map<String, AdapterType> adapters = getAdapterTypes(fbData.getFb().getType().getInterfaceList()); if (!adapters.isEmpty()) { <START> queryAdapterTypes(adapters, res); <END> createAdapterTypes(adapters, res); } if (!getTypes().contains(fbData.getFb().getType().getName())) { try { createFBType(fbData.getFb().getType(), res); } catch (DeploymentException ce) { logger.error(MessageFormat.format(Messages.DTL_CreateTypeFailed, fbData.getFb().getType().getName())); } } super.createFBInstance(fbData, res); }</code><technical_language>move query adapter types connect</technical_language>

Target:
public void createFBInstance(final FBDeploymentData fbData, final Resource res) throws DeploymentException { Map<String, AdapterType> adapters = getAdapterTypes(fbData.getFb().getType().getInterfaceList()); if (!adapters.isEmpty()) { queryAdapterTypes(adapters, res); createAdapterTypes(adapters, res); } checkCreateFBType(fbData.getFb(), res); super.createFBInstance(fbData, res); }
Source:
<code>public void oneHandlerEventOnSet() { addSampleItem(); <START> CollectionEventHandlers.CountingHandler<String> counter = new CollectionEventHandlers.CountingHandler<>(); <END> list.addHandler(counter); list.set(0, "abc"); assertEquals(1, counter.getCounter()); }</code><technical_language>is check for set event explicitly</technical_language>

Target:
public void oneHandlerEventOnSet() { addSampleItem(); RecordingCollectionEventHandler<String> counter = new RecordingCollectionEventHandler<>(); list.addHandler(counter); list.set(0, "abc"); assertEquals(1, counter.getCounter()); assertEquals(SET, counter.getEvents().get(0).getType()); }
Source:
<code>public Payment getPaymentByExternalKey(final String paymentExternalKey, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext tenantContext) <START> throws PaymentApiException { <END> final Payment payment = paymentProcessor.getPaymentByExternalKey(paymentExternalKey, withPluginInfo, properties, tenantContext, internalCallContextFactory.createInternalTenantContext(tenantContext)); if (payment == null) { throw new PaymentApiException(ErrorCode.PAYMENT_NO_SUCH_PAYMENT, paymentExternalKey); } return payment; }</code><technical_language>here: new flag withAttempts is passed (used) paymentProcessor#getAccountPayments</technical_language>

Target:
public Payment getPaymentByExternalKey(final String paymentExternalKey, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext tenantContext) throws PaymentApiException { final Payment payment = paymentProcessor.getPaymentByExternalKey(paymentExternalKey, withPluginInfo, withAttempts, properties, tenantContext, internalCallContextFactory.createInternalTenantContext(tenantContext)); if (payment == null) { throw new PaymentApiException(ErrorCode.PAYMENT_NO_SUCH_PAYMENT, paymentExternalKey); } return payment; }
Source:
<code>private String encoding(HttpServletRequest req) { String encoding = req.getCharacterEncoding(); <START> if (encoding == null) encoding = "UTF-8"; <END> return encoding; }</code><technical_language>nit: wrap statement in {}. Guava able shorten this to: return Objects.firstNonNull(req.getCharacterEncoding(), "UTF-8");</technical_language>

Target:
private String encoding(HttpServletRequest req) { return Objects.firstNonNull(req.getCharacterEncoding(), "UTF-8"); }
Source:
<code>public static void waitForNetworkThreadExecutorToFinish() { try { Class syncManager = Class.forName("io.realm.SyncManager"); Field field = syncManager.getDeclaredField("NETWORK_POOL_EXECUTOR"); <START> ThreadPoolExecutor pool = (ThreadPoolExecutor) field.get(null); <END> pool.shutdownNow(); try { pool.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new AssertionError("NetworkPoolExecutor was not shut down in time:\n" + Util.getStackTrace(e)); } finally { field.set(null, new ThreadPoolExecutor( 10, 10, 0, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(100))); } } catch (ClassNotFoundException e) { } catch (NoSuchFieldException e) { throw new AssertionError("Could not find NETWORK_POOL_EXECUTOR field"); } catch (IllegalAccessException e) { throw new AssertionError(Util.getStackTrace(e)); } }</code><technical_language>minor: for performance reason, reflection code static for caching, this is called more for integration tests</technical_language>

Target:
public static void waitForNetworkThreadExecutorToFinish() { if (networkPoolExecutorField == null) { return; } try { ThreadPoolExecutor pool = (ThreadPoolExecutor) networkPoolExecutorField.get(null); pool.shutdownNow(); try { pool.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new AssertionError("NetworkPoolExecutor was not shut down in time:\n" + Util.getStackTrace(e)); } finally { networkPoolExecutorField.set(null, new ThreadPoolExecutor( 10, 10, 0, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(100))); } } catch (IllegalAccessException e) { throw new AssertionError(Util.getStackTrace(e)); } }
Source:
<code>private void postSystemEvent(Ack ack) { Status status = ack.getStatus(); CommandId commandId = commandIdFrom(ack); EventMessage systemEvent = systemEventFor(status, commandId); Command command = commands.get(commandId); <START> checkState(command != null, "Unknown command ID encountered: %s", commandId.value()); <END> Origin systemEventOrigin = CommandEnvelope.of(command) .asMessageOrigin(); writeSide.postEvent(systemEvent, systemEventOrigin); }</code><technical_language>Please finish dot</technical_language>

Target:
private void postSystemEvent(Ack ack) { Status status = ack.getStatus(); CommandId commandId = commandIdFrom(ack); EventMessage systemEvent = systemEventFor(status, commandId); Command command = commands.get(commandId); checkState(command != null, "Unknown command ID encountered: `%s`.", commandId.value()); Origin systemEventOrigin = CommandEnvelope.of(command) .asMessageOrigin(); writeSide.postEvent(systemEvent, systemEventOrigin); }
Source:
<code><START> public String scheduleTimeout( Value request ) { <END> final String uuid = UUID.randomUUID().toString(); TimeUnit unit; if (request.getFirstChild("timeunit") != null) { try { unit = TimeUnit.valueOf(request.getFirstChild("timeunit").strValue().toUpperCase()); } catch (Exception e) { System.err.println(e); System.err.println("Defaulting to timeunit seconds"); } finally { unit = TimeUnit.SECONDS; } } else { unit = TimeUnit.SECONDS; } tasks.add( uuid ); executor.schedule( () -> { if ( tasks.contains( uuid ) ) { sendMessage(CommMessage.createRequest(request.getFirstChild("operation").strValue(), "/", request.getFirstChild("message"))); tasks.remove(uuid); } }, request.intValue(), unit ); return uuid; }</code><technical_language>Indentation is inconsistent rest of code (I I send a conf package if Netbeans)</technical_language>

Target:
public Long scheduleTimeout( Value request ) throws FaultException { final long timeoutId = atomicLong.getAndIncrement(); TimeUnit unit; if (request.hasChildren( "timeunit" )) { try { unit = TimeUnit.valueOf( request.getFirstChild( "timeunit" ).strValue().toUpperCase() ); } catch ( Exception e ) { throw new FaultException( "InvalidTimeUnit", e ); } } else { unit = TimeUnit.MILLISECONDS; } String operationName; if (request.hasChildren( "operation" )) { operationName = request.getFirstChild( "operation" ).strValue(); } else { operationName = "timeout"; } ScheduledFuture scheduledFuture = executor.schedule( () -> { sendMessage( CommMessage.createRequest( operationName, "/", request.getFirstChild( "message" ))); }, request.intValue(), unit ); scheduledFutureHashMap.put(timeoutId, scheduledFuture); return timeoutId; }
Source:
<code>private static WorkItemDefinition parseWorkItemDefinitionObject(Queue<String> objectQueue) { WorkItemDefinition wid = emptyWid(); wid.setDependencies(new Dependencies()); String line = objectQueue.poll(); while (!isEndingObject(line) && !objectQueue.isEmpty()) { Pair<String, String> attributes = getAttribute(line); switch (attributes.getK1()) { <START> case "name": <END> wid.setName(attributes.getK2()); break; case "displayName": wid.setDisplayName(attributes.getK2()); break; case "icon": wid.getIconDefinition().setUri(attributes.getK2()); break; case "parameters": if (!isEndingObject(attributes.getK2())) { Collection<Pair<String, String>> parameters = retrieveParameters(objectQueue); wid.setParameters(parseParameters(parameters)); } break; case "results": if (!isEndingObject(attributes.getK2())) { Collection<Pair<String, String>> results = retrieveParameters(objectQueue); wid.setResults(parseParameters(results)); } break; case "category": wid.setCategory(attributes.getK2()); default: break; } line = objectQueue.poll(); } if (empty(wid.getCategory())) { wid.setCategory(BPMNCategories.SERVICE_TASKS); } return wid; }</code><technical_language>defined constants, I is situation of this parser. If rewriting soon needed</technical_language>

Target:
private static WorkItemDefinition parseWorkItemDefinitionObject(Queue<String> objectQueue) { WorkItemDefinition wid = emptyWid(); wid.setDependencies(new Dependencies()); String line = objectQueue.poll(); while (!isEndingObject(line) && !objectQueue.isEmpty()) { Map.Entry<String, String> attributes = getAttribute(line); switch (attributes.getKey()) { case NAME: wid.setName(attributes.getValue()); break; case DISPLAY_NAME: wid.setDisplayName(attributes.getValue()); break; case ICON: wid.getIconDefinition().setUri(attributes.getValue()); break; case PARAMETERS: if (!isEndingObject(attributes.getValue())) { Collection<Map.Entry<String, String>> parameters = retrieveParameters(objectQueue); wid.setParameters(parseParameters(parameters)); } break; case RESULTS: if (!isEndingObject(attributes.getValue())) { Collection<Map.Entry<String, String>> results = retrieveParameters(objectQueue); wid.setResults(parseParameters(results)); } break; case CATEGORY: wid.setCategory(attributes.getValue()); default: break; } line = objectQueue.poll(); } if (empty(wid.getCategory())) { wid.setCategory(BPMNCategories.SERVICE_TASKS); } return wid; }
Source:
<code><START> private String decorateRecordData(String line) { <END> if (line == null && line.isEmpty()) { return null; } String[] strArr = line.split(","); if (strArr.length >= 2) { String openDateStr = strArr[0].substring(0, strArr[0].length() - 3); openDateStr = openDateStr.substring(0, 4) + "-" + openDateStr.substring(4, 6) + "-" + openDateStr.substring(6, 8); String issueNumStr = strArr[0].substring(strArr[0].length() - 3); int issueNum = Integer.parseInt(issueNumStr); int minutes = 0; int hours = 0; if (issueNum >= 24 && issueNum < 96) { int temp = (issueNum - 24) * 10; minutes = temp % 60; hours = temp / 60; hours += 10; } else if (issueNum >= 96 && issueNum <= 120) { int temp = (issueNum - 96) * 5; minutes = temp % 60; hours = temp / 60; hours += 22; } else { int temp = issueNum * 5; minutes = temp % 60; hours = temp / 60; } openDateStr = openDateStr + " " + hours + ":" + (minutes == 0 ? "00" : minutes) + ":00"; long openDateStrNum = 0; try { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date midDate = formatter.parse(openDateStr); openDateStrNum = midDate.getTime(); } catch (Exception e) { throw new RuntimeException("the decorateRecordData function shows exception!", e.getCause()); } String lotteryValue = strArr[1]; lotteryValue = lotteryValue.replace("", ","); line = openDateStrNum + lotteryValue; } return line; }</code><technical_language>This method is used</technical_language>

Target:
private String decorateRecordData(String line) { if (line == null && line.isEmpty()) { return null; } String[] strArr = line.split(","); if (strArr.length >= 2) { String openDateStr = strArr[0].substring(0, strArr[0].length() - 3); openDateStr = openDateStr.substring(0, 4) + "-" + openDateStr.substring(4, 6) + "-" + openDateStr.substring(6, 8); String issueNumStr = strArr[0].substring(strArr[0].length() - 3); int issueNum = Integer.parseInt(issueNumStr); int minutes; int hours; if (issueNum >= 24 && issueNum < 96) { int temp = (issueNum - 24) * 10; minutes = temp % 60; hours = temp / 60; hours += 10; } else if (issueNum >= 96 && issueNum <= 120) { int temp = (issueNum - 96) * 5; minutes = temp % 60; hours = temp / 60; hours += 22; } else { int temp = issueNum * 5; minutes = temp % 60; hours = temp / 60; } openDateStr = openDateStr + " " + hours + ":" + (minutes == 0 ? "00" : minutes) + ":00"; long openDateStrNum = 0; try { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date midDate = formatter.parse(openDateStr); openDateStrNum = midDate.getTime(); } catch (Exception e) { throw new RuntimeException("the decorateRecordData function shows exception!", e.getCause()); } String lotteryValue = strArr[1]; lotteryValue = lotteryValue.replace("", ","); line = openDateStrNum + lotteryValue; } return line; }
Source:
<code>public void getMessages_should_request_message_search() throws MessagingException { setupFolderWith23Messages(); <START> folder.getMessageCount(); <END> String messagesXml = "<xml>MessagesXml</xml>"; HashMap<String, String> headers = new HashMap<>(); headers.put("Brief", "t"); headers.put("Range", "rows=13-23"); when(mockStore.getMessagesXml()).thenReturn(messagesXml); when(mockStore.processRequest(eq("https://localhost/webDavStoreUrl/testFolder"), eq("SEARCH"), eq(messagesXml), eq(headers))).thenReturn(mockDataSet); String[] uids = new String[]{"uid1","uid2","uid3","uid4","uid5"}; HashMap<String, String> uidToUrls = new HashMap<>(); uidToUrls.put("uid1","url1"); uidToUrls.put("uid2","url2"); uidToUrls.put("uid3","url3"); uidToUrls.put("uid4","url4"); uidToUrls.put("uid5","url5"); when(mockDataSet.getUids()).thenReturn(uids); when(mockDataSet.getUidToUrl()).thenReturn(uidToUrls); folder.getMessages(0, 10, new Date(), listener); verify(listener, times(5)).messageStarted(anyString(), anyInt(), eq(5)); verify(listener, times(5)).messageFinished(any(WebDavMessage.class), anyInt(), eq(5)); }</code><technical_language>calling this ignore result</technical_language>

Target:
public void getMessages_should_request_message_search() throws MessagingException { int totalMessages = 23; int messageStart = 1; int messageEnd = 11; setupFolderWithMessages(totalMessages); String messagesXml = "<xml>MessagesXml</xml>"; buildSearchResponse(mockDataSet); when(mockStore.getMessagesXml()).thenReturn(messagesXml); when(mockStore.processRequest(eq("https://localhost/webDavStoreUrl/testFolder"), eq("SEARCH"), eq(messagesXml), Matchers.<Map<String, String>>any())).thenReturn(mockDataSet); folder.getMessages(1, 11, new Date(), listener); verify(listener, times(5)).messageStarted(anyString(), anyInt(), eq(5)); verify(listener, times(5)).messageFinished(any(WebDavMessage.class), anyInt(), eq(5)); }
Source:
<code>public ConcurEventNotification convertConcurEventNotification(ConcurEventNotificationDTO concurEventNotificationDTO) { ConcurEventNotification concurEventNotification = new ConcurEventNotification(); concurEventNotification.setContext(concurEventNotificationDTO.getContext()); try { concurEventNotification.setEventDateTime(dateTimeService.convertToSqlDate(concurEventNotificationDTO.getEventDateTime())); } catch (ParseException e) { <START> concurEventNotification.setEventDateTime(dateTimeService.getCurrentSqlDate()); <END> } concurEventNotification.setEventType(concurEventNotificationDTO.getEventType()); concurEventNotification.setObjectType(concurEventNotificationDTO.getObjectType()); concurEventNotification.setObjectURI(concurEventNotificationDTO.getObjectURI()); return concurEventNotification; }</code><technical_language>this log error warning event date time in invalid format? ok defaulting today</technical_language>

Target:
public ConcurEventNotification convertConcurEventNotification(ConcurEventNotificationDTO concurEventNotificationDTO) throws ParseException { ConcurEventNotification concurEventNotification = new ConcurEventNotification(); concurEventNotification.setContext(concurEventNotificationDTO.getContext()); concurEventNotification.setEventDateTime(dateTimeService.convertToSqlDate(concurEventNotificationDTO.getEventDateTime())); concurEventNotification.setEventType(concurEventNotificationDTO.getEventType()); concurEventNotification.setObjectType(concurEventNotificationDTO.getObjectType()); concurEventNotification.setObjectURI(concurEventNotificationDTO.getObjectURI()); return concurEventNotification; }
Source:
<code>public void populateCreaturesMenu() { ColumnLayout creatureTabColumnLayout = (ColumnLayout) creatureTab; Iterator<UIWidget> iterator = creatureTab.iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } <START> EntityManager entityManager = CoreRegistry.get(EntityManager.class); <END> }</code><technical_language>Note references CoreRegistry.get(class) need replaced @In annotations (best idea) context.get(class) codes (find-and-replace). need @In annotation pull in a context</technical_language>

Target:
public void populateCreaturesMenu() { ColumnLayout creatureTabColumnLayout = (ColumnLayout) creatureTab; Iterator<UIWidget> iterator = creatureTab.iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } }
Source:
<code>public void play() { try { <START> new File((new File(entry.getFilePath()).getParentFile().list())[0]) <END> .exists(); if (player.isPlaying()) { player.stop(); } this.paused = false; player.reset(); player.setDataSource(entry.getFilePath()); player.prepare(); player.start(); this.messagingService .getService() .sendPlayStatusMessage(this.entry, true); } catch (Exception e) { Log.wtf(TAG, "Unable to play song: " + entry.getFilePath()); e.printStackTrace(); } }</code><technical_language>pull this out a isGoodPath helper method something</technical_language>

Target:
public void play() { if (isValidPath()) { try { if (player.isPlaying()) { player.stop(); } this.paused = false; player.reset(); player.setDataSource(entry.getFilePath()); player.prepare(); player.start(); this.messagingService.getService().sendPlayStatusMessage( this.entry, true); } catch (Exception e) { Log.wtf(TAG, "Unable to play song: " + entry.getFilePath()); } } else { Log.w(TAG, "File Path was not valid"); } }
Source:
<code>protected void onHandleIntent(Intent intent) { String urlToDownload = intent.getStringExtra("url"); ResultReceiver receiver = (ResultReceiver) intent .getParcelableExtra("receiver"); try { URL url = new URL(urlToDownload); URLConnection connection = url.openConnection(); connection.connect(); <START> int fileLength = connection.getContentLength(); <END> InputStream input = new BufferedInputStream(url.openStream()); OutputStream output = new FileOutputStream( intent.getStringExtra("destination")); byte data[] = new byte[1024]; long total = 0; int count; while ((count = input.read(data)) != -1) { total += count; Bundle resultData = new Bundle(); resultData.putInt("progress", (int) (total * 100 / fileLength)); receiver.send(UPDATE_PROGRESS, resultData); output.write(data, 0, count); } output.flush(); output.close(); input.close(); } catch (IOException e) { e.printStackTrace(); } Bundle resultData = new Bundle(); resultData.putInt("progress", 100); receiver.send(UPDATE_PROGRESS, resultData); }</code><technical_language>check connection status, 404, 403, 500, etc</technical_language>

Target:
protected void onHandleIntent(Intent intent) { String urlToDownload = intent.getStringExtra("url"); mReceiver = (ResultReceiver) intent.getParcelableExtra("receiver"); try { copyFileFromUrl(urlToDownload, intent.getStringExtra("destination")); mReceiver.send(DOWNLOAD_COMPLETE, null); } catch (IOException e) { sendError(INTERNAL_ERROR, urlToDownload, e); e.printStackTrace(); } catch (HTTPException e) { sendError(HTTP_ERROR, urlToDownload, e); e.printStackTrace(); } }
Source:
<code>public void testAttributeMap() { Map<String, List<String>> attributeMapping = new HashMap<>(); List<String> attributes = new ArrayList<>(); attributes.add("datamanager"); attributes.add("admin"); attributeMapping.put("invalid-state", attributes); plugin.setAttributeMap(attributeMapping); Map<String, List<String>> attributeMap = plugin.getAttributeMap(); <START> assertEquals(true, attributeMap.containsKey("invalid-state")); <END> assertEquals(2, attributeMap.get("invalid-state").size()); assertEquals(true, attributeMap.get("invalid-state").contains("datamanager")); assertEquals(true, attributeMap.get("invalid-state").contains("admin")); }</code><technical_language>generally assertThat in of junit matchings. java assertThat(attributeMap.containsKey("invalid-state"), is(true));</technical_language>

Target:
public void testAttributeMap() { Map<String, List<String>> attributeMapping = new HashMap<>(); List<String> attributes = new ArrayList<>(); attributes.add("data-manager"); attributes.add("system-admin"); attributeMapping.put("invalid-state", attributes); plugin.setAttributeMap(attributeMapping); Map<String, List<String>> attributeMap = plugin.getAttributeMap(); assertThat(attributeMap.containsKey("invalid-state"), is(true)); assertThat(attributeMap.get("invalid-state").size(), is(2)); assertThat(attributeMap.get("invalid-state").contains("data-manager"), is(true)); assertThat(attributeMap.get("invalid-state").contains("system-admin"), is(true)); }
Source:
<code>public void run() { try { final long hardKillDeadline = System.nanoTime() + timeoutMillis * 1_000_000; long millisLeft; while (executerThread.isAlive() && (millisLeft = (hardKillDeadline - System.nanoTime()) / 1_000_000) > 0) { try { executerThread.join(millisLeft); } catch (InterruptedException ignored) { } } if (executerThread.isAlive()) { <START> String msg = "Task did not exit gracefully within " + (timeoutMillis / 1000) + " + seconds."; <END> taskManager.notifyFatalError(msg, new FlinkRuntimeException(msg)); } } catch (Throwable t) { ExceptionUtils.rethrowIfFatalError(t); log.error("Error in Task Cancellation Watch Dog", t); } }</code><technical_language>log is unused</technical_language>

Target:
public void run() { try { final long hardKillDeadline = System.nanoTime() + timeoutMillis * 1_000_000; long millisLeft; while (executerThread.isAlive() && (millisLeft = (hardKillDeadline - System.nanoTime()) / 1_000_000) > 0) { try { executerThread.join(millisLeft); } catch (InterruptedException ignored) { } } if (executerThread.isAlive()) { String msg = "Task did not exit gracefully within " + (timeoutMillis / 1000) + " + seconds."; taskManager.notifyFatalError(msg, new FlinkRuntimeException(msg)); } } catch (Throwable t) { throw new FlinkRuntimeException("Error in Task Cancellation Watch Dog", t); } }
Source:
<code>protected void prepareClientInvocation() throws Exception { trustAllCertificates(); <START> System.out.println("Trusting all certs"); <END> }</code><technical_language>Logger instead of sys out</technical_language>

Target:
protected void prepareClientInvocation() throws Exception { trustAllCertificates(); log.info("Trusting all certs"); }
Source:
<code>void onComplete(PutOperation op) { Exception e = op.getOperationException(); String blobId = op.getBlobIdString(); op.maybeNotifyForBlobCreation(); if (blobId == null && e == null) { e = new RouterException("Operation failed, but exception was not set", RouterErrorCode.UnexpectedInternalError); routerMetrics.operationFailureWithUnsetExceptionCount.inc(); } if (e != null) { blobId = null; routerMetrics.onPutBlobError(e, op.isEncryptionEnabled(), op.isStitchOperation()); routerCallback.scheduleDeletes(op.getSuccessfullyPutChunkIdsIfCompositeDirectUpload(), op.getServiceId()); } else { updateChunkingAndSizeMetricsOnSuccessfulPut(op); } routerMetrics.operationDequeuingRate.mark(); long operationLatencyMs = time.milliseconds() - op.getSubmissionTimeMs(); Histogram latencyMetric; if (op.isStitchOperation()) { latencyMetric = op.isEncryptionEnabled() ? routerMetrics.stitchEncryptedBlobOperationLatencyMs : routerMetrics.stitchBlobOperationLatencyMs; } else { latencyMetric = op.isEncryptionEnabled() ? routerMetrics.putEncryptedBlobOperationLatencyMs : routerMetrics.putBlobOperationLatencyMs; } <START> latencyMetric.update(operationLatencyMs); <END> NonBlockingRouter.completeOperation(op.getFuture(), op.getCallback(), blobId, e); }</code><technical_language>similar in NonBlockingRouter.java follows: if (op.isStitchOperation()) { (op.isEncryptionEnabled() ? routerMetrics.stitchEncryptedBlobOperationLatencyMs : routerMetrics.stitchBlobOperationLatencyMs).update(operationLatencyMs); } else { (op.isEncryptionEnabled() ? routerMetrics.putEncryptedBlobOperationLatencyMs : routerMetrics.putBlobOperationLatencyMs).update(operationLatencyMs); } other concerns</technical_language>

Target:
void onComplete(PutOperation op) { Exception e = op.getOperationException(); String blobId = op.getBlobIdString(); op.maybeNotifyForBlobCreation(); if (blobId == null && e == null) { e = new RouterException("Operation failed, but exception was not set", RouterErrorCode.UnexpectedInternalError); routerMetrics.operationFailureWithUnsetExceptionCount.inc(); } if (e != null) { blobId = null; routerMetrics.onPutBlobError(e, op.isEncryptionEnabled(), op.isStitchOperation()); routerCallback.scheduleDeletes(op.getSuccessfullyPutChunkIdsIfCompositeDirectUpload(), op.getServiceId()); } else { updateChunkingAndSizeMetricsOnSuccessfulPut(op); } routerMetrics.operationDequeuingRate.mark(); long operationLatencyMs = time.milliseconds() - op.getSubmissionTimeMs(); if (op.isStitchOperation()) { (op.isEncryptionEnabled() ? routerMetrics.stitchEncryptedBlobOperationLatencyMs : routerMetrics.stitchBlobOperationLatencyMs).update(operationLatencyMs); } else { (op.isEncryptionEnabled() ? routerMetrics.putEncryptedBlobOperationLatencyMs : routerMetrics.putBlobOperationLatencyMs).update(operationLatencyMs); } NonBlockingRouter.completeOperation(op.getFuture(), op.getCallback(), blobId, e); }
Source:
<code>public void setName(String name) { <START> this.name = new CaseInsensitiveString(name); <END> }</code><technical_language>Preferably call other</technical_language>

Target:
public void setName(String name) { setName(new CaseInsensitiveString(name)); }