auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void addThreadMetrics(List<MetricFamilySamples> sampleFamilies) { sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_current", "Current thread count of a JVM", threadBean.getThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_daemon", "Daemon thread count of a JVM", threadBean.getDaemonThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_peak", "Peak thread count of a JVM", threadBean.getPeakThreadCount())); sampleFamilies.add( new CounterMetricFamily( "jvm_threads_started_total", "Started thread count of a JVM", threadBean.getTotalStartedThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_deadlocked", "Deadlocked thread count of a JVM", nullSafeArrayLength(threadBean.findDeadlockedThreads()))); sampleFamilies.add( new GaugeMetricFamily( <START> "jvm_threads_monitor_deadlocked", <END> "Deadlocked monitor thread count of a JVM", nullSafeArrayLength(threadBean.findMonitorDeadlockedThreads()))); }</code><technical_language>deadlocked_monitor more typical. suggest expanding a bit users get idea of difference metrics</technical_language>

Target:
void addThreadMetrics(List<MetricFamilySamples> sampleFamilies) { sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_current", "Current thread count of a JVM", threadBean.getThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_daemon", "Daemon thread count of a JVM", threadBean.getDaemonThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_peak", "Peak thread count of a JVM", threadBean.getPeakThreadCount())); sampleFamilies.add( new CounterMetricFamily( "jvm_threads_started_total", "Started thread count of a JVM", threadBean.getTotalStartedThreadCount())); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_deadlocked", "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers", nullSafeArrayLength(threadBean.findDeadlockedThreads()))); sampleFamilies.add( new GaugeMetricFamily( "jvm_threads_deadlocked_monitor", "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors", nullSafeArrayLength(threadBean.findMonitorDeadlockedThreads()))); }
Source:
<code>protected void checkTryResources(final DetailAST resourcesSpecAst) { final DetailAST resourcesAst = resourcesSpecAst.findFirstToken(TokenTypes.RESOURCES); final IndentLevel expectedResourceIndent = new IndentLevel(getIndent().getFirstIndentLevel() <START> + getIndentCheck().getLineWrappingIndentation()); <END> final String subType = "resource"; DetailAST resourceAst = resourcesAst.getFirstChild(); while (resourceAst != null) { if (resourceAst.getType() == TokenTypes.RESOURCE) { final DetailAST nextSibling; if (resourceAst.getNextSibling() == null) { nextSibling = getTryResRparen(); } else { nextSibling = resourceAst.getNextSibling(); } if (isOnStartOfLine(resourceAst)) { checkChildIndentation(resourceAst, subType, expectedResourceIndent); checkWrappingIndentation( resourceAst, nextSibling, getIndentCheck().getLineWrappingIndentation(), expectedResourceIndent.getFirstIndentLevel(), true); } else { checkWrappingIndentation(resourceAst, nextSibling); } } resourceAst = resourceAst.getNextSibling(); } }</code><technical_language>final String indetation = getIndent().getFirstIndentLevel() + getIndentCheck().getLineWrappingIndentation() final IndentLevel expectedResourceIndent = new IndentLevel(indetation);</technical_language>

Target:
protected void checkTryResources(final DetailAST resourcesSpecAst) { final DetailAST resourcesAst = resourcesSpecAst.findFirstToken(TokenTypes.RESOURCES); final int indetation = getIndent().getFirstIndentLevel() + getIndentCheck().getLineWrappingIndentation(); final IndentLevel expectedResourceIndent = new IndentLevel(indetation); final String subType = "resource"; DetailAST resourceAst = resourcesAst.getFirstChild(); while (resourceAst != null) { if (resourceAst.getType() == TokenTypes.RESOURCE) { final DetailAST nextSibling; if (resourceAst.getNextSibling() == null) { nextSibling = getTryResRparen(); } else { nextSibling = resourceAst.getNextSibling(); } if (isOnStartOfLine(resourceAst)) { checkChildIndentation(resourceAst, subType, expectedResourceIndent); checkWrappingIndentation( resourceAst, nextSibling, getIndentCheck().getLineWrappingIndentation(), expectedResourceIndent.getFirstIndentLevel(), true); } else { checkWrappingIndentation(resourceAst, nextSibling); } } resourceAst = resourceAst.getNextSibling(); } }
Source:
<code>public boolean isIpv4InSubnet(String networkAddress, String mask, String <START> candidateAddress) { <END> String netmask = IPv4MaskValidator.getInstance().getOctetNetmask(mask); Ipv4NetworkRange ipv4NetworkRange = ipAddressConverter.createIpv4NetworkRange(networkAddress, netmask); BigInteger ipToTestInt = ipAddressConverter.convertIpAddressToBigInt(candidateAddress); return ipv4NetworkRange.isInRange(ipToTestInt); }</code><technical_language>Please handle candidateAddress null</technical_language>

Target:
public boolean isIpv4InSubnet(String networkAddress, String mask, String candidateAddress) { if (candidateAddress == null) { return true; } String netmask = IPv4MaskValidator.getInstance().getOctetNetmask(mask); Ipv4NetworkRange ipv4NetworkRange = ipAddressConverter.createIpv4NetworkRange(networkAddress, netmask); BigInteger ipToTestInt = ipAddressConverter.convertIpAddressToBigInt(candidateAddress); return ipv4NetworkRange.isInRange(ipToTestInt); }
Source:
<code>protected void gameLoop() throws SlickException { int delta = getDelta(); if (!Display.isVisible() && updateOnlyOnVisible) { try { Thread.sleep(100); } catch (Exception e) } else { try { updateAndRender(delta); } catch (SlickException e) { this.e = e; running = false; return; } } updateFPS(); Display.update(); <START> GL11.glFlush(); <END> if (Display.isCloseRequested()) { if (game.closeRequested()) running = false; } }</code><technical_language>Remove (<LINK_0></technical_language>

Target:
protected void gameLoop() throws SlickException { int delta = getDelta(); if (!Display.isVisible() && updateOnlyOnVisible) { try { Thread.sleep(100); } catch (Exception e) } else { try { updateAndRender(delta); } catch (SlickException e) { this.e = e; running = false; return; } } updateFPS(); Display.update(); if (Display.isCloseRequested()) { if (game.closeRequested()) running = false; } }
Source:
<code>private static ImportDeclaration getProblematicImport(IProblem problem, CompilationUnit cu) { ASTNode coveringNode= new NodeFinder(cu, problem.getSourceStart(), <START> problem.getSourceEnd() - problem.getSourceStart()).getCoveringNode(); <END> if (coveringNode != null) { ASTNode importNode= ASTNodes.getParent(coveringNode, ASTNode.IMPORT_DECLARATION); if (importNode instanceof ImportDeclaration) { return (ImportDeclaration) importNode; } } return null; }</code><technical_language>Check code where: fLength= problem.getSourceEnd() - fOffset + 1; Here, +1 is missing</technical_language>

Target:
private static ImportDeclaration getProblematicImport(IProblem problem, CompilationUnit cu) { ASTNode coveringNode= new NodeFinder(cu, problem.getSourceStart(), problem.getSourceEnd() - problem.getSourceStart() + 1).getCoveringNode(); if (coveringNode != null) { ASTNode importNode= ASTNodes.getParent(coveringNode, ASTNode.IMPORT_DECLARATION); if (importNode instanceof ImportDeclaration) { return (ImportDeclaration) importNode; } } return null; }
Source:
<code>public AutoCloseable scheduleWithFixedDelay(Supplier<CompletionStage<?>> supplier, long initialDelay, long delay, TimeUnit unit) { ReschedulingTask task = new ReschedulingTask(supplier, delay, unit); <START> task.future = scheduler.schedule(task, initialDelay, unit); <END> return task; }</code><technical_language>synchronize? if initialDelay is zero, scheduler run "task" futureis set</technical_language>

Target:
public AutoCloseable scheduleWithFixedDelay(Supplier<CompletionStage<?>> supplier, long initialDelay, long delay, TimeUnit unit) { ReschedulingTask task = new ReschedulingTask(supplier, delay, unit); synchronized (task) { task.future = scheduler.schedule(task, initialDelay, unit); } return task; }
Source:
<code>private List<Values> parseSiteMap(String url, byte[] content, String contentType) { crawlercommons.sitemaps.SiteMapParser parser = new crawlercommons.sitemaps.SiteMapParser( strictMode); AbstractSiteMap siteMap = null; try { siteMap = parser.parseSiteMap(contentType, content, new URL(url)); } catch (Exception e) { LOG.error("Exception while parsing sitemap", e); return null; } List<Values> links = new ArrayList<Values>(); if (siteMap.isIndex()) { SiteMapIndex smi = ((SiteMapIndex) siteMap); Collection<AbstractSiteMap> subsitemaps = smi.getSitemaps(); Iterator<AbstractSiteMap> iter = subsitemaps.iterator(); while (iter.hasNext()) { String s = iter.next().getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "true"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug(url + " : [sitemap] " + s); } } else { SiteMap sm = ((SiteMap) siteMap); Collection<SiteMapURL> sitemapURLs = sm.getSiteMapUrls(); Iterator<SiteMapURL> iter = sitemapURLs.iterator(); while (iter.hasNext()) { SiteMapURL smurl = iter.next(); double priority = smurl.getPriority(); ChangeFrequency freq = smurl.getChangeFrequency(); String s = smurl.getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "false"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); <START> LOG.debug(url + " : [sitemap] " + s); <END> } } return links; }</code><technical_language>{} place holders</technical_language>

Target:
private List<Values> parseSiteMap(String url, byte[] content, String contentType) { crawlercommons.sitemaps.SiteMapParser parser = new crawlercommons.sitemaps.SiteMapParser( strictMode); AbstractSiteMap siteMap = null; try { siteMap = parser.parseSiteMap(contentType, content, new URL(url)); } catch (Exception e) { LOG.error("Exception while parsing sitemap", e); return Collections.emptyList(); } List<Values> links = new ArrayList<Values>(); if (siteMap.isIndex()) { SiteMapIndex smi = ((SiteMapIndex) siteMap); Collection<AbstractSiteMap> subsitemaps = smi.getSitemaps(); Iterator<AbstractSiteMap> iter = subsitemaps.iterator(); while (iter.hasNext()) { String s = iter.next().getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "true"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug("{} : [sitemap] {}", url, s); } } else { SiteMap sm = ((SiteMap) siteMap); Collection<SiteMapURL> sitemapURLs = sm.getSiteMapUrls(); Iterator<SiteMapURL> iter = sitemapURLs.iterator(); while (iter.hasNext()) { SiteMapURL smurl = iter.next(); double priority = smurl.getPriority(); ChangeFrequency freq = smurl.getChangeFrequency(); String s = smurl.getUrl().toExternalForm(); HashMap<String, String[]> metadata = KeyValues.newInstance(); KeyValues.setValue(isSitemapKey, metadata, "false"); Values ol = new Values(s, metadata, Status.DISCOVERED); links.add(ol); LOG.debug("{} : [sitemap] {}", url, s); } } return links; }
Source:
<code>private CqlNameGenerator(NamingConvention namingConvention, TypeMirror converterClassMirror) { <START> Preconditions.checkArgument(namingConvention == null ^ converterClassMirror == null); <END> this.namingConvention = namingConvention; this.converterClassMirror = converterClassMirror; }</code><technical_language>If this check fails converted easy read message? I assuming client meaning of ^ in this part of code if this propagate exception message confused</technical_language>

Target:
private CqlNameGenerator(NamingConvention namingConvention, TypeMirror converterClassMirror) { assert namingConvention == null ^ converterClassMirror == null; this.namingConvention = namingConvention; this.converterClassMirror = converterClassMirror; }
Source:
<code>private static InferredType unionDeclaredType(List<Expression> subscripts, Map<String, Symbol> builtinSymbols) { InferredType first = declaredType(subscripts.get(0), builtinSymbols); for (int i = 1; i < subscripts.size(); i++) { first = InferredTypes.or(first, declaredType(subscripts.get(i), builtinSymbols)); } <START> return first; <END> }</code><technical_language>renaming this variable union unionType, first</technical_language>

Target:
private static InferredType unionDeclaredType(List<Expression> subscripts, Map<String, Symbol> builtinSymbols) { InferredType union = declaredType(subscripts.get(0), builtinSymbols); for (int i = 1; i < subscripts.size(); i++) { union = InferredTypes.or(union, declaredType(subscripts.get(i), builtinSymbols)); } return union; }
Source:
<code>public static Block createRandomStringBlock(int positionCount, float nullRate, int maxStringLength) { verifyNullRate(nullRate); return createStringsBlock( IntStream.range(0, positionCount) <START> .mapToObj(i -> nullRate > 0 && ThreadLocalRandom.current().nextDouble(1) < nullRate ? null : generateRandomStringWithLength(maxStringLength)) <END> .collect(Collectors.toList())); }</code><technical_language>nit: consider extracting this logic a helper class avoid copy-paste ValuesWithNullsGenerator<String> generator = new ValuesWithNullsGenerator(nullRate, () -> generateRandomStringWithLength(maxStringLength)); return createStringsBlock( IntStream.range(0, positionCount) .mapToObj(i -> generator.next()) .collect(Collectors.toList())); private static final class ValuesWithNullsGenerator<T> { private final float nullRate; private final Supplier<T> supplier; private ValuesWithNullsGenerator(float nullRate, Supplier<T> supplier) { checkArgument (nullRate < 0 || nullRate > 1, "nullRate 0 1 inclusive"); this.nullRate = nullRate; this.supplier = requireNonNull(supplier, "supplier is null"); } public T next() { return nullRate > 0 && ThreadLocalRandom.current().nextDouble(1) < nullRate ? null : supplier.get()); } }</technical_language>

Target:
public static Block createRandomStringBlock(int positionCount, float nullRate, int maxStringLength) { ValuesWithNullsGenerator<String> generator = new ValuesWithNullsGenerator(nullRate, () -> generateRandomStringWithLength(maxStringLength)); return createStringsBlock( IntStream.range(0, positionCount) .mapToObj(i -> generator.next()) .collect(Collectors.toList())); }
Source:
<code>public static void forceCleanupBucketsOnBP(final Ds3Client client) throws IOException { final GetBucketsSpectraS3Request request = new GetBucketsSpectraS3Request(); final GetBucketsSpectraS3Response response = client.getBucketsSpectraS3(request); <START> for (Bucket bucket : response.getBucketListResult().getBuckets()) { <END> cancelAllJobsForBucket(client, bucket.getName()); client.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(bucket.getName()).withForce(true)); } }</code><technical_language>Missing final</technical_language>

Target:
public static void forceCleanupBucketsOnBP(final Ds3Client client) throws IOException { final GetBucketsSpectraS3Request request = new GetBucketsSpectraS3Request(); final GetBucketsSpectraS3Response response = client.getBucketsSpectraS3(request); for (final Bucket bucket : response.getBucketListResult().getBuckets()) { cancelAllJobsForBucket(client, bucket.getName()); client.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(bucket.getName()).withForce(true)); } }
Source:
<code>public void beforeClass() { ps = PowerMockito.mock(PatientService.class); pss = PowerMockito.mock(PatientSetService.class); cs = PowerMockito.mock(ConceptService.class); es = PowerMockito.mock(EncounterService.class); PowerMockito.stub(PowerMockito.method(Context.class, "getPatientSetService")).toReturn(pss); PowerMockito.stub(PowerMockito.method(Context.class, "getPatientService")).toReturn(ps); PowerMockito.stub(PowerMockito.method(Context.class, "getConceptService")).toReturn(cs); PowerMockito.stub(PowerMockito.method(Context.class, "getEncounterService")).toReturn(es); <START> PowerMockito.spy(Context.class); <END> PowerMockito.doNothing().when(Context.class); Context.clearSession(); }</code><technical_language>spy here? a context sensitive test Context is properly setup unusable</technical_language>

Target:
public void beforeClass() { ps = mock(PatientService.class); pss = mock(PatientSetService.class); cs = mock(ConceptService.class); es = mock(EncounterService.class); stub(method(Context.class, "getPatientSetService")).toReturn(pss); stub(method(Context.class, "getPatientService")).toReturn(ps); stub(method(Context.class, "getConceptService")).toReturn(cs); stub(method(Context.class, "getEncounterService")).toReturn(es); spy(Context.class); doNothing().when(Context.class); Context.clearSession(); }
Source:
<code>private void deflateJdk11(ByteBuf out) { if (out.isDirect()) { try { int numBytes; do { <START> numBytes = (Integer) DEFLATER_DEFLATE_BYTEBUFFER.invoke(deflater, out.nioBuffer(), <END> Deflater.SYNC_FLUSH); } while (numBytes > 0); } catch (IllegalAccessException e) { throw new Error(e); } catch (InvocationTargetException e) { throw new Error(e); } } else { deflateJdk7(out); } }</code><technical_language>call nioBuffer() once: java ByteBuffer nioBuffer = out.nioBuffer(); int numBytes; do { numBytes = (Integer) DEFLATER_DEFLATE_BYTEBUFFER.invoke(deflater, nioBuffer, Deflater.SYNC_FLUSH); } while (numBytes > 0);</technical_language>

Target:
private void deflateJdk11(ByteBuf out) { if (out.isDirect()) { try { ByteBuffer nioBuffer = out.nioBuffer(); int numBytes; do { numBytes = (Integer) DEFLATER_DEFLATE_BYTEBUFFER.invoke(deflater, nioBuffer, Deflater.SYNC_FLUSH); } while (numBytes > 0); } catch (IllegalAccessException e) { throw new Error(e); } catch (InvocationTargetException e) { throw new Error(e); } } else { deflateJdk7(out); } }
Source:
<code>protected void doRun() throws Exception { ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); long[] deadLocks; try { deadLocks = mbean.findDeadlockedThreads(); } catch (UnsupportedOperationException x) { deadLocks = null; } if (deadLocks != null && deadLocks.length != 0) { File file = logs.file("DeadlockDetected-" + format.format(new Date()) + ".txt"); logs.add(file); PrintWriter builder = new PrintWriter(file,"UTF-8"); try { builder.println("=============="); builder.println("Deadlock Found"); builder.println("=============="); ThreadInfo[] deadLockThreads = mbean.getThreadInfo(deadLocks, Integer.MAX_VALUE); for (ThreadInfo threadInfo : deadLockThreads) { try { <START> ThreadDumps.printThreadInfo(builder, threadInfo, mbean, <END> SupportPlugin.getContentFilter().orElse(null)); } catch (LinkageError e) { builder.println(threadInfo); } } } finally { builder.close(); } } }</code><technical_language>I guess if get filter for loop, valid? avoid loading thread</technical_language>

Target:
protected void doRun() throws Exception { ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); long[] deadLocks; try { deadLocks = mbean.findDeadlockedThreads(); } catch (UnsupportedOperationException x) { deadLocks = null; } if (deadLocks != null && deadLocks.length != 0) { File file = logs.file("DeadlockDetected-" + format.format(new Date()) + ".txt"); logs.add(file); PrintWriter builder = new PrintWriter(file,"UTF-8"); try { builder.println("=============="); builder.println("Deadlock Found"); builder.println("=============="); ThreadInfo[] deadLockThreads = mbean.getThreadInfo(deadLocks, Integer.MAX_VALUE); ContentFilter contentFilter = SupportPlugin.getContentFilter().orElse(null); for (ThreadInfo threadInfo : deadLockThreads) { try { ThreadDumps.printThreadInfo(builder, threadInfo, mbean, contentFilter); } catch (LinkageError e) { builder.println(threadInfo); } } } finally { builder.close(); } } }
Source:
<code>public static MutableAggregate permute(MutableAggregate aggregate, MutableRel input, Mapping mapping) { ImmutableBitSet groupSet = Mappings.apply(mapping, aggregate.groupSet); ImmutableList<ImmutableBitSet> unSortedGroupSets = Mappings.apply2(mapping, aggregate.groupSets); ImmutableList<ImmutableBitSet> groupSets = ImmutableList.copyOf( <START> ImmutableBitSet.ORDERING.sortedCopy(unSortedGroupSets)); <END> List<AggregateCall> aggregateCalls = Util.transform(aggregate.aggCalls, call -> call.transform(mapping)); return MutableAggregate.of(input, groupSet, groupSets, aggregateCalls); }</code><technical_language>incorporate this change Mappings.apply2? is groupSets mapping</technical_language>

Target:
public static MutableAggregate permute(MutableAggregate aggregate, MutableRel input, Mapping mapping) { ImmutableBitSet groupSet = Mappings.apply(mapping, aggregate.groupSet); ImmutableList<ImmutableBitSet> groupSets = Mappings.apply2(mapping, aggregate.groupSets); List<AggregateCall> aggregateCalls = Util.transform(aggregate.aggCalls, call -> call.transform(mapping)); return MutableAggregate.of(input, groupSet, groupSets, aggregateCalls); }
Source:
<code>private void deleteContent( final ArtifactStore store ) throws IndyWorkflowException { <START> List<Transfer> contents = downloadManager.listRecursively( store.getKey(), DownloadManager.ROOT_PATH ); <END> Set<String> pending = contents.stream().map( Transfer::getPath ).collect( Collectors.toSet() ); for ( String path : pending ) { contentManager.delete( store, path, new EventMetadata().set( IGNORE_READONLY, Boolean.TRUE ) ); } }</code><technical_language>able contentManager.delete(store, DownloadManager.ROOT_PATH, ...) I believe</technical_language>

Target:
private void deleteContent( final ArtifactStore store ) throws IndyWorkflowException { downloadManager.delete( store, ROOT_PATH, new EventMetadata().set( IGNORE_READONLY, Boolean.TRUE ) ); }
Source:
<code>public void handleSynchronizeTimeResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.debug("handleSynchronizeTimeResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } <START> this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() <END> .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handleSynchronizeTimeResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.debug("handleSynchronizeTimeResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
<code>public void requestTaskReconfiguration() { <START> synchronized (this) { <END> if (closed) { throw new ConnectException(String.format( "The request for task reconfiguration has been rejected because this instance of " + "the connector '%s' has already been shut down.", connectorName )); } } herder.requestTaskReconfiguration(connectorName); }</code><technical_language>locking if variable is volatile change true lifetime of this object</technical_language>

Target:
public void requestTaskReconfiguration() { if (closed) { throw new ConnectException("The request for task reconfiguration has been rejected " + "because this instance of the connector '" + connectorName + "' has already " + "been shut down."); } herder.requestTaskReconfiguration(connectorName); }
Source:
<code>public void visitFunctionExpression(FunctionExpressionTree tree) { LexicalVariablesTree lexicalVars = tree.lexicalVars(); if (tree == currentFunction) { if (lexicalVars != null) { lexicalVars.variables().stream() .map(VariableTree::variableExpression) .filter(variable -> variable.is(Kind.VARIABLE_IDENTIFIER)) <START> .map(variable -> ((VariableIdentifierTree) variable).text().toLowerCase(Locale.ROOT)) <END> .forEach(initializedVariables::add); } super.visitFunctionExpression(tree); } else { if (lexicalVars != null) { scan(lexicalVars.variables()); } } }</code><technical_language>I transform name of variable. Variable names case-sensitive</technical_language>

Target:
public void visitFunctionExpression(FunctionExpressionTree tree) { LexicalVariablesTree lexicalVars = tree.lexicalVars(); if (tree == currentFunction) { if (lexicalVars != null) { lexicalVars.variables().stream() .map(VariableTree::variableExpression) .filter(variable -> variable.is(Kind.VARIABLE_IDENTIFIER)) .map(variable -> ((VariableIdentifierTree) variable).text()) .forEach(initializedVariables::add); } super.visitFunctionExpression(tree); } else { if (lexicalVars != null) { scan(lexicalVars.variables()); } } }
Source:
<code>public void check(String title) throws RemoteException { Selector nodeSelector = new Selector("span[title=\"" + title + "\"]"); <START> browser.run(nodeSelector.getStatement() + ".click();"); <END> }</code><technical_language>is this click operation direct statement instead of "[0].click();"</technical_language>

Target:
public void check(String title) throws RemoteException { if (isChecked(title) == false) { Selector nodeSelector = new Selector("span[title=\"" + title + "\"]"); browser.run(String.format("%s[0].click();", nodeSelector.getStatement())); } }
Source:
<code>public <T extends Action> T getAction(Class<T> type) { <START> for (Action a : getActions()) { <END> if (type.isInstance(a)) { return type.cast(a); } } for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass())) { for (Action a : createFor(taf)) { if (type.isInstance(a)) { return type.cast(a); } } } return null; }</code><technical_language>I this is deliver large benefits</technical_language>

Target:
public <T extends Action> T getAction(Class<T> type) { for (Action a : getActions()) { if (type.isInstance(a)) { return type.cast(a); } } for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), type)) { for (Action a : createFor(taf)) { if (type.isInstance(a)) { return type.cast(a); } } } return null; }
Source:
<code>public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); String fedoraUri = (String) in.getHeader(FCREPO_URI); String binaryPath = (String) in.getHeader(CdrBinaryPath); String binaryId = PIDs.get(fedoraUri).getId(); String binarySubPath = idToPath(binaryId, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); String text; try { text = extractText(binaryPath); } catch (TikaException e) { log.error("Failed to extract text for due to parsing error", fedoraUri, e); return; } Path derivativePath = Paths.get(derivativeBasePath, binarySubPath, binaryId + ".txt"); File derivative = derivativePath.toFile(); File parentDir = derivative.getParentFile(); if (parentDir != null) { try { Files.createDirectories(parentDir.toPath()); } catch (Exception e) { <START> log.error(e.getMessage()); <END> throw new IOException("Failed to create parent directories for " + derivativePath); } FileUtils.write(derivative, text, UTF_8); } }</code><technical_language>For this block, I receive other IOException, change catch that. Also, good add exception of exception end throwing. need this log statement. If feel is useful though, good add a more info it, PID of object failed was, path of file. This covered exception though, end in logs</technical_language>

Target:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); String fedoraUri = (String) in.getHeader(FCREPO_URI); String binaryPath = (String) in.getHeader(CdrBinaryPath); String binaryId = PIDs.get(fedoraUri).getId(); String binarySubPath = idToPath(binaryId, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); String text; try { text = extractText(binaryPath); } catch (TikaException e) { log.error("Failed to extract text for due to parsing error", fedoraUri, e); return; } Path derivativePath = Paths.get(derivativeBasePath, binarySubPath, binaryId + ".txt"); File derivative = derivativePath.toFile(); File parentDir = derivative.getParentFile(); if (parentDir != null) { try { Files.createDirectories(parentDir.toPath()); } catch (IOException e) { throw new IOException("Failed to create parent directories for " + derivativePath + ".", e); } FileUtils.write(derivative, text, UTF_8); } }
Source:
<code>private void processServerError(ServerErrorCode error) { <START> setChunkException(new RouterException("Operation timed out", RouterErrorCode.AmbryUnavailable)); <END> }</code><technical_language>careful this. 'RouterErrorCode' is rich mapped ServerErrorCode. For example, RouterErrorCode.InsufficientCapacity more if backend store enough capacity</technical_language>

Target:
private void processServerError(ServerErrorCode error) { setChunkException(new RouterException("Could not complete operation, server returned: " + error, RouterErrorCode.AmbryUnavailable)); }
Source:
<code>public String toString() { <START> List<String> keys = new ArrayList<>( params.keySet() ); <END> Collections.sort( keys ); LinkedHashMap<String,String> output = new LinkedHashMap<>(); for ( String key : keys ) { output.put( key, params.get( key ) ); } return output.toString(); }</code><technical_language>this done simpler a sorted stream of param entries produce output string</technical_language>

Target:
public String toString() { return params.entrySet().stream() .sorted( Comparator.comparing( Map.Entry::getKey ) ) .map( entry -> entry.getKey() + "=" + entry.getValue() ) .collect( Collectors.joining( ", ") ); }
Source:
<code><START> default public void prompt( String prompt ) { <END> print(prompt); }</code><technical_language>[docs: default methods](<LINK_0> method declarations in interface, including default methods, implicitly public, omit public modifier</technical_language>

Target:
default void prompt( String prompt ) { print(prompt); }
Source:
<code><START> private CompletionStage<List<KeyIterable<ShardId, Row>>> tryFetchMore(ShardId shardId) { <END> if (allExhausted()) { return CompletableFuture.failedFuture(new IllegalStateException("Cannot fetch more if source is exhausted")); } if (shardId == null) { return CompletableFutures.asKillable( ThreadPools.runWithAvailableThreads( executor, availableThreads, Lists2.map(orderedDocCollectors, Function.identity())), this::kill); } else { return loadFrom(collectorsByShardId.get(shardId)); } }</code><technical_language>I return new KillableCompletableFuture. call-site this implement Killable, is common. changing interface return CompletionStage I referring loadNextBatch, a dedicated PR, involved all</technical_language>

Target:
private KillableCompletionStage<List<KeyIterable<ShardId, Row>>> tryFetchMore(ShardId shardId) { if (allExhausted()) { return KillableCompletionStage.whenKilled( CompletableFuture.failedFuture(new IllegalStateException("Cannot fetch more if source is exhausted")), t -> { }); } CompletionStage<List<KeyIterable<ShardId, Row>>> stage; if (shardId == null) { stage = ThreadPools.runWithAvailableThreads( executor, availableThreads, Lists2.map(orderedDocCollectors, Function.identity())); } else { stage = loadFrom(collectorsByShardId.get(shardId)); } return KillableCompletionStage.whenKilled(stage, this::kill); }
Source:
<code>public List<Attachment> getAttachments(Collection<AttachmentId> attachmentIds) { Preconditions.checkArgument(attachmentIds != null); <START> return ImmutableList.<Attachment>builder().addAll( <END> attachmentIds.stream().distinct() .map(attachmentId -> getEntityManager().find(JPAAttachment.class, attachmentId.getId())) .filter(Objects::nonNull) .map(jpaAttachment -> jpaAttachment.toAttachment()) .collect(Collectors.toList()) ).build(); }</code><technical_language>attachmentIds.stream().map()....collect(Guavate.toImmutableList()) produce immutable list. builder</technical_language>

Target:
public List<Attachment> getAttachments(Collection<AttachmentId> attachmentIds) { Preconditions.checkArgument(attachmentIds != null, "AttachmentId collection can't be null when trying to get attachments!"); return attachmentIds.stream().distinct() .map(attachmentId -> getEntityManager().find(JPAAttachment.class, attachmentId.getId())) .filter(Objects::nonNull) .map(jpaAttachment -> jpaAttachment.toAttachment()) .collect(Guavate.toImmutableList()); }
Source:
<code><START> public void wrongLastViewedTest() throws InterruptedException { <END> String title = TestController.getUI().getTitle(); assertEquals("test2/test2 (none)", title); }</code><technical_language>unnecessary(?) throws InterruptedException declaration</technical_language>

Target:
public void wrongLastViewedTest() { String title = TestController.getUI().getTitle(); assertEquals("test2/test2 (none)", title); }
Source:
<code>public FormValidation doCheckExtraHostsString(@QueryParameter String extraHostsString) { final List<String> extraHosts = splitAndFilterEmptyList(extraHostsString, "\n"); for (String extraHost : extraHosts) { <START> if (extraHost.split(":").length != 2) { <END> return FormValidation.error("Wrong extraHost {}", extraHost); } } return FormValidation.ok(); }</code><technical_language>split(":", 2) for correct ipv6 handling</technical_language>

Target:
public FormValidation doCheckExtraHostsString(@QueryParameter String extraHostsString) { final List<String> extraHosts = splitAndFilterEmptyList(extraHostsString, "\n"); for (String extraHost : extraHosts) { if (extraHost.trim().split(":").length < 2) { return FormValidation.error("Wrong extraHost {}", extraHost); } } return FormValidation.ok(); }
Source:
<code>private EchoRequest buildRequest(Integer messageSize) { final EchoRequest request = new EchoRequest(); request.setId(System.currentTimeMillis()); String message = Strings.repeat("*", messageSize); <START> if(messageSize > MAX_BUFFER_SIZE) { <END> request.setBody(message); } else { request.setMessage(message); } request.setLocation(location); request.setSystemId(systemId); request.setTimeToLiveMs(ttlInMs); request.setDelay(delay); request.shouldThrow(shouldThrow); return request; }</code><technical_language>body instead of flipping based payload size</technical_language>

Target:
private EchoRequest buildRequest(Integer messageSize) { final EchoRequest request = new EchoRequest(); request.setId(System.currentTimeMillis()); String message = Strings.repeat("*", messageSize); request.setBody(message); request.setLocation(location); request.setSystemId(systemId); request.setTimeToLiveMs(ttlInMs); request.setDelay(delay); request.shouldThrow(shouldThrow); return request; }
Source:
<code><START> public boolean anyLife() { <END> ArrayList<Player> players = Model.getPlayers(); boolean alive = false; for (Player player : players) { if (player.isAlive()) { alive = true; } } return alive; }</code><technical_language>Instead of a boolean, assigning alive = true immediately return true. Return false line. for (Player player : Model.getPlayers() { if (player.isAlive()) { return true; } } return false;</technical_language>

Target:
public boolean anyLife() { for (Player player : Model.getPlayers()) { if (player.isAlive()) { return true; } } return false; }
Source:
<code>public String toString() { return "IotasProcessor{" + <START> "declaredOutputStreams=" + outputStreams + <END> '}'+super.toString(); }</code><technical_language>minor: regenerate toString reflect renamed variables</technical_language>

Target:
public String toString() { return "IotasProcessor{" + "outputStreams=" + outputStreams + '}'+super.toString(); }
Source:
<code>public void recordingTestThatShouldHaveCorrectDuration() throws IOException { final String flvFileTitle = "ChromeThatRecordsAllTests-recordingTestThatShouldBeRecordedAndRetained"; final String flvFileNameRegEx = "PASSED-" + flvFileTitle + ".*\\.flv"; try ( BrowserWebDriverContainer chrome = new BrowserWebDriverContainer() .withCapabilities(new ChromeOptions()) .withRecordingMode(RECORD_ALL, vncRecordingDirectory.getRoot()) .withRecordingFileFactory(new DefaultRecordingFileFactory()) ) { chrome.start(); doSimpleExplore(chrome); chrome.afterTest(new TestDescription() { @Override public String getTestId() { return getFilesystemFriendlyName(); } @Override public String getFilesystemFriendlyName() { return flvFileTitle; } }, Optional.empty()); String recordedFile = vncRecordingDirectory.getRoot().listFiles(new PatternFilenameFilter(flvFileNameRegEx))[0].getCanonicalPath(); ToStringConsumer dockerLogConsumer = new ToStringConsumer(); try( GenericContainer container = new GenericContainer<>("jrottenberg/ffmpeg:3.2-alpine38") ) { container.withStartupCheckStrategy(new OneShotStartupCheckStrategy()) <START> .withFileSystemBind(recordedFile, "/tmp/chromeTestRecord.flv", BindMode.READ_WRITE ) <END> .withCommand("-i" ,"/tmp/chromeTestRecord.flv") .withLogConsumer(dockerLogConsumer) .start(); } catch (RuntimeException ex) { } String dockerOutput = dockerLogConsumer.toUtf8String(); assertTrue("Duration is incorrect: ", dockerOutput.matches("[\\S\\s]*Duration: (?!00:00:00.00)[\\S\\s]*")); } }</code><technical_language>This line problematic in CI environments. copyFiletoContainer safer method</technical_language>

Target:
public void recordingTestThatShouldHaveCorrectDuration() throws IOException, InterruptedException { MountableFile mountableFile; try ( BrowserWebDriverContainer<?> chrome = new BrowserWebDriverContainer<>() .withCapabilities(new ChromeOptions()) .withRecordingMode(RECORD_ALL, vncRecordingDirectory.getRoot()) .withRecordingFileFactory(new DefaultRecordingFileFactory()) .withNetwork(NETWORK) ) { File[] recordedFiles = runSimpleExploreInContainer(chrome, "PASSED-.*\\.flv"); mountableFile = MountableFile.forHostPath(recordedFiles[0].getCanonicalPath()); } try( GenericContainer<?> container = new GenericContainer<>(DockerImageName.parse("testcontainers/vnc-recorder:1.2.0")) ) { String recordFileContainerPath = "/tmp/chromeTestRecord.flv"; container.withCopyFileToContainer(mountableFile, recordFileContainerPath) .withCreateContainerCmdModifier( createContainerCmd -> createContainerCmd.withEntrypoint("ffmpeg") ) .withCommand("-i" , recordFileContainerPath, "-f" ,"null" ,"-" ) .waitingFor( new LogMessageWaitStrategy() .withRegEx(".*Duration.*") .withStartupTimeout(Duration.of(60, SECONDS)) ) .start(); String ffmpegOutput = container.getLogs(); assertTrue("Duration is incorrect in:\n " + ffmpegOutput, ffmpegOutput.contains("Duration: 00:") && !(ffmpegOutput.contains("Duration: 00:00:00.00"))); } }
Source:
<code>private Map<InputFile, CoverageMeasuresBuilder> parse(List<String> lines) { final Map<InputFile, FileData> files = Maps.newHashMap(); FileData fileData = null; for (String line : lines) { if (line.startsWith(SF)) { fileData = loadCurrentFileData(files, line); } else if (fileData != null) { if (line.startsWith(DA)) { String execution = line.substring(DA.length()); String executionCount = execution.substring(execution.indexOf(',') + 1); String lineNumber = execution.substring(0, execution.indexOf(',')); try { fileData.addLine(Integer.valueOf(lineNumber), Integer.valueOf(executionCount)); } catch (IllegalArgumentException e) { <START> LOG.warn("Can't save DA data. Cause: " + e.getMessage(), e); <END> } } else if (line.startsWith(BRDA)) { String[] tokens = line.substring(BRDA.length()).trim().split(","); String lineNumber = tokens[0]; String branchNumber = tokens[1] + tokens[2]; String taken = tokens[3]; try { fileData.addBranch(Integer.valueOf(lineNumber), branchNumber, "-".equals(taken) ? 0 : Integer.valueOf(taken)); } catch (IllegalArgumentException e) { LOG.warn("Can't save BRDA data. Cause: " + e.getMessage(), e); } } } } Map<InputFile, CoverageMeasuresBuilder> coveredFiles = Maps.newHashMap(); for (Map.Entry<InputFile, FileData> e : files.entrySet()) { coveredFiles.put(e.getKey(), e.getValue().convert()); } return coveredFiles; }</code><technical_language>@vilchik-elena I message mention this is a coverage report ideally give line number. Minor: avoid duplication of message of (if log cause, concatenate message?)</technical_language>

Target:
private Map<InputFile, CoverageMeasuresBuilder> parse(List<String> lines) { final String errorMessage = "Problem during processing LCOV report: can't save %s data for line %s."; final Map<InputFile, FileData> files = Maps.newHashMap(); FileData fileData = null; for (String line : lines) { if (line.startsWith(SF)) { fileData = loadCurrentFileData(files, line); } else if (fileData != null) { if (line.startsWith(DA)) { String execution = line.substring(DA.length()); String executionCount = execution.substring(execution.indexOf(',') + 1); String lineNumber = execution.substring(0, execution.indexOf(',')); try { fileData.addLine(Integer.valueOf(lineNumber), Integer.valueOf(executionCount)); } catch (IllegalArgumentException e) { LOG.warn(String.format(errorMessage, "DA", lineNumber), e); } } else if (line.startsWith(BRDA)) { String[] tokens = line.substring(BRDA.length()).trim().split(","); String lineNumber = tokens[0]; String branchNumber = tokens[1] + tokens[2]; String taken = tokens[3]; try { fileData.addBranch(Integer.valueOf(lineNumber), branchNumber, "-".equals(taken) ? 0 : Integer.valueOf(taken)); } catch (IllegalArgumentException e) { LOG.warn(String.format(errorMessage, "BRDA", lineNumber), e); } } } } Map<InputFile, CoverageMeasuresBuilder> coveredFiles = Maps.newHashMap(); for (Map.Entry<InputFile, FileData> e : files.entrySet()) { coveredFiles.put(e.getKey(), e.getValue().convert()); } return coveredFiles; }
Source:
<code>public boolean equals(Object obj) { if (!(obj instanceof GlusterServerInfo)) { return false; } GlusterServerInfo host = (GlusterServerInfo) obj; <START> return (getUuid().equals(host.getUuid()) <END> && (GlusterCoreUtil.objectsEqual(hostName, host.getHostName())) && (GlusterCoreUtil.objectsEqual(status, host.getStatus()))); }</code><technical_language>here. throw NullPointerException if uuid is null</technical_language>

Target:
public boolean equals(Object obj) { if (!(obj instanceof GlusterServerInfo)) { return false; } GlusterServerInfo host = (GlusterServerInfo) obj; return (GlusterCoreUtil.objectsEqual(getUuid(), host.getUuid()) && (GlusterCoreUtil.objectsEqual(getHostName(), host.getHostName())) && (GlusterCoreUtil.objectsEqual(getStatus(), host.getStatus()))); }
Source:
<code>public void stop() { if (started.compareAndSet(true, false)) { if (scheduler != null) { Utils.shutDownExecutorService(scheduler, config.nettyMetricsStopWaitTimeoutSeconds, TimeUnit.SECONDS); <START> logger.trace("De-scheduled for collecting netty metrics"); <END> } } }</code><technical_language>INFO level</technical_language>

Target:
public void stop() { if (started.compareAndSet(true, false)) { if (scheduler != null) { Utils.shutDownExecutorService(scheduler, config.nettyMetricsStopWaitTimeoutSeconds, TimeUnit.SECONDS); logger.info("De-scheduled for collecting netty metrics"); } } }
Source:
<code>public void render(Context context, GlusterVolumeEntity volume, SafeHtmlBuilder sb) { int brickCount = volume.getBricks().size(); if (volume == null) { return; } int count = 0; GlusterStatus status = volume.getStatus(); ImageResource statusImage = null; String tooltip; switch (status) { case DOWN: statusImage = resources.downImage(); tooltip = constants.down(); break; case UP: count = countDownBricks(volume); if((count < brickCount) && (count != 0)) { statusImage = resources.volumeUpWarning(); tooltip = constants.volumeBricksDown(); } else if(count == 0){ statusImage = resources.upImage(); tooltip = constants.up(); } else { statusImage = resources.volumeUpWarning(); tooltip = constants.allBricksDown(); <START> } <END> break; default: statusImage = resources.downImage(); tooltip = constants.down(); } ImageResource alertImage = resources.alertImage(); SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); SafeHtml alertImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(alertImage).getHTML()); sb.appendHtmlConstant("<div>"); if(count == brickCount) { sb.append(applicationTemplates.statusWithAlertTemplate(statusImageHtml, alertImageHtml, tooltip)); } else { sb.append(applicationTemplates.statusTemplate(statusImageHtml, tooltip)); } sb.appendHtmlConstant("</div>"); }</code><technical_language>cases</technical_language>

Target:
public void render(Context context, GlusterVolumeEntity volume, SafeHtmlBuilder sb) { int brickCount = volume.getBricks().size(); if (volume == null) { return; } int count = 0; GlusterStatus status = volume.getStatus(); ImageResource statusImage = null; String tooltip; switch (status) { case DOWN: statusImage = resources.downImage(); tooltip = constants.down(); break; case UP: count = countDownBricks(volume); if(count == 0){ statusImage = resources.upImage(); tooltip = constants.up(); }else { statusImage = resources.volumeUpWarning(); if(count < brickCount) { tooltip = constants.volumeBricksDown(); } else { tooltip = constants.allBricksDown(); } } break; default: statusImage = resources.downImage(); tooltip = constants.down(); } ImageResource alertImage = resources.alertImage(); SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); SafeHtml alertImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(alertImage).getHTML()); if(count == brickCount) { sb.append(applicationTemplates.statusWithAlertTemplate(statusImageHtml, alertImageHtml, tooltip)); } else { sb.append(applicationTemplates.statusTemplate(statusImageHtml, tooltip)); } }
Source:
<code>public void reportErrors(Collection<ConstraintCheckIssue> errors) { <START> errors.forEach( this::reportError ); <END> }</code><technical_language>is a Java 8 construct left</technical_language>

Target:
public void reportErrors(Collection<ConstraintCheckIssue> errors) { for ( ConstraintCheckIssue error : errors ) { reportError( error ); } }
Source:
<code>public void registerListenerAndConnect(final Consumer<ServerMessageEnvelope> messageListener) { this.messageListener = messageListener; client .connect(this, errorHandler) .exceptionally( throwable -> { log.log( Level.SEVERE, "Unexpected exception completing websocket connection", throwable); <START> return null; <END> }); }</code><technical_language>This block is notable error handling is pretty screwed with. error handler passed connect function, choose custom error handling this out layer. call connect care of exceptionally case invoke error handler. As-is, error-handler is a violation of DRY (expressing idea in multiple places) arguably SRP</technical_language>

Target:
public void registerListenerAndConnect(final Consumer<ServerMessageEnvelope> messageListener) { this.messageListener = messageListener; client.connect(this, errorHandler); }
Source:
<code>public boolean isRunning() { synchronized (this.directReplyToContainers) { if (this.directReplyToContainers.size() > 0) { <START> for (DirectReplyToMessageListenerContainer container : this.directReplyToContainers.values()) { <END> if (container.isRunning()) { return true; } } } } return false; }</code><technical_language>similar Streams well: public boolean isRunning() { synchronized (this.directReplyToContainers) { return this.directReplyToContainers.values() .stream() .anyMatch(AbstractMessageListenerContainer::isRunning); } }</technical_language>

Target:
public boolean isRunning() { synchronized (this.directReplyToContainers) { synchronized (this.directReplyToContainers) { return this.directReplyToContainers.values() .stream() .anyMatch(AbstractMessageListenerContainer::isRunning); } } }