auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void addHostAndPortToConstructor(Element element, BeanDefinitionBuilder builder, ParserContext parserContext) { String host = element.getAttribute(IpAdapterParserUtils.HOST); String socketExpression = element.getAttribute(IpAdapterParserUtils.SOCKET_EXPRESSION); if (!StringUtils.hasText(host) && StringUtils.isEmpty(socketExpression)) { parserContext.getReaderContext().error(IpAdapterParserUtils.HOST + " is required for IP outbound channel adapters", element); } builder.addConstructorArgValue(host); String port = IpAdapterParserUtils.getPort(element, parserContext); if (StringUtils.isEmpty(port)) { <START> port = "0"; <END> } builder.addConstructorArgValue(port); }</code><technical_language>this closely, host/port socketExpression mutually exclusive. So, introduce more constructors UnicastSendingMessageHandler hide a 0 port logic there. WDYT</technical_language>

Target:
private static void addHostAndPortToConstructor(Element element, BeanDefinitionBuilder builder, ParserContext parserContext) { String host = element.getAttribute(IpAdapterParserUtils.HOST); if (!StringUtils.hasText(host)) { parserContext.getReaderContext().error(IpAdapterParserUtils.HOST + " is required for IP outbound channel adapters", element); } builder.addConstructorArgValue(host); String port = IpAdapterParserUtils.getPort(element, parserContext); builder.addConstructorArgValue(port); }
Source:
<code>public static JSONObject addForwardReverse(Collection col) throws ConfirmModSchemaException { String name = "Basic (and reversed card)"; Models mm = col.getModels(); <START> JSONObject m = newBasicModel(col); <END> try { m.put("name", name); JSONObject t = mm.newTemplate("Card 2"); t.put("qfmt", "{{Back}}"); t.put("afmt", "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}"); mm.addTemplate(m, t); } catch (JSONException e) { throw new RuntimeException(e); } return m; }</code><technical_language>forgetting call col.getModels().add(m); end of function</technical_language>

Target:
public static JSONObject addForwardReverse(Collection col) { String name = "Basic (and reversed card)"; Models mm = col.getModels(); JSONObject m = _newBasicModel(col); try { m.put("name", name); JSONObject t = mm.newTemplate("Card 2"); t.put("qfmt", "{{Back}}"); t.put("afmt", "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}"); mm.addTemplateInNewModel(m, t); mm.add(m); } catch (JSONException e) { throw new RuntimeException(e); } return m; }
Source:
<code>private static Configuration getPythonConfiguration(CommandLine line) { try { Class<?> clazz = Class.forName( "org.apache.flink.python.util.PythonDependencyUtils", true, Thread.currentThread().getContextClassLoader()); Method parsePythonDependencyConfiguration = clazz.getMethod("parsePythonDependencyConfiguration", CommandLine.class); return (Configuration) parsePythonDependencyConfiguration.invoke(null, line); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { <START> throw new SqlClientException("Parse the Python command line options failed.", e); <END> } }</code><technical_language>Change Failed parse Python command line options</technical_language>

Target:
private static Configuration getPythonConfiguration(CommandLine line) { try { Class<?> clazz = Class.forName( "org.apache.flink.python.util.PythonDependencyUtils", true, Thread.currentThread().getContextClassLoader()); Method parsePythonDependencyConfiguration = clazz.getMethod("parsePythonDependencyConfiguration", CommandLine.class); return (Configuration) parsePythonDependencyConfiguration.invoke(null, line); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new SqlClientException("Failed to parse the Python command line options.", e); } }
Source:
<code>public void shouldAuthoriseSuccessfullyWithNoAddressInRequest() { setUpAndCheckThatEpdqIsUp(); PaymentProvider paymentProvider = getEpdqPaymentProvider(); AuthorisationGatewayRequest request = buildAuthorisationRequest(chargeEntity); <START> request.getAuthCardDetails().setAddress(null); <END> GatewayResponse<EpdqAuthorisationResponse> response = paymentProvider.authorise(request); assertThat(response.isSuccessful(), is(true)); }</code><technical_language>a bit nicer a buildAuthorisationRequestWithoutAddress(ChargeEntity) method instead</technical_language>

Target:
public void shouldAuthoriseSuccessfullyWithNoAddressInRequest() { setUpAndCheckThatEpdqIsUp(); AuthorisationGatewayRequest request = buildAuthorisationRequest(chargeEntity); request.getAuthCardDetails().setAddress(null); GatewayResponse<EpdqAuthorisationResponse> response = paymentProvider.authorise(request); assertThat(response.isSuccessful(), is(true)); }
Source:
<code>public static void afterClass() throws IOException, TimeoutException, InterruptedException { try { <START> operations.writeAttribute(WEBSERVICES_ADDRESS, STATISTICS_ENABLED, originalStatisticsEnabledValue); <END> administration.restartIfRequired(); administration.reloadIfRequired(); } finally { IOUtils.closeQuietly(client); } }</code><technical_language>I handling original value. This is more probable backup/restore case actual reading of attribute fail. instead of error failed connect hidden</technical_language>

Target:
public static void afterClass() throws IOException, TimeoutException, InterruptedException { try { DEPLOYMENT_FILE.delete(); if (originalStatisticsEnabledValue != null) { operations.writeAttribute(WEBSERVICES_ADDRESS, STATISTICS_ENABLED, originalStatisticsEnabledValue); } administration.restartIfRequired(); administration.reloadIfRequired(); } finally { IOUtils.closeQuietly(client); } }
Source:
<code><START> public AssetReportCreateRequest withEmail(String email) { <END> notNull(email, "email"); options = options.orElse(new Options()); options.get().user = options.get().user.orElse(new Options.UserOptions()); options.get().user.get().clientUserId = email; return this; }</code><technical_language>differneces in 7 methods for parameter notNull? if extract a method</technical_language>

Target:
public AssetReportCreateRequest withEmail(String email) { notNull(email, "email"); options = options.orElse(new Options()); options.get().user = options.get().user.orElse(new Options.UserOptions()); options.get().user.get().email = email; return this; }
Source:
<code>protected boolean set(MapInfo mapInfo, Vector2i value) { MapData mapData = (MapData)mapInfo; <START> mapData.calculateMapCenter(value.getX(), value.getX(), mapData.scale); <END> mapData.markDirty(); return true; }</code><technical_language>parameter value.getY()</technical_language>

Target:
protected boolean set(MapInfo mapInfo, Vector2i value) { MapData mapData = (MapData) mapInfo; mapData.calculateMapCenter(value.getX(), value.getY(), mapData.scale); mapData.markDirty(); return true; }
Source:
<code><START> protected List<VdcReturnValueBase> executeChildCommands() { <END> List<VdcReturnValueBase> results = new ArrayList<>(); for (CommandBase<?> command : childCommandsMap.values()) { results.add(getBackendCommandObjectsHandler().runAction(command, getExecutionContext())); } return results; }</code><technical_language>Code reuse - this call executeChildCommand()</technical_language>

Target:
protected List<VdcReturnValueBase> executeChildCommands() { List<VdcReturnValueBase> results = new ArrayList<>(childCommandsMap.size()); for (Entry<Guid, CommandBase<?>> entry : childCommandsMap.entrySet()) { results.add(executeChildCommand(entry.getKey())); } return results; }
Source:
<code><START> public synchronized void waitOnClosingSources() { <END> boolean locked = false; try { locked = m_allowCatalogUpdate.tryAcquire(1, UPDATE_CORE_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (!locked && !m_dataSourcesClosing.isEmpty()) { exportLog.warn("After " + UPDATE_CORE_TIMEOUT_SECONDS + " seconds, these export streams are still closing: " + m_dataSourcesClosing.keySet()); } } catch (Exception ex) { if (!m_dataSourcesClosing.isEmpty()) { exportLog.warn("Unable to wait: " + ex + ", these export streams are still closing: " + m_dataSourcesClosing.keySet()); } } finally { if (locked) { m_allowCatalogUpdate.release(); } } }</code><technical_language>a cleaner caller pass in timeout if want change change caller timeouts for callers</technical_language>

Target:
public void waitOnClosingSources() { boolean locked = false; try { locked = m_allowCatalogUpdate.tryAcquire(UPDATE_CORE_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (!locked && !m_dataSourcesClosing.isEmpty()) { exportLog.warn("After " + UPDATE_CORE_TIMEOUT_SECONDS + " seconds, these export streams are still closing: " + m_dataSourcesClosing.keySet()); } } catch (Exception ex) { if (!m_dataSourcesClosing.isEmpty()) { exportLog.warn("Unable to wait: " + ex + ", these export streams are still closing: " + m_dataSourcesClosing.keySet()); } } finally { if (locked) { m_allowCatalogUpdate.release(); } } }
Source:
<code>protected <T> void executeAndStream( DockerHttpClient.Request request, ResultCallback<T> callback, Consumer<DockerHttpClient.Response> sourceConsumer ) { CountDownLatch onStart = new CountDownLatch(1); Thread thread = new Thread(() -> { Thread streamingThread = Thread.currentThread(); try (DockerHttpClient.Response response = execute(request)) { onStart.countDown(); callback.onStart(() -> { streamingThread.interrupt(); response.close(); }); sourceConsumer.accept(response); callback.onComplete(); } catch (Exception e) { callback.onError(e); } finally { onStart.countDown(); } }, "docker-java-stream-" + Objects.hashCode(request)); thread.setDaemon(true); thread.start(); try { <START> onStart.await(); <END> } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }</code><technical_language>callback's onStart detect started operation. Blocking is unexpected behaviour change</technical_language>

Target:
protected <T> void executeAndStream( DockerHttpClient.Request request, ResultCallback<T> callback, Consumer<DockerHttpClient.Response> sourceConsumer ) { Thread thread = new Thread(() -> { Thread streamingThread = Thread.currentThread(); try (DockerHttpClient.Response response = execute(request)) { callback.onStart(() -> { streamingThread.interrupt(); response.close(); }); sourceConsumer.accept(response); callback.onComplete(); } catch (Exception e) { callback.onError(e); } }, "docker-java-stream-" + Objects.hashCode(request)); thread.setDaemon(true); thread.start(); }
Source:
<code>public int findIndex(List<WorldSetupWrapper> worldsList,String worldName) { for(int i = 0 ;i<worldsList.size();i++) { <START> WorldSetupWrapper random = worldsList.get(i); <END> Name customName= random.getWorldName(); if(customName.toString().equals(worldName)) { return i; } } return -1; }</code><technical_language>variable name random please - is random anyway? is specific world in location in list processed for</technical_language>

Target:
public int findIndex(List<WorldSetupWrapper> worldsList, String worldName) { for (int i = 0; i < worldsList.size(); i++) { WorldSetupWrapper currentWorldFromList = worldsList.get(i); Name customName = currentWorldFromList.getWorldName(); if (customName.toString().equals(worldName)) { return i; } } return -1; }
Source:
<code>public void doubleClick(DoubleClickEvent event) { <START> final IStructuredSelection structuredSelection = (IStructuredSelection)event.getSelection(); <END> if (structuredSelection == null || structuredSelection.isEmpty()) { return; } final Object selection = structuredSelection.getFirstElement(); final ITreeContentProvider provider = (ITreeContentProvider)treeViewer.getContentProvider(); if (provider.hasChildren(selection)) { if (treeViewer.getExpandedState(selection)) { treeViewer.collapseToLevel(selection, AbstractTreeViewer.ALL_LEVELS); } else { treeViewer.expandToLevel(selection, 1); } } else { NodeSelection nodeSelection = NodeSelection.from(this.treeViewer.getSelection()); if (isEnabledFor(nodeSelection)) { run(); } } }</code><technical_language>NodeSelection here: NodeSelection nodeSelection = NodeSelection.from(this.treeViewer.getSelection()); if (nodeSelection.isSingleSelection()) { Object selected = nodeSelection.toList().get(0); IContentProvider provider = this.treeViewer.getContentProvider(); if (provider instanceof ITreeContentProvider && ((ITreeContentProvider)provider).hasChildren(selected)) { if (this.treeViewer.getExpandedState(selected)) { this.treeViewer.collapseToLevel(selected, AbstractTreeViewer.ALL_LEVELS); } else { this.treeViewer.expandToLevel(selected, 1); } } }</technical_language>

Target:
public void doubleClick(DoubleClickEvent event) { NodeSelection nodeSelection = NodeSelection.from(this.treeViewer.getSelection()); if (isEnabledFor(nodeSelection)) { run(); } else if (nodeSelection.isSingleSelection()) { Object selected = nodeSelection.toList().get(0); IContentProvider provider = this.treeViewer.getContentProvider(); if (provider instanceof ITreeContentProvider && ((ITreeContentProvider) provider).hasChildren(selected)) { if (this.treeViewer.getExpandedState(selected)) { this.treeViewer.collapseToLevel(selected, AbstractTreeViewer.ALL_LEVELS); } else { this.treeViewer.expandToLevel(selected, 1); } } } }
Source:
<code>public float getFloat() { <START> return foundValue.floatValue(); <END> }</code><technical_language>This throw NPE if isNull is true. I if this is called a hot loop not. @clintropolis @jon-wei deal this. I this potential NPE in other aggregators well. If switch a primitive in class, getters simply cast local variable</technical_language>

Target:
public float getFloat() { return (float) foundValue; }
Source:
<code>public void onPluginEnable(final PluginEnableEvent event) { if (event.getPlugin().getName().equals("EssentialsChat")) { ess.getSettings().setEssentialsChatActive(true); } ess.getPermissionsHandler().setUseSuperperms(ess.getSettings().useBukkitPermissions()); ess.getPermissionsHandler().checkPermissions(); <START> ess.getPermissionsHandler().registerContext("ess-afk", player -> Collections.singleton(String.valueOf(ess.getUser(player).isAfk())), () -> ImmutableSet.of("true", "false")); <END> ess.getPermissionsHandler().registerContext("ess-muted", player -> Collections.singleton(String.valueOf(ess.getUser(player).isMuted())), () -> ImmutableSet.of("true", "false")); ess.getPermissionsHandler().registerContext("ess-vanished", player -> Collections.singleton(String.valueOf(ess.getUser(player).isHidden())), () -> ImmutableSet.of("true", "false")); ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin()); if (!Methods.hasMethod() && Methods.setMethod(ess.getServer().getPluginManager())) { ess.getLogger().log(Level.INFO, "Payment method found (" + Methods.getMethod().getLongName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")"); } }</code><technical_language>register calls in onEnable?? missing something, currently added PluginEnableEvent? (this is gonna fire time a plugin loads?!)</technical_language>

Target:
public void onPluginEnable(final PluginEnableEvent event) { if (event.getPlugin().getName().equals("EssentialsChat")) { ess.getSettings().setEssentialsChatActive(true); } ess.getPermissionsHandler().setUseSuperperms(ess.getSettings().useBukkitPermissions()); ess.getPermissionsHandler().checkPermissions(); ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin()); if (!Methods.hasMethod() && Methods.setMethod(ess.getServer().getPluginManager())) { ess.getLogger().log(Level.INFO, "Payment method found (" + Methods.getMethod().getLongName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")"); } }
Source:
<code>public CloudBigtableScanConfiguration build() { if (request == null) { ReadHooks readHooks = new DefaultReadHooks(); if (scan == null) { scan = new Scan(); } Query query = Query.create(tableId.get()); Adapters.SCAN_ADAPTER.adapt(scan, readHooks, query); <START> ValueProvider<String> appProfileIdValue = <END> additionalConfiguration.get(BigtableOptionsFactory.APP_PROFILE_ID_KEY); String appProfileId = ""; if (appProfileIdValue != null) { appProfileId = appProfileIdValue.get(); } RequestContext requestContext = RequestContext .create(InstanceName.of(projectId.get(), instanceId.get()), appProfileId); readHooks.applyPreSendHook(query); request = StaticValueProvider.of(query.toProto(requestContext)); } return new CloudBigtableScanConfiguration(projectId, instanceId, tableId, request, additionalConfiguration); }</code><technical_language>I realized this work. discuss this offline why. need defer of ValueProvider parts of dataflow pipeline</technical_language>

Target:
public CloudBigtableScanConfiguration build() { if (request == null) { withScan(new Scan()); } return new CloudBigtableScanConfiguration(projectId, instanceId, tableId, request, additionalConfiguration); }
Source:
<code>protected CacheEntryEvent<K, V> shouldInvoke(CacheEntryEvent<K, V> event, boolean isLocalNodePrimaryOwner) { if (onlyPrimary && !isLocalNodePrimaryOwner) return null; if (event instanceof EventImpl) { EventImpl<K, V> eventImpl = (EventImpl<K, V>)event; boolean isPre = eventImpl.isPre(); if (!observation.shouldInvoke(isPre)) return null; <START> if (isPre && clustered) return null; <END> EventType eventType; if (filter != null && (eventType = getEvent(eventImpl)) != null) { if (filterAndConvert) { Object newValue = ((CacheEventFilterConverter)filter).filterAndConvert(eventImpl.getKey(), eventImpl.getOldValue(), eventImpl.getOldMetadata(), eventImpl.getValue(), eventImpl.getMetadata(), eventType); if (newValue != null) { EventImpl<K, V> clone = eventImpl.clone(); clone.setValue((V) newValue); return clone; } else { return null; } } else if (!filter.accept(eventImpl.getKey(), eventImpl.getOldValue(), eventImpl.getOldMetadata(), eventImpl.getValue(), eventImpl.getMetadata(), eventType)) { return null; } } } return event; }</code><technical_language>This check removed</technical_language>

Target:
protected CacheEntryEvent<K, V> shouldInvoke(CacheEntryEvent<K, V> event, boolean isLocalNodePrimaryOwner) { if (onlyPrimary && !isLocalNodePrimaryOwner) return null; if (event instanceof EventImpl) { EventImpl<K, V> eventImpl = (EventImpl<K, V>)event; boolean isPre = eventImpl.isPre(); if (!observation.shouldInvoke(isPre)) return null; EventType eventType; if (filter != null && (eventType = getEvent(eventImpl)) != null) { if (filterAndConvert) { Object newValue = ((CacheEventFilterConverter)filter).filterAndConvert(eventImpl.getKey(), eventImpl.getOldValue(), eventImpl.getOldMetadata(), eventImpl.getValue(), eventImpl.getMetadata(), eventType); if (newValue != null) { EventImpl<K, V> clone = eventImpl.clone(); clone.setValue((V) newValue); return clone; } else { return null; } } else if (!filter.accept(eventImpl.getKey(), eventImpl.getOldValue(), eventImpl.getOldMetadata(), eventImpl.getValue(), eventImpl.getMetadata(), eventType)) { return null; } } } return event; }
Source:
<code>public void emitTuples() { try { final Transaction transaction = client.createTransaction(TransferDirection.RECEIVE); if (transaction == null) { LOGGER.warn("A transaction could not be created, returning..."); return; } DataPacket dataPacket = transaction.receive(); if (dataPacket == null) { transaction.confirm(); transaction.complete(); LOGGER.debug("No data available to pull, returning and will try again..."); return; } final List<T> tuples = new ArrayList<>(); do { tuples.add(createTuple(dataPacket)); dataPacket = transaction.receive(); } while (dataPacket != null); transaction.confirm(); emitTuples(tuples); transaction.complete(); <START> <END> } catch (IOException ioe) { throw new RuntimeException("Error communicating with NiFi", ioe); } }</code><technical_language>confirm lead data loss operator fails. need retrieve data a fault tolerant storage confirming transaction. This similar JMS, acknowledge message prior stored. place store data endWindow. pattern JSM applies here. Kafka files retain data simply operator left off</technical_language>

Target:
public void emitTuples() { if (recoveredTuples.size() > 0) { emitTuples(recoveredTuples); recoveredTuples.clear(); return; } try { final Transaction transaction = client.createTransaction(TransferDirection.RECEIVE); if (transaction == null) { LOGGER.warn("A transaction could not be created, returning..."); return; } DataPacket dataPacket = transaction.receive(); if (dataPacket == null) { transaction.confirm(); transaction.complete(); LOGGER.debug("No data available to pull, returning and will try again..."); return; } final List<T> tuples = new ArrayList<>(); do { tuples.add(createTuple(dataPacket)); dataPacket = transaction.receive(); } while (dataPacket != null); transaction.confirm(); currentWindowTuples.addAll(tuples); windowDataManager.save(currentWindowTuples, operatorContextId, currentWindowId); transaction.complete(); emitTuples(tuples); } catch (IOException e) { DTThrowable.rethrow(e); } }
Source:
<code>public void checkInterrupted() { <START> if (nIterrationsSinceCheck == nIterrationsPerCheck) { <END> nIterrationsSinceCheck = 0; int nRead = nf.peek(fd, buffer, bufferSize); if (nRead == 0) { return; } if (nRead < 0) { throw CairoException.instance(0).put("Interrupting SQL processings, client fd ").put(fd).put(" is closed"); } int index = 0; long ptr = buffer; while (index < nRead) { byte b = Unsafe.getUnsafe().getByte(ptr + index); if (b != (byte) '\r' && b != (byte) '\n') { break; } index++; } if (index > 0) { nf.recv(fd, buffer, index); } } else { nIterrationsSinceCheck++; } }</code><technical_language>this method is a "hot" data path. pay special attention branch prediction inlining. microbench of this method's impact good have. microbech results I suggest this method styles follows: java if (++nIterrationsSinceCheck < nIterrationsPerCheck) { return; } doHeavyCheck();</technical_language>

Target:
public void checkInterrupted() { assert fd != -1; if (nIterationsSinceCheck == nIterationsPerCheck) { nIterationsSinceCheck = 0; int nRead = nf.peek(fd, buffer, bufferSize); if (nRead == 0) { return; } if (nRead < 0) { throw CairoException.instance(0).put("Interrupting SQL processing, client fd ").put(fd).put(" is closed"); } int index = 0; long ptr = buffer; while (index < nRead) { byte b = Unsafe.getUnsafe().getByte(ptr + index); if (b != (byte) '\r' && b != (byte) '\n') { break; } index++; } if (index > 0) { nf.recv(fd, buffer, index); } } else { nIterationsSinceCheck++; } }
Source:
<code>public ActivityEvent(String handle, String kind, String summary, Date date, Map<String, String> attributes) { <START> Assert.isNotNull("Handle should not be null", handle); END> Assert.isNotNull("Task kind should not be null", kind); Assert.isNotNull("Task summary should not be null", summary); this.handle = handle; this.kind = kind; this.summary = summary; this.date = date; this.attributes = attributes; }</code><technical_language>parameters in wrong order. message "must not" "should not"</technical_language>

Target:
public ActivityEvent(String handle, String kind, String summary, Date date, Map<String, String> attributes) { Assert.isNotNull("Handle must not be null", handle); Assert.isNotNull("Task kind must not be null", kind); Assert.isNotNull("Task summary must not be null", summary); this.handle = handle; this.kind = kind; this.summary = summary; this.date = date; this.attributes = attributes; }
Source:
<code>protected void findInDiagram(ScopeEntry scopeEntry) { for (AbstractResultEntry match : fResults) { Object source = null; if (match instanceof AttributeMatch) { <START> source = ((AttributeMatch) match).getSource(); } else { source = match.getSource(); <END> } if (source instanceof Element) { List<View> views = getViewsToSelect((Element) source); if (views != null && !views.isEmpty()) { for (View view : views) { ViewerMatch viewMatch = new ViewerMatch(view, scopeEntry, source); fResults.add(viewMatch); } } } } }</code><technical_language>Polymorphism ensure correct getSource() method is called in cases. need instanceof test</technical_language>

Target:
protected void findInDiagram(ScopeEntry scopeEntry) { Set<AbstractResultEntry> viewResults = new HashSet<AbstractResultEntry>(); for (AbstractResultEntry match : fResults) { Object source = null; if (match instanceof AttributeMatch) { source = ((AttributeMatch) match).getSource(); } else { source = match.getSource(); } if (source instanceof Element) { List<View> views = getViewsToSelect((Element) source); if (views != null && !views.isEmpty()) { for (View view : views) { ViewerMatch viewMatch = new ViewerMatch(view, scopeEntry, source); viewResults.add(viewMatch); } } } } fResults.addAll(viewResults); }
Source:
<code>public void detectBOM() throws URISyntaxException, IOException { byte[] b = ByteOrderMark.UTF_16BE.getBytes(); assertThat(charsets.detectBOM(b)).isEqualTo(ByteOrderMark.UTF_16BE); Path utf8 = Paths.get(this.getClass().getClassLoader().getResource("org/sonar/scanner/scan/filesystem/UTF-8.txt").toURI()); Path utf16be = Paths.get(this.getClass().getClassLoader().getResource("org/sonar/scanner/scan/filesystem/UTF-16BE.txt").toURI()); Path utf16le = Paths.get(this.getClass().getClassLoader().getResource("org/sonar/scanner/scan/filesystem/UTF-16LE.txt").toURI()); Path utf32be = Paths.get(this.getClass().getClassLoader().getResource("org/sonar/scanner/scan/filesystem/UTF-32BE.txt").toURI()); Path utf32le = Paths.get(this.getClass().getClassLoader().getResource("org/sonar/scanner/scan/filesystem/UTF-32LE.txt").toURI()); <START> assertThat(charsets.detectBOM(Files.readAllBytes(utf8))).isEqualTo(ByteOrderMark.UTF_8); <END> assertThat(charsets.detectBOM(Files.readAllBytes(utf16le))).isEqualTo(ByteOrderMark.UTF_16LE); assertThat(charsets.detectBOM(Files.readAllBytes(utf16be))).isEqualTo(ByteOrderMark.UTF_16BE); assertThat(charsets.detectBOM(Files.readAllBytes(utf32le))).isEqualTo(ByteOrderMark.UTF_32LE); assertThat(charsets.detectBOM(Files.readAllBytes(utf32be))).isEqualTo(ByteOrderMark.UTF_32BE); }</code><technical_language>a getBom(String filename) returns Files.readAllBytes(Paths.get(this.getClass().getClassLoader().getResource("org/sonar/scanner/scan/filesystem/" + filename).toURI())) reduce code duplication</technical_language>

Target:
public void detectBOM() throws URISyntaxException, IOException { byte[] b = ByteOrderMark.UTF_16BE.getBytes(); assertThat(charsets.detectBOM(b)).isEqualTo(ByteOrderMark.UTF_16BE); assertThat(charsets.detectBOM(readFile("UTF-8"))).isEqualTo(ByteOrderMark.UTF_8); assertThat(charsets.detectBOM(readFile("UTF-16BE"))).isEqualTo(ByteOrderMark.UTF_16BE); assertThat(charsets.detectBOM(readFile("UTF-16LE"))).isEqualTo(ByteOrderMark.UTF_16LE); assertThat(charsets.detectBOM(readFile("UTF-32BE"))).isEqualTo(ByteOrderMark.UTF_32BE); assertThat(charsets.detectBOM(readFile("UTF-32LE"))).isEqualTo(ByteOrderMark.UTF_32LE); }
Source:
<code><START> Judgment getJudgment() { <END> return judgment; }</code><technical_language>public access</technical_language>

Target:
public Judgment getJudgment() { return judgment; }
Source:
<code>public void shouldFindAllIdeasByTagId() throws Exception { long tagID = 1L; <START> List<Idea> ideas = ideaRepository.findByUserId(tagID); <END> assertThat(ideas).hasSize(1); assertThatIdea(ideas.get(0)) .hasId(1L) .hasTitle("Test title") .hasDescription("Test description") .hasRating(5); }</code><technical_language>ideaRepository.findByTagId(tagID); I u change entities id's (so entity unique id file) in repository-idea-entries.xml (and other tests xml files) avoid failures in future. this: xml <user id="1" username="Jack" email="Jack@test.com" password="password" creation_time="2014-08-02 00:00:00"/> <idea id="2" title="Test title" description="Test description" creation_time="2014-08-03 00:00:00" modification_time="2014-09-04 00:00:00" rating="5" user_id="1"/> <tag id="3" name="Programming" /> <idea_tag idea_id="2" tag_id="3"/></technical_language>

Target:
public void shouldFindAllIdeasByTagId() throws Exception { long tagID = 3L; List<Idea> ideas = ideaRepository.findByTagId(tagID); assertThat(ideas).hasSize(1); assertThatIdea(ideas.get(0)) .hasId(2L) .hasTitle("Test title") .hasDescription("Test description") .hasRating(5); }
Source:
<code>public String _getVanishingItemsPolicy() { String value = config.getString("vanishing-items-policy", "keep").toLowerCase(Locale.ENGLISH); if (!value.equals("delete") && !value.equals("drop") && !value.equals("keep")) { <START> value = "delete"; <END> } return value; }</code><technical_language>default supposed "keep"</technical_language>

Target:
public KeepInvPolicy _getVanishingItemsPolicy() { String value = config.getString("vanishing-items-policy", "keep").toLowerCase(Locale.ENGLISH); try { return KeepInvPolicy.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { return KeepInvPolicy.KEEP; } }
Source:
<code>public void build(GridBuilder builder, Coordinate coordinate) { <START> builder.placeTeleporter(coordinate, null); <END> }</code><technical_language>inerconnection of teleporters happen? null builder</technical_language>

Target:
public void build(GridBuilder builder, Coordinate coordinate) { builder.placeTeleporter(coordinate, destination); }
Source:
<code>public InputStream decryptSecretValues() { <START> log.debug("Scanning activiti.xml for Secret Alias attribute"); <END> boolean hasSecretValue = false; Iterator iteratorBeans = activitiConfigElement.getChildrenWithLocalName("bean"); while (iteratorBeans.hasNext()) { Iterator iteratorProperties = ((OMElement) iteratorBeans.next()).getChildrenWithLocalName("property"); while (iteratorProperties.hasNext()) { OMElement propertyOMElement = (OMElement) iteratorProperties.next(); String secretValue = getSecureVaultValue(secretResolver, propertyOMElement); if (secretValue != null) { hasSecretValue = true; propertyOMElement.addAttribute("value", secretValue, null); propertyOMElement.removeAttribute( propertyOMElement.getAttribute( new QName(BPMNConstants.SECURE_VAULT_NS, BPMNConstants.SECRET_ALIAS_ATTR_NAME) ) ); } } } log.debug("Scanning complete"); if (hasSecretValue) { log.debug("Secret Alias found in activiti.xml"); InputStream activitiConfigStream = new ByteArrayInputStream(activitiConfigElement.toString().getBytes()); return activitiConfigStream; } else { log.debug("No Secret Alias found in activiti.xml"); return null; } }</code><technical_language>standard practice of writing a debug log is below. if (log.isDebugEnabled()) { //debug log } Also, information in debug log is vague. People enable debug logs collect more details. provide more information flow. Otherwise, remove debug log statement</technical_language>

Target:
public InputStream decryptSecretValues() { boolean hasSecretValue = false; Iterator iteratorBeans = activitiConfigElement.getChildrenWithLocalName("bean"); while (iteratorBeans.hasNext()) { Iterator iteratorProperties = ((OMElement) iteratorBeans.next()).getChildrenWithLocalName("property"); while (iteratorProperties.hasNext()) { OMElement propertyOMElement = (OMElement) iteratorProperties.next(); String secretValue = getSecureVaultValue(secretResolver, propertyOMElement); if (secretValue != null) { hasSecretValue = true; propertyOMElement.addAttribute("value", secretValue, null); propertyOMElement.removeAttribute( propertyOMElement.getAttribute( new QName(BPMNConstants.SECURE_VAULT_NS, BPMNConstants.SECRET_ALIAS_ATTR_NAME) ) ); } } } if (hasSecretValue) { InputStream activitiConfigStream = new ByteArrayInputStream(activitiConfigElement.toString().getBytes()); return activitiConfigStream; } else { return null; } }
Source:
<code>public void testBuildServiceNameForToken() { <START> String serviceID = "omService"; <END> String nodeIDs = "om1,om2,om3"; configuration.set(OMConfigKeys.OZONE_OM_SERVICE_IDS_KEY, serviceID); configuration.set(OMConfigKeys.OZONE_OM_NODE_ID_KEY, nodeIDs); configuration.setBoolean(HADOOP_SECURITY_TOKEN_SERVICE_USE_IP, false); Collection<String> nodeIDList = configuration.getStringCollection( OMConfigKeys.OZONE_OM_NODE_ID_KEY); String expectedOmServiceAddress = buildOMNodeAddresses(nodeIDList, serviceID); SecurityUtil.setConfiguration(configuration); String omserviceAddr = OzoneS3Util.buildServiceNameForToken(configuration, serviceID, nodeIDList); Assert.assertEquals(expectedOmServiceAddress, omserviceAddr); }</code><technical_language>Line 55-59 is redundant in setConf test</technical_language>

Target:
public void testBuildServiceNameForToken() { Collection<String> nodeIDList = OmUtils.getOMNodeIds(configuration, serviceID); configuration.set(OmUtils.addKeySuffixes(OMConfigKeys.OZONE_OM_ADDRESS_KEY, serviceID, "om1"), "om1:9862"); configuration.set(OmUtils.addKeySuffixes(OMConfigKeys.OZONE_OM_ADDRESS_KEY, serviceID, "om2"), "om2:9862"); configuration.set(OmUtils.addKeySuffixes(OMConfigKeys.OZONE_OM_ADDRESS_KEY, serviceID, "om3"), "om3:9862"); String expectedOmServiceAddress = buildServiceAddress(nodeIDList); SecurityUtil.setConfiguration(configuration); String omserviceAddr = OzoneS3Util.buildServiceNameForToken(configuration, serviceID, nodeIDList); Assert.assertEquals(expectedOmServiceAddress, omserviceAddr); }
Source:
<code>public DataDependentEDDifferentialPrivacy(double epsilonAnon, double epsilonSearch, double delta, int steps) { <START> super(delta); <END> this.epsilonAnon = epsilonAnon; this.epsilonSearch = epsilonSearch; this.beta = calculateBeta(epsilonAnon); this.k = calculateK(getDelta(), epsilonAnon, this.beta); this.steps = steps; }</code><technical_language>this(epsilonAnon, epsilonSearch, delta, steps, false); ??</technical_language>

Target:
public DataDependentEDDifferentialPrivacy(double epsilonAnon, double epsilonSearch, double delta, int steps) { this(epsilonAnon, epsilonSearch, delta, steps, false); }
Source:
<code>protected ICompilationUnit getCompilationUnit(IJavaStackFrame frame) { ILaunch launch = frame.getLaunch(); if (launch == null) { return null; } try { IJavaElement sourceElement = JavaDebugUtils.resolveJavaElement(frame, launch); <START> if (sourceElement instanceof ICompilationUnit) { <END> return (ICompilationUnit) sourceElement; } return null; } catch (CoreException e) { return null; } }</code><technical_language>this case ? if (sourceElement instanceof IType) { return ((IType) sourceElement).getCompilationUnit();</technical_language>

Target:
protected ICompilationUnit getCompilationUnit(IJavaStackFrame frame) { ILaunch launch = frame.getLaunch(); if (launch == null) { return null; } try { IJavaElement sourceElement = JavaDebugUtils.resolveJavaElement(frame, launch); if (sourceElement instanceof IType) { return ((IType) sourceElement).getCompilationUnit(); } if (sourceElement instanceof ICompilationUnit) { return (ICompilationUnit) sourceElement; } return null; } catch (CoreException e) { return null; } }
Source:
<code>private byte[] encrypt(final byte[] bytes) throws IOException { <START> final byte[] encrypted; <END> try (final Formatter formatter = new Formatter()) { for (final byte byt : this.create().doFinal(bytes)) { formatter.format("%02x", byt); } encrypted = formatter.toString().getBytes(); } return encrypted; }</code><technical_language>@semantosoph do need this variable? do return formatter.toString().getBytes();</technical_language>

Target:
private byte[] encrypt(final byte[] bytes) throws IOException { try (final Formatter formatter = new Formatter()) { for (final byte byt : this.create().doFinal(bytes)) { formatter.format("%02x", byt); } return formatter.toString().getBytes(); } }
Source:
<code>void handleBookieFailure(final Map<Integer, BookieSocketAddress> failedBookies) { int curBlockAddCompletions = blockAddCompletions.incrementAndGet(); if (bk.disableEnsembleChangeFeature.isAvailable()) { blockAddCompletions.decrementAndGet(); if (LOG.isDebugEnabled()) { LOG.debug("Ensemble change is disabled. Retry sending to failed bookies for ledger {}.", failedBookies, ledgerId); } unsetSuccessAndSendWriteRequest(failedBookies.keySet()); return; } int curNumEnsembleChanges = numEnsembleChanges.incrementAndGet(); if (curNumEnsembleChanges > maxNumEnsembleChanges){ if (LOG.isDebugEnabled()) { <START> LOG.debug("touch maxNumEnsembleChanges"); <END> } handleUnrecoverableErrorDuringAdd(WriteException); return; } synchronized (metadata) { try { EnsembleInfo ensembleInfo = replaceBookieInMetadata(failedBookies, curNumEnsembleChanges); if (ensembleInfo.replacedBookies.isEmpty()) { blockAddCompletions.decrementAndGet(); return; } if (LOG.isDebugEnabled()) { LOG.debug("[EnsembleChange-L{}-{}] : writing new ensemble info = {}, block add completions = {}", getId(), curNumEnsembleChanges, ensembleInfo, curBlockAddCompletions); } writeLedgerConfig(new ChangeEnsembleCb(ensembleInfo, curBlockAddCompletions, curNumEnsembleChanges)); } catch (BKException.BKNotEnoughBookiesException e) { LOG.error("Could not get additional bookie to remake ensemble, closing ledger: {}", ledgerId); handleUnrecoverableErrorDuringAdd(e.getCode()); return; } } }</code><technical_language>provide a more meaningful log statement here? E.g. "Ledger reaches max num ensemble changes {}"</technical_language>

Target:
void handleBookieFailure(final Map<Integer, BookieSocketAddress> failedBookies) { int curBlockAddCompletions = blockAddCompletions.incrementAndGet(); if (bk.getDisableEnsembleChangeFeature().isAvailable()) { blockAddCompletions.decrementAndGet(); if (LOG.isDebugEnabled()) { LOG.debug("Ensemble change is disabled. Retry sending to failed bookies for ledger {}.", failedBookies, ledgerId); } unsetSuccessAndSendWriteRequest(failedBookies.keySet()); return; } int curNumEnsembleChanges = numEnsembleChanges.incrementAndGet(); if (curNumEnsembleChanges > maxAllowedEnsembleChanges){ if (LOG.isDebugEnabled()) { LOG.debug("Ledger reaches max allowed ensemble change number {}", ledgerId, maxAllowedEnsembleChanges); } handleUnrecoverableErrorDuringAdd(WriteException); return; } synchronized (metadata) { try { EnsembleInfo ensembleInfo = replaceBookieInMetadata(failedBookies, curNumEnsembleChanges); if (ensembleInfo.replacedBookies.isEmpty()) { blockAddCompletions.decrementAndGet(); return; } if (LOG.isDebugEnabled()) { LOG.debug("[EnsembleChange-L{}-{}] : writing new ensemble info = {}, block add completions = {}", getId(), curNumEnsembleChanges, ensembleInfo, curBlockAddCompletions); } writeLedgerConfig(new ChangeEnsembleCb(ensembleInfo, curBlockAddCompletions, curNumEnsembleChanges)); } catch (BKException.BKNotEnoughBookiesException e) { LOG.error("Could not get additional bookie to remake ensemble, closing ledger: {}", ledgerId); handleUnrecoverableErrorDuringAdd(e.getCode()); return; } } }
Source:
<code><START> private void sendWarningForNonExportableDisks(List<Disk> nonExportableDisks) { <END> if(!nonExportableDisks.isEmpty()) { final StringBuilder s = new StringBuilder(); for(Disk disk : nonExportableDisks) { if(s.length() > 0) { s.append(", "); } s.append(disk.getDiskAlias()); } getModel().setMessage(ConstantsManager.getInstance().getMessages().disksWillNotBePartOfTheExportedVMTemplate(s.toString())); } }</code><technical_language>Please engine code format (missing whitespace if/for/etc...)</technical_language>

Target:
private void sendWarningForNonExportableDisks(List<Disk> nonExportableDisks) { if (!nonExportableDisks.isEmpty()) { final List<String> list = new ArrayList<String>(); for (Disk disk : nonExportableDisks) { list.add(disk.getDiskAlias()); } final String s = StringUtils.join(list, ", "); getModel().setMessage(ConstantsManager.getInstance().getMessages().disksWillNotBePartOfTheExportedVMTemplate(s)); } }
Source:
<code>public final int[] checkQueueIntegrity() throws IOException { <START> return queueFile.scanAll(); <END> }</code><technical_language>is named scanAll other checkQueueIntegrity</technical_language>

Target:
public final void checkQueueIntegrity() throws IOException { queueFile.checkQueueIntegrity(); }
Source:
<code>public static PutRequest readFrom(DataInputStream stream, ClusterMap map) throws IOException { int correlationId = stream.readInt(); String clientId = Utils.readIntString(stream); BlobId id = new BlobId(stream, map); BlobProperties properties = BlobPropertiesSerDe.getBlobPropertiesFromStream(stream); ByteBuffer metadata = Utils.readIntBuffer(stream); long dataSize = stream.readLong(); <START> BlobDataType dataType = BlobDataType.values()[stream.readShort()]; <END> InputStream data = stream; return new PutRequest(correlationId, clientId, id, properties, metadata, data, dataSize, dataType, Put_Request_Version_V2); }</code><technical_language>want point out this throw IllegalArgumentException</technical_language>

Target:
static PutRequest readFrom(DataInputStream stream, ClusterMap map) throws IOException { int correlationId = stream.readInt(); String clientId = Utils.readIntString(stream); BlobId id = new BlobId(stream, map); BlobProperties properties = BlobPropertiesSerDe.getBlobPropertiesFromStream(stream); ByteBuffer metadata = Utils.readIntBuffer(stream); BlobType blobType = BlobType.values()[stream.readShort()]; long blobSize = stream.readLong(); return new PutRequest(correlationId, clientId, id, properties, metadata, stream, blobSize, blobType, Put_Request_Version_V2); }
Source:
<code>private void addUpdates(TextChangeManager changeManager, IProgressMonitor pm, RefactoringStatus status) throws CoreException { pm.beginTask("", fCus.length); for (ICompilationUnit <START> fCu : <END> fCus) { if (pm.isCanceled()) throw new OperationCanceledException(); addUpdates(changeManager, fCu, new SubProgressMonitor(pm, 1), status); } }</code><technical_language>rename cu</technical_language>

Target:
private void addUpdates(TextChangeManager changeManager, IProgressMonitor pm, RefactoringStatus status) throws CoreException { pm.beginTask("", fCus.length); for (ICompilationUnit cu : fCus) { if (pm.isCanceled()) throw new OperationCanceledException(); addUpdates(changeManager, cu, new SubProgressMonitor(pm, 1), status); } }
Source:
<code>public synchronized void start() throws LifecycleException { if (isRunning) { throw new LifecycleException("Process already started"); } else { log.info("Starting Jmxtrans on : {}", configuration.getProcessConfigDirOrFile()); try { this.serverScheduler.start(); this.startupWatchdir(); this.startupSystem(); <START> this.registerMBeans(); <END> } catch (Exception e) { log.error(e.getMessage(), e); throw new LifecycleException(e); } Runtime.getRuntime().addShutdownHook(shutdownHook); isRunning = true; } }</code><technical_language>Why? is related InfluxDB</technical_language>

Target:
public synchronized void start() throws LifecycleException { if (isRunning) { throw new LifecycleException("Process already started"); } else { log.info("Starting Jmxtrans on : {}", configuration.getProcessConfigDirOrFile()); try { this.serverScheduler.start(); this.startupWatchdir(); this.startupSystem(); } catch (Exception e) { log.error(e.getMessage(), e); throw new LifecycleException(e); } Runtime.getRuntime().addShutdownHook(shutdownHook); isRunning = true; } }
Source:
<code>public String convertToString(Object o) { if(!(o instanceof Coord)){ log.error("Object is not of type Coord: " + o.getClass().toString()); return null; } Coord c = (Coord)o; <START> return String.format(Locale.ROOT, "(%f;%f)", c.getX(), c.getY()); <END> }</code><technical_language>I guess Locale removed, writing "," instead "." decimal separator, is dependent system settings</technical_language>

Target:
public String convertToString(Object o) { if(!(o instanceof Coord)){ log.error("Object is not of type Coord: " + o.getClass().toString()); return null; } Coord c = (Coord)o; return String.format("(%s;%s)", Double.toString(c.getX()), Double.toString(c.getY())); }
Source:
<code>private void updateChannelTopic() { boolean hasTopic = channel.getTopic() != null; topicPane.setVisible(hasTopic); if (!hasTopic) { return; } <START> String topic = channel.getTopic() == null ? "" : channel.getTopic(); <END> Arrays.stream(topic.split("\\s")) .forEach(word -> { if (URL_REGEX_PATTERN.matcher(word).matches()) { Hyperlink link = new Hyperlink(word); link.setOnAction(event -> platformService.showDocument(word)); topicText.getChildren().add(link); } else { topicText.getChildren().add(new Label(word + " ")); } }); }</code><technical_language>Unnecessary check? If null, returned i think</technical_language>

Target:
private void updateChannelTopic() { boolean hasTopic = !Strings.isNullOrEmpty(channel.getTopic()); topicPane.setVisible(hasTopic); if (!hasTopic) { return; } String topic = channel.getTopic(); Arrays.stream(topic.split("\\s")) .forEach(word -> { if (URL_REGEX_PATTERN.matcher(word).matches()) { Hyperlink link = new Hyperlink(word); link.setOnAction(event -> platformService.showDocument(word)); topicText.getChildren().add(link); } else { topicText.getChildren().add(new Label(word + " ")); } }); }
Source:
<code>public void updateParticipantDoesNotTransferSubstudyIds() { Set<String> substudies = ImmutableSet.of("substudyA", "substudyB"); StudyParticipant participant = mockSubstudiesInRequest(substudies, substudies); mockHealthCodeAndAccountRetrieval(); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyC", ID)); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyA", ID)); <START> participantService.updateParticipant(STUDY, participant); <END> verify(accountDao).updateAccount(accountCaptor.capture(), any()); Set<AccountSubstudy> accountSubstudies = accountCaptor.getValue().getAccountSubstudies(); assertEquals(2, accountSubstudies.size()); AccountSubstudy substudyA = accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyC")).findAny().get(); assertEquals(STUDY.getIdentifier(), substudyA.getStudyId()); assertEquals(ID, substudyA.getAccountId()); AccountSubstudy substudyB = accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyA")).findAny().get(); assertEquals(STUDY.getIdentifier(), substudyB.getStudyId()); assertEquals(ID, substudyB.getAccountId()); }</code><technical_language>this test</technical_language>

Target:
public void updateParticipantDoesNotTransferSubstudyIds() { Set<String> substudies = ImmutableSet.of("substudyA", "substudyB"); StudyParticipant participant = mockSubstudiesInRequest(substudies, substudies); mockHealthCodeAndAccountRetrieval(); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyC", ID)); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyA", ID)); participantService.updateParticipant(STUDY, participant); verify(accountDao).updateAccount(accountCaptor.capture(), eq(null)); Set<AccountSubstudy> accountSubstudies = accountCaptor.getValue().getAccountSubstudies(); assertEquals(2, accountSubstudies.size()); AccountSubstudy substudyA = accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyC")).findAny().get(); assertEquals(STUDY.getIdentifier(), substudyA.getStudyId()); assertEquals(ID, substudyA.getAccountId()); AccountSubstudy substudyB = accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyA")).findAny().get(); assertEquals(STUDY.getIdentifier(), substudyB.getStudyId()); assertEquals(ID, substudyB.getAccountId()); }
Source:
<code>public CompletableFuture<Void> visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { if (ctx.isInTxScope()) return ctx.continueInvocation(); <START> return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { <END> lockManager.unlockAll(rCtx); return null; }); }</code><technical_language>unlockAllReturnHandler used</technical_language>

Target:
public CompletableFuture<Void> visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { if (ctx.isInTxScope()) return ctx.continueInvocation(); return ctx.onReturn(unlockAllReturnHandler); }
Source:
<code>private void discardChannel(final Channel channel) { assert this.executor.inEventLoop(); this.idleChannels.remove(channel); this.allChannels.remove(channel); <START> log.debug("Discarded channel {}", channel); <END> this.metricsListener.handleConnectionRemoved(); this.channelFactory.destroy(channel, this.executor.newPromise()).addListener(destroyFuture -> { if (!destroyFuture.isSuccess()) { log.warn("Failed to destroy channel.", destroyFuture.cause()); } }); }</code><technical_language>question here. Is this serious enough, happen infrequently enough for info/warn/error</technical_language>

Target:
private void discardChannel(final Channel channel) { assert this.executor.inEventLoop(); this.idleChannels.remove(channel); this.allChannels.remove(channel); log.debug("Discarded channel {}", channel); this.metricsListener.handleConnectionRemoved(); this.channelFactory.destroy(channel, this.executor.newPromise()).addListener(destroyFuture -> { if (!destroyFuture.isSuccess()) { log.warn("Failed to destroy channel {}", channel, destroyFuture.cause()); } }); }