auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean set(EntityAgeable entity, Map<Key<?>, Object> keyValues) { int age = (Integer) keyValues.get(Keys.AGE); boolean baby = (Boolean) keyValues.get(Keys.BABY); boolean adult = (Boolean) keyValues.get(Keys.ADULT); <START> if(baby) <END> entity.setGrowingAge(-10); else entity.setGrowingAge(1); entity.setGrowingAge(age); return true; }</code><technical_language>bad styling - needs braces</technical_language>

Target:
protected boolean set(EntityAgeable entity, Map<Key<?>, Object> keyValues) { int age = (Integer) keyValues.get(Keys.AGE); boolean adult = (Boolean) keyValues.get(Keys.IS_ADULT); if (adult) { entity.setGrowingAge(1); } else { entity.setGrowingAge(-1); } entity.setGrowingAge(age); return true; }
Source:
<code>public String toString() { <START> return Objects.toStringHelper("Block") <END> .add("id", getId()) .add("name", getName()) .add("translation", getTranslation()) .add("class", getClass().getName()) .toString(); }</code><technical_language>I a reason "Block" here, pass this</technical_language>

Target:
public String toString() { if (this.toString == null) { this.toString = SpongeCatalogType.toStringHelperTranslatable(this) .add("class", getClass().getName()) .toString(); } return this.toString; }
Source:
<code>Packet parse(final Header header, final ByteBuf buffer, final PeerAccessor peerAccessor) throws InvalidPacketException; } interface Visitor { void visit(final InitiationPacket packet); void visit(final TerminationPacket packet); void visit(final PeerUpPacket packet); void visit(final PeerDownPacket packet); void visit(final StatisticsReportPacket packet); void visit(final RouteMonitoringPacket packet); void visit(final RouteMirroringPacket packet); void visit(final UnknownPacket packet); class Adapter implements Visitor { public void visit(RouteMonitoringPacket packet) public void visit(StatisticsReportPacket packet) public void visit(PeerDownPacket packet) public void visit(PeerUpPacket packet) public void visit(InitiationPacket packet) public void visit(TerminationPacket packet) public void visit(RouteMirroringPacket packet) <START> public void visit(final UnknownPacket packet) <END> } }</code><technical_language>final? final</technical_language>

Target:
Packet parse(final Header header, final ByteBuf buffer, final PeerAccessor peerAccessor) throws InvalidPacketException; } interface Visitor { void visit(final InitiationPacket packet); void visit(final TerminationPacket packet); void visit(final PeerUpPacket packet); void visit(final PeerDownPacket packet); void visit(final StatisticsReportPacket packet); void visit(final RouteMonitoringPacket packet); void visit(final RouteMirroringPacket packet); void visit(final UnknownPacket packet); class Adapter implements Visitor { public void visit(final RouteMonitoringPacket packet) public void visit(final StatisticsReportPacket packet) public void visit(final PeerDownPacket packet) public void visit(final PeerUpPacket packet) public void visit(final InitiationPacket packet) public void visit(final TerminationPacket packet) public void visit(final RouteMirroringPacket packet) public void visit(final UnknownPacket packet) } }
Source:
<code>public List<ExecutionYear> getValidExecutionYearsForUnit(Unit unit) { List<ScientificAreaUnit> scientificAreaUnits = unit.getSubUnits().stream() .filter(Unit::isScientificAreaUnit) .map(ScientificAreaUnit.class::cast) .sorted(ScientificAreaUnit.COMPARATOR_BY_NAME_AND_ID) <START> .collect(toList()); <END> HashSet<ExecutionYear> validExecutionYears = new HashSet<>(); final List<ExecutionYear> allExecutionYears = ExecutionYear.readExecutionYears(ExecutionYear.readFirstExecutionYear(), ExecutionYear.readLastExecutionYear()); for (ExecutionYear executionYear : allExecutionYears) { for (ScientificAreaUnit scientificAreaUnit : scientificAreaUnits) { final List<CompetenceCourseGroupUnit> competenceCourseGroupUnits = scientificAreaUnit.getCompetenceCourseGroupUnits(); for (CompetenceCourseGroupUnit competenceCourseGroupUnit : competenceCourseGroupUnits) { List<CompetenceCourse> competenceCoursesByExecutionYear = competenceCourseGroupUnit.getCompetenceCoursesByExecutionYear(executionYear); if (!competenceCoursesByExecutionYear.isEmpty()) { validExecutionYears.add(executionYear); } } } } return validExecutionYears.stream() .sorted(ExecutionYear.REVERSE_COMPARATOR_BY_YEAR) .collect(toList()); }</code><technical_language>creating this list iterate it, iterate stream directly</technical_language>

Target:
public List<ExecutionYear> getValidExecutionYearsForUnit(Unit unit) { HashSet<ExecutionYear> validExecutionYears = new HashSet<>(); final List<ExecutionYear> allExecutionYears = getAllExecutionYears(); unit.getSubUnits().stream() .filter(Unit::isScientificAreaUnit) .map(ScientificAreaUnit.class::cast) .map(scientificAreaUnit -> scientificAreaUnit.getCompetenceCourseGroupUnits()) .forEach(competenceCourseGroupUnits -> { allExecutionYears.stream() .forEach(executionYear -> { competenceCourseGroupUnits.stream() .forEach(competenceCourseGroupUnit -> { if (!competenceCourseGroupUnit.getCompetenceCoursesByExecutionYear(executionYear).isEmpty()) { validExecutionYears.add(executionYear); } }); }); }); return validExecutionYears.stream() .sorted(ExecutionYear.REVERSE_COMPARATOR_BY_YEAR) .collect(toList()); }
Source:
<code>private void toggleAfk(User sender, User user, String message) throws Exception { if (message != null && sender != null) { if (sender.isMuted()) { throw new Exception(sender.hasMuteReason() ? tl("voiceSilencedReason", sender.getMuteReason()) : tl("voiceSilenced")); } if (!sender.isAuthorized("essentials.afk.message")) { throw new Exception(tl("noPermToAFKMessage")); } } user.setDisplayNick(); String msg = ""; String selfmsg = ""; if (!user.toggleAfk()) { if (!user.isHidden()) { msg = tl("userIsNotAway", user.getDisplayName()); selfmsg = tl("userIsNotAwaySelf"); } user.updateActivity(false); } else { if (!user.isHidden()) { if (message != null) { msg = tl("userIsAwayWithMessage", user.getDisplayName(), message); selfmsg = tl("userIsAwaySelfWithMessage", message); } else { msg = tl("userIsAway", user.getDisplayName()); selfmsg = tl("userIsAwaySelf"); } } user.setAfkMessage(message); } if (!msg.isEmpty()) { <START> if (ess.getSettings().broadcastAfkMessage()) { <END> ess.broadcastMessage(user, msg, Collections.singleton(user)); user.sendMessage(selfmsg); } else { user.sendMessage(selfmsg); } } user.setDisplayNick(); }</code><technical_language>Suggest changing if (ess.getSettings().broadcastAfkMessage()) ess.broadcastMessage()... user.sendMessage()</technical_language>

Target:
private void toggleAfk(User sender, User user, String message) throws Exception { if (message != null && sender != null) { if (sender.isMuted()) { throw new Exception(sender.hasMuteReason() ? tl("voiceSilencedReason", sender.getMuteReason()) : tl("voiceSilenced")); } if (!sender.isAuthorized("essentials.afk.message")) { throw new Exception(tl("noPermToAFKMessage")); } } user.setDisplayNick(); String msg = ""; String selfmsg = ""; if (!user.toggleAfk(AfkStatusChangeEvent.Cause.COMMAND)) { if (!user.isHidden()) { msg = tl("userIsNotAway", user.getDisplayName()); selfmsg = tl("userIsNotAwaySelf"); } user.updateActivity(false, AfkStatusChangeEvent.Cause.COMMAND); } else { if (!user.isHidden()) { if (message != null) { msg = tl("userIsAwayWithMessage", user.getDisplayName(), message); selfmsg = tl("userIsAwaySelfWithMessage", message); } else { msg = tl("userIsAway", user.getDisplayName()); selfmsg = tl("userIsAwaySelf"); } } user.setAfkMessage(message); } if (!msg.isEmpty() && ess.getSettings().broadcastAfkMessage()) { ess.broadcastMessage(user, msg, u -> u == user); } if (!selfmsg.isEmpty()) { user.sendMessage(selfmsg); } user.setDisplayNick(); }
Source:
<code>public void shouldRaiseAlertIfResponseHasRemoteFileContentAndPayloadIsNullByteBased() throws HttpMalformedHeaderException { NullByteVulnerableServerHandler vulnServerHandler = new NullByteVulnerableServerHandler("/", "p", Tech.Linux) { protected String getContent(IHTTPSession session) { String value = getFirstParamValue(session, "p"); if (value.contains(NULL_BYTE_CHARACTER)) { <START> return "<!doctype html><html itemscope=\"\" itemtype=\"<LINK_0>\" " <END> + "lang=\"en-IN\"><head><meta charset=\"UTF-8\"><meta content=\"origin\" " + "name=\"referrer\"><meta content=\"/logos/doodles/2020/sir-john-tenniels-200th-birthday-6753651837108300.5-l.png\" " + "itemprop=\"image\"><meta content=\"origin\" name=\"referrer\"><title>Google</title> " + "</html>"; } else { return "<html></html>"; } } }; nano.addHandler(vulnServerHandler); rule.init(getHttpMessage("/?p=a"), parent); rule.setAttackStrength(AttackStrength.INSANE); rule.scan(); assertThat(alertsRaised, hasSize(1)); }</code><technical_language>This simplified return "<html><title>Google</title></html>";</technical_language>

Target:
public void shouldRaiseAlertIfResponseHasRemoteFileContentAndPayloadIsNullByteBased() throws HttpMalformedHeaderException { NullByteVulnerableServerHandler vulnServerHandler = new NullByteVulnerableServerHandler("/", "p", Tech.Linux) { protected String getContent(IHTTPSession session) { String value = getFirstParamValue(session, "p"); if (value.contains(NULL_BYTE_CHARACTER)) { return "<html><title>Google</title></html>"; } else { return "<html></html>"; } } }; nano.addHandler(vulnServerHandler); rule.init(getHttpMessage("/?p=a"), parent); rule.setAttackStrength(AttackStrength.INSANE); rule.scan(); assertThat(alertsRaised, hasSize(1)); }
Source:
<code>public void errorHandler_clientResetReported() { RealmUser user = SyncTestUtils.Companion.createTestUser(app); String url = "realm://objectserver.realm.io/default"; final SyncConfiguration config = configFactory.createSyncConfigurationBuilder(user) .clientResyncMode(ClientResyncMode.MANUAL) .errorHandler((session, error) -> { if (error.getErrorCode() != ErrorCode.CLIENT_RESET) { fail("Wrong error " + error.toString()); return; } final ClientResetRequiredError handler = (ClientResetRequiredError) error; String filePathFromError = handler.getOriginalFile().getAbsolutePath(); String filePathFromConfig = session.getConfiguration().getPath(); assertEquals(filePathFromError, filePathFromConfig); assertFalse(handler.getBackupFile().exists()); assertTrue(handler.getOriginalFile().exists()); looperThread.testComplete(); }) .build(); Realm realm = Realm.getInstance(config); looperThread.addTestRealm(realm); <START> SyncManager syncService = user.getApp().getSyncService(); <END> syncService.simulateClientReset(syncService.getSession((config))); }</code><technical_language>btw rename SyncManager SyncService</technical_language>

Target:
public void errorHandler_clientResetReported() { RealmUser user = SyncTestUtils.createTestUser(app); String url = "realm://objectserver.realm.io/default"; final SyncConfiguration config = configFactory.createSyncConfigurationBuilder(user) .clientResyncMode(ClientResyncMode.MANUAL) .errorHandler((session, error) -> { if (error.getErrorCode() != ErrorCode.CLIENT_RESET) { fail("Wrong error " + error.toString()); return; } final ClientResetRequiredError handler = (ClientResetRequiredError) error; String filePathFromError = handler.getOriginalFile().getAbsolutePath(); String filePathFromConfig = session.getConfiguration().getPath(); assertEquals(filePathFromError, filePathFromConfig); assertFalse(handler.getBackupFile().exists()); assertTrue(handler.getOriginalFile().exists()); looperThread.testComplete(); }) .build(); Realm realm = Realm.getInstance(config); looperThread.addTestRealm(realm); RealmSync syncService = user.getApp().getSync(); syncService.simulateClientReset(syncService.getSession((config))); }
Source:
<code>public GenericScriptEngineFactory() { for (javax.script.ScriptEngineFactory f : engineManager.getEngineFactories()) { <START> logger.info("Supported script engine: for language with mimetypes {}", f.getEngineName(), <END> f.getLanguageName(), f.getMimeTypes()); } }</code><technical_language>is INFO level end users get in main log, I suggest a bit more end user compatible, e.g. > Activated scripting support for ECMAScript add additional debug log lists file extensions mimetypes engine name itself</technical_language>

Target:
public GenericScriptEngineFactory() { for (javax.script.ScriptEngineFactory f : engineManager.getEngineFactories()) { logger.info("Activated scripting support for {}", f.getLanguageName()); logger.debug( "Activated scripting support with engine {}({}) for {}({}) with mimetypes and file extensions {}", f.getEngineName(), f.getEngineVersion(), f.getLanguageName(), f.getLanguageVersion(), f.getMimeTypes(), f.getExtensions()); } }
Source:
<code>private static Boolean hasSuspiciousContigs(final ReadCountCollection singleSampleTangentNormalized, final Map<String, Double> contigToMedian) { final List<String> allContigsPresent = retrieveAllContigsPresent(singleSampleTangentNormalized); for (String contig: allContigsPresent) { final ReadCountCollection oneContigReadCountCollection = singleSampleTangentNormalized.subsetTargets(singleSampleTangentNormalized.targets().stream().filter(t -> t.getContig().equals(contig)).collect(Collectors.toSet())); <START> final RealMatrix counts = oneContigReadCountCollection.counts(); <END> for (int i = 0; i < 4; i++) { final RealMatrix partitionCounts = counts.getSubMatrix(i * counts.getRowDimension() / 4, ((i + 1) * counts.getRowDimension() / 4) - 1, 0, 0); final double[] partitionArray = DoubleStream.of(partitionCounts.getColumn(0)).map(d -> Math.pow(2, d)).sorted().toArray(); double median = new Median().evaluate(partitionArray); final double medianShiftInCRSpace = contigToMedian.getOrDefault(contig, 1.0) - 1.0; median -= medianShiftInCRSpace; if ((median > AMP_THRESHOLD) || (median < DEL_THRESHOLD)) { logger.info("Suspicious contig: " + singleSampleTangentNormalized.columnNames().get(0) + " " + contig + " (" + median + " -- " + i + ")"); return true; } } } return false; }</code><technical_language>work a RealVector instead of a matrix starting this line</technical_language>

Target:
private static Boolean hasSuspiciousContigs(final ReadCountCollection singleSampleTangentNormalized, final Map<String, Double> contigToMedian) { final List<String> allContigsPresent = retrieveAllContigsPresent(singleSampleTangentNormalized); for (String contig: allContigsPresent) { final ReadCountCollection oneContigReadCountCollection = singleSampleTangentNormalized.subsetTargets(singleSampleTangentNormalized.targets().stream().filter(t -> t.getContig().equals(contig)).collect(Collectors.toSet())); final RealMatrix countsAsMatrix = oneContigReadCountCollection.counts(); final RealVector counts = countsAsMatrix.getColumnVector(0); for (int i = 0; i < 4; i++) { final RealVector partitionCounts = counts.getSubVector(i * counts.getDimension() / 4, counts.getDimension() / 4); final double[] partitionArray = DoubleStream.of(partitionCounts.toArray()).map(d -> Math.pow(2, d)).sorted().toArray(); double median = new Median().evaluate(partitionArray); final double medianShiftInCRSpace = contigToMedian.getOrDefault(contig, 1.0) - 1.0; median -= medianShiftInCRSpace; if ((median > AMP_THRESHOLD) || (median < DEL_THRESHOLD)) { logger.info("Suspicious contig: " + singleSampleTangentNormalized.columnNames().get(0) + " " + contig + " (" + median + " -- " + i + ")"); return true; } } } return false; }
Source:
<code>public static void main(String args[]) throws Exception { ZooKeeper zk = new ZooKeeper("localhost:2181", 30000, event -> { }); final String contextPath = "/staging"; final List<String> locks = zk.getChildren(contextPath + "/nakadi/locks", false); final List<String> subscriptions = zk.getChildren(contextPath + "/nakadi/subscriptions", false); System.out.println(locks.size() + " locks, " + subscriptions.size() + " subscriptions"); int notExists = 0; for (int i = 0; i < locks.size(); i++) { <START> System.out.println((i * 100 / (locks.size() - 1)) + "%"); <END> String lockName = locks.get(i); final String subscriptionId = lockName.substring(13); if (!subscriptions.contains(subscriptionId)) { ZKUtil.deleteRecursive(zk, contextPath + "/nakadi/locks/" + lockName); System.out.println("Removed lock for " + subscriptionId + " as it doesn't exist"); notExists++; } } System.out.println("Exist: " + (locks.size() - notExists) + ", Removed: " + notExists); }</code><technical_language>Division zero</technical_language>

Target:
public static void main(String args[]) throws Exception { ZooKeeper zk = new ZooKeeper("localhost:2181", 30000, event -> { }); final String contextPath = "/staging"; final List<String> locks = zk.getChildren(contextPath + "/nakadi/locks", false); System.out.println(locks.size() + "Waiting 70 seconds before fetching list of subscriptions..."); Thread.sleep(70000); final Set<String> subscriptions = new HashSet<>(zk.getChildren(contextPath + "/nakadi/subscriptions", false)); System.out.println(locks.size() + " locks, " + subscriptions.size() + " subscriptions"); int notExists = 0; for (int i = 0; i < locks.size(); i++) { String lockName = locks.get(i); final String subscriptionId = lockName.substring(13); if (!subscriptions.contains(subscriptionId)) { ZKUtil.deleteRecursive(zk, contextPath + "/nakadi/locks/" + lockName); System.out.println("Removed lock for " + subscriptionId + " as it doesn't exist"); notExists++; } System.out.println(((i + 1) * 100 / locks.size()) + "%"); } System.out.println("Exist: " + (locks.size() - notExists) + ", Removed: " + notExists); }
Source:
<code>public void testWidthHeaderColumnTo0() { openVSM(); setNewHeaderColumnWidth(0); SWTBotTree treeTable = createCrossTable(); Display.getDefault().syncExec(new Runnable() { @Override public void run() { assertTrue("Header column size should be greater than 0 to be <START> adapt to <END> column content.", treeTable.widget.getColumn(0).getWidth() > 0); } }); }</code><technical_language>adapted</technical_language>

Target:
public void testWidthHeaderColumnTo0() { openVSM(); setNewHeaderColumnWidth(0); SWTBotTree treeTable = createCrossTable(); Display.getDefault().syncExec(new Runnable() { @Override public void run() { assertTrue("Header column size should be greater than 0 to be adapted to column content.", treeTable.widget.getColumn(0).getWidth() > 0); } }); }
Source:
<code>public JsonNode getBasePod(String podId) { String podURI = String.format( <START> "%s/api/v1/namespaces/default/pods/%s", <END> this.kubernetesURI, podId); HttpURLConnection conn = NetworkUtils.getHttpConnection(podURI); if (conn == null) { LOG.log(Level.SEVERE, "Failed to find k8s deployment API"); return null; } try { if (!NetworkUtils.sendHttpGetRequest(conn)) { LOG.log(Level.SEVERE, "Failed to send GET to k8s deployment API"); return null; } boolean success = NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_OK); if (success) { LOG.log(Level.INFO, "Pulled existing pod from k8s"); byte[] bytes = NetworkUtils.readHttpResponse(conn); ObjectMapper mapper = new ObjectMapper(); JsonNode podDefinition = mapper.readTree(bytes); return podDefinition; } else { LOG.log(Level.SEVERE, "Failure to receive existing pod from k8s"); return null; } } catch (IOException ioe) { LOG.log(Level.SEVERE, "Unable to parse pod JSON"); return null; } finally { conn.disconnect(); } }</code><technical_language>Is this path this for kubernetes users? Is default else for example</technical_language>

Target:
protected JsonNode getBasePod(String podId) throws IOException { String podURI = String.format( "%s/%s", this.baseUriPath, podId); HttpJsonClient jsonAPIClient = new HttpJsonClient(podURI); JsonNode result; try { result = jsonAPIClient.get(HttpURLConnection.HTTP_OK); } catch (IOException ioe) { throw ioe; } return result; }
Source:
<code>public SpliceDefaultCompactor(final Configuration conf, final Store store, long smallestReadPoint) { <START> super(conf, store); <END> }</code><technical_language>call super(conf, store, smallestReadPoint) instead</technical_language>

Target:
public SpliceDefaultCompactor(final Configuration conf, final Store store, long smallestReadPoint) { super(conf, store, smallestReadPoint); }
Source:
<code>private void refreshClusterHeavyWeightData(VDSGroup cluster) { VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); if (upServer == null) { log.debug("No server UP in cluster '{}'. Can't refresh it's data at this point.", cluster.getName()); return; } for (GlusterVolumeEntity volume : getVolumeDao().getByClusterId(cluster.getId())) { log.debug("Refreshing brick statuses for volume '{}' of cluster '{}'", volume.getName(), cluster.getName()); if (volume.isOnline()) { acquireLock(cluster.getId()); try { refreshVolumeDetails(upServer, volume); } catch (Exception e) { log.error("Error while refreshing brick statuses for volume '{}' of cluster '{}': {}", volume.getName(), cluster.getName(), e.getMessage()); log.debug("Exception", e); } finally { releaseLock(cluster.getId()); } } } <START> for (GlusterVolumeEntity volume : getVolumeDao().getByClusterId(cluster.getId())) { <END> if (volume.getName().equals(Config.<String> getValue(ConfigValues.GlusterMetaVolumeName))) { log.debug("Mounting gluster meta volume on nodes of cluster '{}'", cluster.getName()); acquireLock(cluster.getId()); try { mountMetaVolumeOnNodes(volume.getClusterId()); } catch (Exception e) { log.error("Error while mounting the gluster meta volume on nodes of cluster '{}': {}", cluster.getName(), e.getMessage()); log.debug("Exception", e); } finally { releaseLock(cluster.getId()); } } } }</code><technical_language>this done a new volume is detected - i.e in createVolume() flow</technical_language>

Target:
private void refreshClusterHeavyWeightData(VDSGroup cluster) { VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); if (upServer == null) { log.debug("No server UP in cluster '{}'. Can't refresh it's data at this point.", cluster.getName()); return; } for (GlusterVolumeEntity volume : getVolumeDao().getByClusterId(cluster.getId())) { log.debug("Refreshing brick statuses for volume '{}' of cluster '{}'", volume.getName(), cluster.getName()); if (volume.isOnline()) { acquireLock(cluster.getId()); try { refreshVolumeDetails(upServer, volume); } catch (Exception e) { log.error("Error while refreshing brick statuses for volume '{}' of cluster '{}': {}", volume.getName(), cluster.getName(), e.getMessage()); log.debug("Exception", e); } finally { releaseLock(cluster.getId()); } } } }
Source:
<code>protected Toolbar createMainToolbar() { Toolbar toolbar = new Toolbar("Find Output Tab"); searchLabel_ = new Label(); toolbar.addLeftWidget(searchLabel_); stopSearch_ = new ToolbarButton( ToolbarButton.NoText, "Stop find in files", commands_.interruptR().getImageResource()); stopSearch_.setVisible(false); toolbar.addRightWidget(stopSearch_); showFindButton_ = new LeftRightToggleButton("Find", "Replace", false); showFindButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!replaceMode_) { showFindButton_.setVisible(false); showReplaceButton_.setVisible(true); setReplaceMode(true); setSecondaryToolbarVisible(true); if (displayPreview_ == null) createDisplayPreview(); if (!replaceTextBox_.getValue().isEmpty()) displayPreview_.nudge(); } } }); toolbar.addRightWidget(showFindButton_); showReplaceButton_ = new LeftRightToggleButton("Find", "Replace", true); showReplaceButton_.setVisible(false); showReplaceButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (replaceMode_) { showFindButton_.setVisible(true); showReplaceButton_.setVisible(false); setSecondaryToolbarVisible(false); if (!replaceTextBox_.getValue().isEmpty()) { setRegexPreviewMode(false); addReplaceMatches(new String()); } setReplaceMode(false); } } }); <START> toolbar.addRightWidget(showReplaceButton_); <END> return toolbar; }</code><technical_language>buttons alternate</technical_language>

Target:
protected Toolbar createMainToolbar() { Toolbar toolbar = new Toolbar("Find Output Tab"); searchLabel_ = new Label(); toolbar.addLeftWidget(searchLabel_); stopSearch_ = new ToolbarButton( ToolbarButton.NoText, "Stop find in files", commands_.interruptR().getImageResource()); stopSearch_.setVisible(false); toolbar.addRightWidget(stopSearch_); showFindButton_ = new LeftRightToggleButton("Find", "Replace", true); showFindButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!replaceMode_) { showFindButton_.setVisible(false); showReplaceButton_.setVisible(true); setReplaceMode(true); setSecondaryToolbarVisible(true); if (displayPreview_ == null) createDisplayPreview(); if (!replaceTextBox_.getValue().isEmpty()) displayPreview_.nudge(); } } }); toolbar.addRightWidget(showFindButton_); showReplaceButton_ = new LeftRightToggleButton("Find", "Replace", false); showReplaceButton_.setVisible(false); showReplaceButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (replaceMode_) { showFindButton_.setVisible(true); showReplaceButton_.setVisible(false); setSecondaryToolbarVisible(false); if (!replaceTextBox_.getValue().isEmpty()) { addReplaceMatches(new String()); } setReplaceMode(false); } } }); toolbar.addRightWidget(showReplaceButton_); return toolbar; }
Source:
<code>private void closeScope() { if (openTracingService == null) { return; } Tracer tracer = openTracingService.getTracer(PAYARA_CORBA_RMI_TRACER_NAME); if (tracer == null) { return; } <START> try (Scope activeScope = tracer.scopeManager().active()) { <END> } }</code><technical_language>activeScope, wrong..</technical_language>

Target:
private void closeScope() { if (!tracerAvailable()) { return; } try (Scope activeScope = tracer.scopeManager().active()) { } }
Source:
<code>public C anyRequest() { <START> if (this.anyRequestConfigured) { <END> Assert.state(!anyRequestConfigured, "Can't configure anyRequest after itself"); } this.anyRequestConfigured = true; return requestMatchers(ANY_REQUEST); }</code><technical_language>Sorry, I explain this well. Assert.state do if check for well, remove that, too</technical_language>

Target:
public C anyRequest() { Assert.state(!this.anyRequestConfigured, "Can't configure anyRequest after itself"); C configurer = requestMatchers(ANY_REQUEST); this.anyRequestConfigured = true; return configurer; }
Source:
<code>private String applyUrlRewrites(String url) { <START> for (String rewrite : urlRewrites) { <END> if (!rewrite.contains(":") || rewrite.startsWith(":")) { continue; } String[] tokens = rewrite.split(":"); String path = tokens[0]; String replacement = tokens.length > 1 ? tokens[1] : ""; if (url.contains(path)) { url = url.replaceFirst(path, replacement); break; } } return url; }</code><technical_language>more efficient (or atleast clear) if, in activate(..) parse params out a Map [1] Map<String, String> rewrites = ParameterUtil.toMap(urlRewrites, ":"); in this check parsed map values? [1] <LINK_0></technical_language>

Target:
private String applyUrlRewrites(String url) { try { String path = URI.create(url).getPath(); for (Map.Entry<String, String> rewrite : urlRewrites.entrySet()) { if (path.startsWith(rewrite.getKey())) { return url.replaceFirst(rewrite.getKey(), rewrite.getValue()); } } return url; } catch (IllegalArgumentException e) { return url; } }
Source:
<code>public static Comment newComment(long issueId, int newCommentId, String comment) { DateTime now = DateTime.now(); <START> Long id = Long.parseLong(issueId + "0" + newCommentId); <END> URI selfUri = URI.create(TEST_JIRA_URL + "/rest/api/latest/issue/" + issueId + "/comment"); return new Comment(selfUri, comment, null, null, now, null, null, id); }</code><technical_language>it, please change this long primitive type? :)</technical_language>

Target:
public static Comment newComment(long issueId, int newCommentId, String comment) { DateTime now = DateTime.now(); long id = Long.parseLong(issueId + "0" + newCommentId); URI selfUri = URI.create(TEST_JIRA_URL + "/rest/api/latest/issue/" + issueId + "/comment"); return new Comment(selfUri, comment, null, null, now, null, null, id); }
Source:
<code>public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { recipientToRecipientStats.computeIfAbsent(response.recipient, (String recipient) -> { String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); return new RubricRecipientStatistics(recipient, recipientName, recipientTeam); }); <START> recipientToRecipientStats.get(response.recipient).addResponseToRecipientStats(response); <END> } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); Collections.sort(recipientStatsList, new Comparator<Map.Entry<String, RubricRecipientStatistics>>() { @Override public int compare(Entry<String, RubricRecipientStatistics> o1, Entry<String, RubricRecipientStatistics> o2) { RubricRecipientStatistics a = o1.getValue(); RubricRecipientStatistics b = o2.getValue(); if (a.recipientTeam.equalsIgnoreCase(b.recipientTeam)) { return a.recipientName.compareTo(b.recipientName); } else { return a.recipientTeam.compareTo(b.recipientTeam); } } }); return recipientStatsList; }</code><technical_language>do method chaining also? java recipientToRecipientStats.computeIfAbsent(...) .addResponseToRecipientStats(response);</technical_language>

Target:
public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { recipientToRecipientStats.computeIfAbsent(response.recipient, recipient -> { String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); return new RubricRecipientStatistics(recipient, recipientName, recipientTeam); }) .addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); recipientStatsList.sort(Comparator.comparing((Map.Entry<String, RubricRecipientStatistics> obj) -> obj.getValue().recipientTeam.toLowerCase()) .thenComparing(obj -> obj.getValue().recipientName)); return recipientStatsList; }
Source:
<code>private Block createAlternatingNullsBlock(Block testBlock) { BlockBuilder nullsBlockBuilder = type.createBlockBuilder(null, testBlock.getPositionCount()); for (int position = 0; position < testBlock.getPositionCount(); position++) { if (testBlock.isNull(position)) { nullsBlockBuilder.appendNull(); } <START> else if (type.getJavaType() == boolean.class) { <END> type.writeBoolean(nullsBlockBuilder, type.getBoolean(testBlock, position)); } else if (type.getJavaType() == long.class) { type.writeLong(nullsBlockBuilder, type.getLong(testBlock, position)); } else if (type.getJavaType() == double.class) { type.writeDouble(nullsBlockBuilder, type.getDouble(testBlock, position)); } else if (type.getJavaType() == Slice.class) { Slice slice = type.getSlice(testBlock, position); type.writeSlice(nullsBlockBuilder, slice, 0, slice.length()); } else { type.writeObject(nullsBlockBuilder, type.getObject(testBlock, position)); } nullsBlockBuilder.appendNull(); } return nullsBlockBuilder.build(); }</code><technical_language>Add checkState(type instanceof UnknownType)</technical_language>

Target:
private Block createAlternatingNullsBlock(Block testBlock) { BlockBuilder nullsBlockBuilder = type.createBlockBuilder(null, testBlock.getPositionCount()); for (int position = 0; position < testBlock.getPositionCount(); position++) { if (testBlock.isNull(position)) { checkState(type instanceof UnknownType); nullsBlockBuilder.appendNull(); } else if (type.getJavaType() == boolean.class) { type.writeBoolean(nullsBlockBuilder, type.getBoolean(testBlock, position)); } else if (type.getJavaType() == long.class) { type.writeLong(nullsBlockBuilder, type.getLong(testBlock, position)); } else if (type.getJavaType() == double.class) { type.writeDouble(nullsBlockBuilder, type.getDouble(testBlock, position)); } else if (type.getJavaType() == Slice.class) { Slice slice = type.getSlice(testBlock, position); type.writeSlice(nullsBlockBuilder, slice, 0, slice.length()); } else { type.writeObject(nullsBlockBuilder, type.getObject(testBlock, position)); } nullsBlockBuilder.appendNull(); } return nullsBlockBuilder.build(); }
Source:
<code>protected PartialList<String> doQuery(String query, String queryType, QueryFilter queryFilter, int countUpTo) { final Timer.Context timerContext = queryTimer.time(); try { Mutable<String> idKeyHolder = new MutableObject<>(); PartialList<Map<String, Serializable>> pl = doQueryAndFetch(query, queryType, queryFilter, false, countUpTo, idKeyHolder); String idKey = idKeyHolder.getValue(); List<String> ids = new ArrayList<>(pl.size()); for (Map<String, Serializable> map : pl) { Serializable id = map.get(idKey); <START> if (id != null) ids.add(String.valueOf(id)); <END> } return new PartialList<>(ids, pl.totalSize()); } finally { long duration = timerContext.stop(); if (LOG_MIN_DURATION_NS >= 0 && duration > LOG_MIN_DURATION_NS) { String msg = String.format("duration_ms:\t%.2f\t%s %s\tquery\t%s", duration / 1000000.0, queryFilter, countUpToAsString(countUpTo), query); if (log.isTraceEnabled()) { log.info(msg, new Throwable("Slow query stack trace")); } else { log.info(msg); } } } }</code><technical_language>{} blocks for short conditions: if (id != null) { ids.add(String.valueOf(id)); } cast (String) id instead of String.valueOf(id) key turned a String layers, I want hide unexpected change in behavior String.valueOf</technical_language>

Target:
protected PartialList<String> doQuery(String query, String queryType, QueryFilter queryFilter, int countUpTo) { final Timer.Context timerContext = queryTimer.time(); try { Mutable<String> idKeyHolder = new MutableObject<>(); PartialList<Map<String, Serializable>> pl = doQueryAndFetch(query, queryType, queryFilter, false, countUpTo, idKeyHolder); String idKey = idKeyHolder.getValue(); List<String> ids = new ArrayList<>(pl.size()); for (Map<String, Serializable> map : pl) { String id = (String) map.get(idKey); ids.add(id); } return new PartialList<>(ids, pl.totalSize()); } finally { long duration = timerContext.stop(); if (LOG_MIN_DURATION_NS >= 0 && duration > LOG_MIN_DURATION_NS) { String msg = String.format("duration_ms:\t%.2f\t%s %s\tquery\t%s", duration / 1000000.0, queryFilter, countUpToAsString(countUpTo), query); if (log.isTraceEnabled()) { log.info(msg, new Throwable("Slow query stack trace")); } else { log.info(msg); } } } }
Source:
<code>private int longEqual(Object actual, Object expected) { <START> if (!(actual instanceof Number && expected instanceof Number)) { <END> return -1; } Long actualLong = ((Number) actual).longValue(); Long expectedLong = ((Number) expected).longValue(); return actualLong.compareTo(expectedLong); }</code><technical_language>expect instances of type Long provided a separate method for other ints (integerEqual)</technical_language>

Target:
private int longEqual(Object actual, Object expected) { if (!(isLongOrNarrower(actual) && isLongOrNarrower(expected))) { return -1; } Long actualLong = ((Number) actual).longValue(); Long expectedLong = ((Number) expected).longValue(); return actualLong.compareTo(expectedLong); }
Source:
<code>public MistformUltimus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.supertype.add("Legendary"); this.subtype.add("Illusion"); this.power = new MageInt(3); this.toughness = new MageInt(3); <START> this.addAbility(ChangelingAbility.getInstance()); <END> }</code><technical_language>While this do want do, note Mistform Ultimus Changeling ability. This generate incorrect rules text</technical_language>

Target:
public MistformUltimus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.supertype.add("Legendary"); this.subtype.add("Illusion"); this.power = new MageInt(3); this.toughness = new MageInt(3); this.subtype.add(ChangelingAbility.ALL_CREATURE_TYPE); }
Source:
<code>private ClassLoaderLookupPolicy getApplicationClassLoaderLookupPolicy(ArtifactClassLoader parent, ApplicationDescriptor descriptor) { <START> final Map<String, LookupStrategy> pluginsLookupStrategies = new SmallMap<>(); <END> for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) { artifactPluginDescriptor.getClassLoaderModel().getExportedPackages() .forEach(p -> pluginsLookupStrategies.put(p, PARENT_FIRST)); } return parent.getClassLoaderLookupPolicy().extend(pluginsLookupStrategies); }</code><technical_language>hell</technical_language>

Target:
private ClassLoaderLookupPolicy getApplicationClassLoaderLookupPolicy(ArtifactClassLoader parent, ApplicationDescriptor descriptor) { final Map<String, LookupStrategy> pluginsLookupStrategies = new HashMap<>(); for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) { artifactPluginDescriptor.getClassLoaderModel().getExportedPackages() .forEach(p -> pluginsLookupStrategies.put(p, PARENT_FIRST)); } return parent.getClassLoaderLookupPolicy().extend(pluginsLookupStrategies); }
Source:
<code>public SyncLunsParameters(Guid storagePoolId) { <START> super(storagePoolId); <END> }</code><technical_language>This is a code smell. path super. Instead, call this(storagePoolId, null)</technical_language>

Target:
public SyncLunsParameters(Guid storagePoolId) { this(storagePoolId, null); }
Source:
<code>private static void updateTimeoutLogableObject(AuditLogableBase auditLogable, AuditLogType logType) { <START> int duplicateEventsIntrvalValue = (auditLogable.isExternal()) <END> ? Math.max(auditLogable.getEventFloodInSec(), 30) : logType.getEventFloodRate(); if (duplicateEventsIntrvalValue > 0) { auditLogable.setEndTime(TimeUnit.SECONDS.toMillis(duplicateEventsIntrvalValue)); auditLogable.setTimeoutObjectId(composeObjectId(auditLogable, logType)); } }</code><technical_language>this called eventFloodRate</technical_language>

Target:
private static void updateTimeoutLogableObject(AuditLogableBase auditLogable, AuditLogType logType) { int eventFloodRate = (auditLogable.isExternal()) ? Math.max(auditLogable.getEventFloodInSec(), 30) : logType.getEventFloodRate(); if (eventFloodRate > 0) { auditLogable.setEndTime(TimeUnit.SECONDS.toMillis(eventFloodRate)); auditLogable.setTimeoutObjectId(composeObjectId(auditLogable, logType)); } }
Source:
<code>protected static boolean shouldServiceVersionBeTested(ConfigurationServiceVersion serviceVersion) { if (Configuration.getGlobalConfiguration().get(AZURE_TEST_SERVICE_VERSIONS) == null) { return ConfigurationServiceVersion.getLatest().equals(serviceVersion); } <START> return true; <END> }</code><technical_language>This check in environment variable returning true</technical_language>

Target:
private static boolean shouldServiceVersionBeTested(ConfigurationServiceVersion serviceVersion) { if (CoreUtils.isNullOrEmpty(SERVICE_VERSION_FROM_ENV)) { return ConfigurationServiceVersion.getLatest().equals(serviceVersion); } if (AZURE_TEST_SERVICE_VERSIONS_VALUE_ALL.equalsIgnoreCase(SERVICE_VERSION_FROM_ENV)) { return true; } String[] configuredServiceVersionList = SERVICE_VERSION_FROM_ENV.split(","); return Arrays.stream(configuredServiceVersionList).anyMatch(configuredServiceVersion -> serviceVersion.toString().equals(configuredServiceVersion.trim())); }
Source:
<code>public SpiTransaction createQueryTransaction(Object tenantId) { SpiTransaction t = transactionManager.createQueryTransaction(tenantId); try { <START> transactionScopeManager.set(t); <END> } catch (PersistenceException existingTransactionError) { t.end(); throw existingTransactionError; } return t; }</code><technical_language>This breaks MySql in theory ... DefaultBeanLoader line 224</technical_language>

Target:
public SpiTransaction createQueryTransaction(Object tenantId) { SpiTransaction t = transactionManager.createQueryTransaction(tenantId); return t; }
Source:
<code><START> public Map<Integer, String> getExperimentSampleMap(final Integer studyDbId) { <END> Map<Integer, String> samplesMap = new HashMap<>(); try { final SQLQuery query = this.getSession().createSQLQuery(SQL_SAMPLES_AND_EXPERIMENTS); query.setParameter("studyId", studyDbId); List results = query.list(); for (Object o : results) { Object[] result = (Object[]) o; if (result != null) { samplesMap.put((Integer) result[0], (String) result[1]); } } } catch (HibernateException he) { throw new MiddlewareException( "Unexpected error in executing getExperimentSampleMap(studyDbId = " + studyDbId + ") query: " + he.getMessage(), he); } return samplesMap; }</code><technical_language>check finals</technical_language>

Target:
public Map<Integer, String> getExperimentSampleMap(final Integer studyDbId) { final Map<Integer, String> samplesMap = new HashMap<>(); try { final SQLQuery query = this.getSession().createSQLQuery(SQL_SAMPLES_AND_EXPERIMENTS); query.setParameter("studyId", studyDbId); final List results = query.list(); for (final Object o : results) { final Object[] result = (Object[]) o; if (result != null) { samplesMap.put((Integer) result[0], (String) result[1]); } } } catch (HibernateException he) { throw new MiddlewareException( "Unexpected error in executing getExperimentSampleMap(studyDbId = " + studyDbId + ") query: " + he.getMessage(), he); } return samplesMap; }
Source:
<code>void peekWithSequenceOneMessage() { final int numberOfEvents = 1; final int fromSequenceNumber = 10; when(managementNode.peek(fromSequenceNumber)) <START> .thenReturn(Mono.just(mock(ServiceBusReceivedMessage.class))); <END> StepVerifier.create(consumer.peek(fromSequenceNumber)) .expectNextCount(numberOfEvents) .verifyComplete(); }</code><technical_language>return inline mocks this, need add Mockito.clearInlinMocks() else garbage collected</technical_language>

Target:
void peekWithSequenceOneMessage() { final int numberOfEvents = 1; final int fromSequenceNumber = 10; when(managementNode.peek(fromSequenceNumber)) .thenReturn(just(mock(ServiceBusReceivedMessage.class))); StepVerifier.create(consumer.peek(fromSequenceNumber)) .expectNextCount(numberOfEvents) .verifyComplete(); }
Source:
<code>private List<TestInfo> prioritizeTests(ClassName clazz, Collection<TestInfo> testsForMutant) { <START> final List<TestInfo> sortedTis = FCollection.map(testsForMutant, x -> x); <END> Collections.sort(sortedTis, new TestInfoPriorisationComparator(clazz, TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS)); return sortedTis; }</code><technical_language>I simplify this final List<TestInfo> sortedTis = new ArrayList<>(testsForMutant);</technical_language>

Target:
private List<TestInfo> prioritizeTests(ClassName clazz, Collection<TestInfo> testsForMutant) { final List<TestInfo> sortedTis = new ArrayList<>(testsForMutant); sortedTis.sort(new TestInfoPriorisationComparator(clazz, TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS)); return sortedTis; }
Source:
<code><START> public static boolean isNoneEmpty(CharSequence... css) { <END> if (ArrayUtils.isEmpty(css)) { return false; } for (CharSequence cs : css){ if (isEmpty(cs)) { return false; } } return true; }</code><technical_language>Duplicate police, hands up! :police_car: do return !isAnyEmpty(css) this method? return !isNoneEmpty(css) isAnyEmpty() method? for methods isAnyBlank() isNoneBlank()..</technical_language>

Target:
public static boolean isNoneEmpty(CharSequence... css) { return !isAnyEmpty(css); }
Source:
<code>public static void main(String[] args) { String classifierName = null; String labelerName = null; String parserName = null; String inputFile = null; try { classifierName = args[0]; labelerName = args[1]; parserName = args[2]; <START> inputFile = args[3]; <END> if (args.length > 4) throw new Exception(); } catch (Exception e) { logger.error( "usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.seg.BIOTester <classifier> <labeler> <parser> <test file>"); System.exit(1); } Classifier classifier = ClassUtils.getClassifier(classifierName); Classifier labeler = ClassUtils.getClassifier(labelerName); Parser parser = ClassUtils.getParser(parserName, new Class[]{String.class}, new String[]{inputFile}); new BIOTester(classifier, labeler, parser) .test().printPerformance(System.out); }</code><technical_language>exception, STDERR</technical_language>

Target:
public static void main(String[] args) { String classifierName = null; String labelerName = null; String parserName = null; String inputFile = null; try { classifierName = args[0]; labelerName = args[1]; parserName = args[2]; inputFile = args[3]; if (args.length > 4) throw new Exception(); } catch (Exception e) { System.err.println( "usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.seg.BIOTester <classifier> <labeler> <parser> <test file>"); System.exit(1); } Classifier classifier = ClassUtils.getClassifier(classifierName); Classifier labeler = ClassUtils.getClassifier(labelerName); Parser parser = ClassUtils.getParser(parserName, new Class[]{String.class}, new String[]{inputFile}); new BIOTester(classifier, labeler, parser) .test().printPerformance(System.out); }
Source:
<code>public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); try { startAcceptors(); } catch (IOException e) { <START> shutdown(); <END> throw e; } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }</code><technical_language>if this is required. I caller shutting start() method. if this is huge change</technical_language>

Target:
public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); logger.info("Starting acceptor threads"); Acceptor plainTextAcceptor = new Acceptor(host, port, processors, sendBufferSize, recvBufferSize, metrics); this.acceptors.add(plainTextAcceptor); Utils.newThread("ambry-acceptor", plainTextAcceptor, false).start(); Port sslPort = ports.get(PortType.SSL); if (sslPort != null) { SSLAcceptor sslAcceptor = new SSLAcceptor(host, sslPort.getPort(), processors, sendBufferSize, recvBufferSize, metrics); acceptors.add(sslAcceptor); Utils.newThread("ambry-sslacceptor", sslAcceptor, false).start(); } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }
Source:
<code>private void clearDestinationHost() { nicsMap.values().forEach(nic -> <START> { <END> if (nic.isPartOfBond()) { Guid bondId = calcDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(bondId); List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(bondId); attachmentsToRemove.addAll(destAttachmentIds); } List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(nic.getId()); attachmentsToRemove.addAll(destAttachmentIds); }); }</code><technical_language>{ Guid idToRemove = nic.getId();</technical_language>

Target:
private void clearDestinationHost() { nicsMap.values().forEach(nic -> { Guid idToRemove = nic.getId(); if (nic.isPartOfBond()) { idToRemove = calcDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(idToRemove); } List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(idToRemove); attachmentsToRemove.addAll(destAttachmentIds); }); }