auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testLaunchWithAppProperties() throws Exception { repository.save(new TaskDefinition("myTask2", "foo2 --common.prop2=wizz")); this.registry.register("task.foo2", new URI("file:src/test/resources/apps/foo-task")); mockMvc.perform(post("/tasks/executions").param("name", "myTask2") <START> .contentType(MediaType.APPLICATION_FORM_URLENCODED) <END> .accept(MediaType.APPLICATION_JSON)) .andDo(print()).andExpect(status().isCreated()); ArgumentCaptor<AppDeploymentRequest> argumentCaptor = ArgumentCaptor.forClass(AppDeploymentRequest.class); verify(this.taskLauncher, atLeast(1)).launch(argumentCaptor.capture()); AppDeploymentRequest request = argumentCaptor.getValue(); assertThat(request.getDefinition().getProperties(), hasEntry("common.prop2", "wizz")); assertEquals("myTask2", request.getDefinition().getProperties().get("spring.cloud.task.name")); }</code><technical_language>If leave out content type, work? I ask want break API, I tests for here</technical_language>

Target:
public void testLaunchWithAppProperties() throws Exception { repository.save(new TaskDefinition("myTask2", "foo2 --common.prop2=wizz")); this.registry.register("task.foo2", new URI("file:src/test/resources/apps/foo-task")); mockMvc.perform(post("/tasks/executions").param("name", "myTask2") .accept(MediaType.APPLICATION_JSON)) .andDo(print()).andExpect(status().isCreated()); ArgumentCaptor<AppDeploymentRequest> argumentCaptor = ArgumentCaptor.forClass(AppDeploymentRequest.class); verify(this.taskLauncher, atLeast(1)).launch(argumentCaptor.capture()); AppDeploymentRequest request = argumentCaptor.getValue(); assertThat(request.getDefinition().getProperties(), hasEntry("common.prop2", "wizz")); assertEquals("myTask2", request.getDefinition().getProperties().get("spring.cloud.task.name")); }
Source:
<code>private void parse(String expression) throws IllegalArgumentException { <START> if (expression == null) { <END> throw new IllegalArgumentException("Cron expression cannot be null!"); } String[] fields = StringUtils.tokenizeToStringArray(expression, " "); if (!areValidCronFields(fields)) { throw new IllegalArgumentException(String.format( "Cron expression must consist of 6 fields (found %d in \"%s\")", fields.length, expression)); } setNumberHits(this.seconds, fields[0], 0, 60); setNumberHits(this.minutes, fields[1], 0, 60); setNumberHits(this.hours, fields[2], 0, 24); setDaysOfMonth(this.daysOfMonth, fields[3]); setMonths(this.months, fields[4]); setDays(this.daysOfWeek, replaceOrdinals(fields[5], "SUN,MON,TUE,WED,THU,FRI,SAT"), 8); if (this.daysOfWeek.get(7)) { this.daysOfWeek.set(0); this.daysOfWeek.clear(7); } }</code><technical_language>standard of spring exceptions thrown org.springframework.util.Assert Assert.isNull(expression, "Cron expression null!")</technical_language>

Target:
private void parse(String expression) throws IllegalArgumentException { Assert.notNull(expression, "Cron expression cannot be null!"); String[] fields = StringUtils.tokenizeToStringArray(expression, " "); if (!areValidCronFields(fields)) { throw new IllegalArgumentException(String.format( "Cron expression must consist of 6 fields (found %d in \"%s\")", fields.length, expression)); } setNumberHits(this.seconds, fields[0], 0, 60); setNumberHits(this.minutes, fields[1], 0, 60); setNumberHits(this.hours, fields[2], 0, 24); setDaysOfMonth(this.daysOfMonth, fields[3]); setMonths(this.months, fields[4]); setDays(this.daysOfWeek, replaceOrdinals(fields[5], "SUN,MON,TUE,WED,THU,FRI,SAT"), 8); if (this.daysOfWeek.get(7)) { this.daysOfWeek.set(0); this.daysOfWeek.clear(7); } }
Source:
<code>public String docs() { <START> return "mixed {string, closure} Synchronizes the code in the closure for all calls with the same string argument." <END> + " This means that if two threads will call " + getName() + "('example', @someClosure), the second call" + " will hang the thread until the code in the closure of the first call has finished executing." + " If you call this function from within a closure in this function, the closure will simply be executed." + " Returns the return value of the closure."; }</code><technical_language>This needs more details. Synchronization is a simple topic, need a bit more this, I think. Also, examples added</technical_language>

Target:
public String docs() { return "void {syncObject, code} Synchronizes access to the code block for all calls (from different" + " threads) with the same syncObject argument." + " This means that if two threads will call " + getName() + "('example', <code>), the second" + " call will hang the thread until the passed code of the first call has finished executing." + " If you call this function from within this function on the same thread using the same" + " syncObject, the code will simply be executed." + " For more information about synchronization, see:" + " <LINK_0>"; }
Source:
<code><START> public Collection<SituationsMonitor> getSituationsMonitors(final Long serviceInstanceId) { <END> Collection<SituationsMonitor> results = Lists.newArrayList(); for (final SituationsMonitor monitor : this.getSituationsMonitors()) { if (monitor.getServiceInstance() != null && monitor.getServiceInstance().getId().equals(serviceInstanceId)) { results.add(monitor); } } return results; }</code><technical_language>return this.getSituationsMonitors().stream().filter(monitor -> monitor.getServiceInstance() != null && monitor.getServiceInstance().getId().equals(serviceInstanceId)).collect(Collectors.toList()); ? I guess :-)</technical_language>

Target:
public Collection<SituationsMonitor> getSituationsMonitors(final Long serviceInstanceId) { return this.getSituationsMonitors().stream().filter(monitor -> monitor.getServiceInstance() != null && monitor.getServiceInstance().getId().equals(serviceInstanceId)).collect(Collectors.toList()); }
Source:
<code>public V get(final K key) { getObserver.begin(); statusTransitioner.checkAvailable(); checkNonNull(key); try { final Store.ValueHolder<V> valueHolder = store.get(key); if (valueHolder == null) { <START> getObserver.end(org.ehcache.core.statistics.CacheOperationOutcomes.GetOutcome.MISS_NO_LOADER); <END> return null; } else { getObserver.end(org.ehcache.core.statistics.CacheOperationOutcomes.GetOutcome.HIT_NO_LOADER); return valueHolder.value(); } } catch (StoreAccessException e) { try { return resilienceStrategy.getFailure(key, e); } finally { getObserver.end(org.ehcache.core.statistics.CacheOperationOutcomes.GetOutcome.FAILURE); } } }</code><technical_language>Revert this change - FQN degrades readability</technical_language>

Target:
public V get(final K key) { getObserver.begin(); statusTransitioner.checkAvailable(); checkNonNull(key); try { final Store.ValueHolder<V> valueHolder = store.get(key); if (valueHolder == null) { getObserver.end(GetOutcome.MISS_NO_LOADER); return null; } else { getObserver.end(GetOutcome.HIT_NO_LOADER); return valueHolder.value(); } } catch (StoreAccessException e) { try { return resilienceStrategy.getFailure(key, e); } finally { getObserver.end(GetOutcome.FAILURE); } } }
Source:
<code>private RollingUpdateOp rollingUpdateDeploy(final ZooKeeperClient client, final RollingUpdateOpFactory opFactory, final DeploymentGroup deploymentGroup, final String host) { final Deployment deployment = Deployment.of(deploymentGroup.getJobId(), Goal.START, Deployment.EMTPY_DEPLOYER_USER, this.name, deploymentGroup.getName()); try { <START> final String token = deploymentGroup.getRolloutOptions().getToken() == null ? <END> Job.EMPTY_TOKEN : deploymentGroup.getRolloutOptions().getToken(); return opFactory.nextTask(getDeployOperations(client, host, deployment, token)); } catch (JobDoesNotExistException e) { return opFactory.error(e, host, RollingUpdateError.JOB_NOT_FOUND); } catch (TokenVerificationException e) { return opFactory.error(e, host, RollingUpdateError.TOKEN_VERIFICATION_ERROR); } catch (HostNotFoundException e) { return opFactory.error(e, host, RollingUpdateError.HOST_NOT_FOUND); } catch (JobPortAllocationConflictException e) { return opFactory.error(e, host, RollingUpdateError.PORT_CONFLICT); } catch (JobAlreadyDeployedException e) { return opFactory.nextTask(); } }</code><technical_language>If want, do: final String token = firstNonNull(deploymentGroup.getRolloutOptions.getToken(), Job.EMPTY_TOKEN);</technical_language>

Target:
private RollingUpdateOp rollingUpdateDeploy(final ZooKeeperClient client, final RollingUpdateOpFactory opFactory, final DeploymentGroup deploymentGroup, final String host) { final Deployment deployment = Deployment.of(deploymentGroup.getJobId(), Goal.START, Deployment.EMTPY_DEPLOYER_USER, this.name, deploymentGroup.getName()); try { final String token = firstNonNull(deploymentGroup.getRolloutOptions().getToken(), Job.EMPTY_TOKEN); return opFactory.nextTask(getDeployOperations(client, host, deployment, token)); } catch (JobDoesNotExistException e) { return opFactory.error(e, host, RollingUpdateError.JOB_NOT_FOUND); } catch (TokenVerificationException e) { return opFactory.error(e, host, RollingUpdateError.TOKEN_VERIFICATION_ERROR); } catch (HostNotFoundException e) { return opFactory.error(e, host, RollingUpdateError.HOST_NOT_FOUND); } catch (JobPortAllocationConflictException e) { return opFactory.error(e, host, RollingUpdateError.PORT_CONFLICT); } catch (JobAlreadyDeployedException e) { return opFactory.nextTask(); } }
Source:
<code>private double findSortWeight(int index) { int size = getOrders().size(); if (size == 1) return 10.0; <START> if (index == 0) <END> return getOrders().get(1).getSortWeight() / 2; if (index == size - 1) return getOrders().get(index - 1).getSortWeight() + 10.0; return (getOrders().get(index - 1).getSortWeight() + getOrders().get(index + 1).getSortWeight()) / 2; }</code><technical_language>convention is include curly braces if clauses</technical_language>

Target:
private double findSortWeight(int index) { int size = getOrders().size(); if (size == 1) { return 10.0; } if (index == 0) { return getOrders().get(1).getSortWeight() / 2; } if (index == size - 1) { return getOrders().get(index - 1).getSortWeight() + 10.0; } return (getOrders().get(index - 1).getSortWeight() + getOrders().get(index + 1).getSortWeight()) / 2; }
Source:
<code>protected void setUp() throws Exception { super.setUp(); knownRepositories = KnownRepositories.getInstance(); savedRepositories = knownRepositories.getRepositories(); for (ICVSRepositoryLocation <START> savedRepositorie : <END> savedRepositories) { knownRepositories.disposeRepository(savedRepositorie); } }</code><technical_language>savedRepository</technical_language>

Target:
protected void setUp() throws Exception { super.setUp(); knownRepositories = KnownRepositories.getInstance(); savedRepositories = knownRepositories.getRepositories(); for (ICVSRepositoryLocation savedRepository : savedRepositories) { knownRepositories.disposeRepository(savedRepository); } }
Source:
<code>public void notifySuperUsers(String messageCode, Exception cause, Object... messageArguments) { String message = Context.getMessageSourceService().getMessage(messageCode, messageArguments, Context.getLocale()); if (cause != null) { StringBuilder stackTrace = new StringBuilder(); for (StackTraceElement traceElement : cause.getStackTrace()) { stackTrace.append(traceElement); stackTrace.append("\n"); if (stackTrace.length() >= Alert.TEXT_MAX_LENGTH) { break; } } message = message + ":" + stackTrace; message = message.substring(0, Math.min(message.length(), Alert.TEXT_MAX_LENGTH)); } Alert alert = new Alert(message, Context.getUserService().getUsersByRole(new Role(RoleConstants.SUPERUSER))); alert.setSatisfiedByAny(true); if (alert.getCreator() == null) { try{ <START> JdbcConnection connection = (JdbcConnection) DatabaseUpdater.getConnection(); <END> Integer userId = getInt(connection, "SELECT min(user_id) FROM users"); if (userId >= 1) { alert.setCreator(new User(userId)); } } catch(Exception e){ } } Context.getAlertService().saveAlert(alert); }</code><technical_language>AlertService instead of raw JDBC</technical_language>

Target:
public void notifySuperUsers(String messageCode, Exception cause, Object... messageArguments) { String message = Context.getMessageSourceService().getMessage(messageCode, messageArguments, Context.getLocale()); if (cause != null) { StringBuilder stackTrace = new StringBuilder(); for (StackTraceElement traceElement : cause.getStackTrace()) { stackTrace.append(traceElement); stackTrace.append("\n"); if (stackTrace.length() >= Alert.TEXT_MAX_LENGTH) { break; } } message = message + ":" + stackTrace; message = message.substring(0, Math.min(message.length(), Alert.TEXT_MAX_LENGTH)); } Alert alert = new Alert(message, Context.getUserService().getUsersByRole(new Role(RoleConstants.SUPERUSER))); alert.setSatisfiedByAny(true); if (alert.getCreator() == null) { try { JdbcConnection connection = (JdbcConnection) DatabaseUpdater.getConnection(); Integer userId = getInt(connection, "SELECT min(user_id) FROM users"); if (userId >= 1) { alert.setCreator(new User(userId)); } } } Context.getAlertService().saveAlert(alert); }
Source:
<code>public List<String> getColumnsCopy() { return new <START> ArrayList<String>(m_columns); <END> }</code><technical_language>This exposes unicode workaround public</technical_language>

Target:
public List<String> getColumnsCopy() { List<String> list = new ArrayList<String>(); for (String string : m_columns) { if (StringConstants.UNICODE_NULL.equals(string)) { list.add(null); } else { list.add(string); } } return list; }
Source:
<code>protected void onDestroy() { super.onDestroy(); if (mapboxMap != null) { mapboxMap.removeOnMapClickListener(this); } <START> mapView.onDestroy(); <END> }</code><technical_language>stopping animations in this example potentially crash selecting a symbol closing activity quickly after</technical_language>

Target:
protected void onDestroy() { super.onDestroy(); if (mapboxMap != null) { mapboxMap.removeOnMapClickListener(this); } if (markerAnimator != null) { markerAnimator.cancel(); } mapView.onDestroy(); }
Source:
<code>public MultipleColumnPrefixFilter(final byte [][] prefixes) { if (prefixes != null) { for (int i = 0; i < prefixes.length; i++) { if (!sortedPrefixes.add(prefixes[i])) { LOG.error("prefix is repeated", Bytes.toString(prefixes[i])); <START> throw new IllegalArgumentException("prefixes must be distinct"); <END> } } } }</code><technical_language>this improvement, improve looping also: for (byte[] prefix : prefixes) { if (!sortedPrefixes.add(prefix)){ } }</technical_language>

Target:
public MultipleColumnPrefixFilter(final byte [][] prefixes) { if (prefixes != null) { for (byte[] prefix : prefixes) { if (!sortedPrefixes.add(prefix)) { LOG.error("prefix is repeated", Bytes.toString(prefix)); throw new IllegalArgumentException("prefixes must be distinct"); } } } }
Source:
<code>public static String configureDemoCertWithDN(String[] dn, @Nullable String[] subjectAltNames) { CertificateSigningRequest csr = new CertificateSigningRequest(); csr.setDistinguishedName(dn); if (subjectAltNames != null) { csr.addSubjectAlternativeNames(subjectAltNames); } <START> String commonName = <END> Arrays.stream(dn) .filter(str -> str.startsWith("cn=")) .findFirst() .orElseThrow(() -> new IllegalArgumentException("CN is a required attribute on the DN")) .split("=")[1]; csr.addSubjectAlternativeNames(String.format("DNS:%s", commonName)); RDN[] rdns = csr.getSubjectName().getRDNs(BCStyle.CN); Validate.isTrue( rdns != null && rdns.length == 1, "CN attribute must be included in distinguished name"); return configureCert(rdns[0].getFirst().getValue().toString(), csr); }</code><technical_language>question</technical_language>

Target:
public static String configureDemoCertWithDN(String[] dn, @Nullable String[] subjectAltNames) { CertificateSigningRequest csr = new CertificateSigningRequest(); csr.setDistinguishedName(dn); String commonName = csr.getSubjectName().getRDNs(BCStyle.CN)[0].getFirst().getValue().toString(); csr.addSubjectAlternativeNames(String.format("DNS:%s", commonName)); if (subjectAltNames != null) { csr.addSubjectAlternativeNames(subjectAltNames); } RDN[] rdns = csr.getSubjectName().getRDNs(BCStyle.CN); Validate.notNull(rdns, "RDN Array cannot be null"); Validate.isTrue(rdns.length == 1, "CN attribute must be included in distinguished name"); return configureCert(rdns[0].getFirst().getValue().toString(), csr); }
Source:
<code>private String outputAttachments(Resource assignmentResource, Set<String> attachments, String prefix) throws PermissionException, IdUnusedException, TypeException, ServerOverloadException { StringBuilder sb = new StringBuilder("<ul>"); for (String sakaiId: attachments) { if (sakaiId.startsWith("/content/")) { sakaiId = sakaiId.substring("/content".length()); } <START> String URL = null; <END> if (!sakaiId.startsWith(" ContentResource res = exportUtil.getContentResource(sakaiId); if (exportUtil.isLink(res)) { URL = new String(res.getContent()); } } String location = attachmentMap.get(sakaiId).getLocation(); int lastSlash = sakaiId.lastIndexOf("/"); String lastAtom = sakaiId.substring(lastSlash + 1); if (URL != null) { sb.append("<li><a href=\"" + URL + "\">" + StringEscapeUtils.escapeHtml(URL) + "</a></li>"); } else { URL = prefix + Validator.escapeUrl(location); URL = URL.replaceAll(" sb.append("<li><a href=\"" + URL + "\">" + StringEscapeUtils.escapeHtml(lastAtom) + "</a></li><br/>"); } sb.append("</ul>"); } return sb.toString(); }</code><technical_language>caps is for static constants, url instead</technical_language>

Target:
private String outputAttachments(Resource assignmentResource, Set<String> attachments, String prefix) throws PermissionException, IdUnusedException, TypeException, ServerOverloadException { StringBuilder sb = new StringBuilder("<ul>"); for (String sakaiId: attachments) { if (sakaiId.startsWith("/content/")) { sakaiId = sakaiId.substring("/content".length()); } String url = null; if (!sakaiId.startsWith(" ContentResource res = exportUtil.getContentResource(sakaiId); if (exportUtil.isLink(res)) { url = new String(res.getContent()); } } String location = attachmentMap.get(sakaiId).getLocation(); int lastSlash = sakaiId.lastIndexOf("/"); String lastAtom = sakaiId.substring(lastSlash + 1); if (url != null) { sb.append("<li><a href=\"" + url + "\">" + StringEscapeUtils.escapeHtml(url) + "</a></li>"); } else { url = prefix + Validator.escapeUrl(location); url = url.replaceAll(" sb.append("<li><a href=\"" + url + "\">" + StringEscapeUtils.escapeHtml(lastAtom) + "</a></li><br/>"); } sb.append("</ul>"); } return sb.toString(); }
Source:
<code>public RyaClient( final Install install, final Optional<CreatePCJ> createPcj, final Optional<DeletePCJ> deletePcj, final Optional<CreatePeriodicPCJ> createPeriodicPcj, final Optional<DeletePeriodicPCJ> deletePeriodicPcj, final Optional<ListIncrementalQueries> listIncrementalQueries, final Optional<BatchUpdatePCJ> batchUpdatePcj, final GetInstanceDetails getInstanceDetails, final InstanceExists instanceExists, final ListInstances listInstances, final Optional<AddUser> addUser, final Optional<RemoveUser> removeUser, final Uninstall uninstall, final LoadStatements loadStatements, final LoadStatementsFile loadStatementsFile, final ExecuteSparqlQuery executeSparqlQuery) { this.install = requireNonNull(install); this.createPcj = requireNonNull(createPcj); this.deletePcj = requireNonNull(deletePcj); this.createPeriodicPcj = requireNonNull(createPeriodicPcj); this.deletePeriodicPcj = requireNonNull(deletePeriodicPcj); this.listIncrementalQueries = requireNonNull(listIncrementalQueries); this.bactchUpdatePCJ = requireNonNull(batchUpdatePcj); this.getInstanceDetails = requireNonNull(getInstanceDetails); this.instanceExists = requireNonNull(instanceExists); this.listInstances = requireNonNull(listInstances); this.addUser = requireNonNull(addUser); <START> this.removeUser = requireNonNull(removeUser); <END> this.uninstall = requireNonNull(uninstall); this.loadStatements = loadStatements; this.loadStatementsFile = loadStatementsFile; this.executeSparqlQuery = executeSparqlQuery; }</code><technical_language>null checks get removed</technical_language>

Target:
public RyaClient( final Install install, final Optional<CreatePCJ> createPcj, final Optional<DeletePCJ> deletePcj, final Optional<CreatePeriodicPCJ> createPeriodicPcj, final Optional<DeletePeriodicPCJ> deletePeriodicPcj, final Optional<ListIncrementalQueries> listIncrementalQueries, final Optional<BatchUpdatePCJ> batchUpdatePcj, final GetInstanceDetails getInstanceDetails, final InstanceExists instanceExists, final ListInstances listInstances, final Optional<AddUser> addUser, final Optional<RemoveUser> removeUser, final Uninstall uninstall, final LoadStatements loadStatements, final LoadStatementsFile loadStatementsFile, final ExecuteSparqlQuery executeSparqlQuery) { this.install = requireNonNull(install); this.createPcj = requireNonNull(createPcj); this.deletePcj = requireNonNull(deletePcj); this.createPeriodicPcj = requireNonNull(createPeriodicPcj); this.deletePeriodicPcj = requireNonNull(deletePeriodicPcj); this.listIncrementalQueries = requireNonNull(listIncrementalQueries); this.bactchUpdatePCJ = requireNonNull(batchUpdatePcj); this.getInstanceDetails = requireNonNull(getInstanceDetails); this.instanceExists = requireNonNull(instanceExists); this.listInstances = requireNonNull(listInstances); this.addUser = requireNonNull(addUser); this.removeUser = requireNonNull(removeUser); this.uninstall = requireNonNull(uninstall); this.loadStatements = requireNonNull(loadStatements); this.loadStatementsFile = requireNonNull(loadStatementsFile); this.executeSparqlQuery = requireNonNull(executeSparqlQuery); }
Source:
<code>public void cancel(Locality locality) { <START> for (I id: expirationTracker.getTrackedIds()) { <END> if (Thread.currentThread().isInterrupted()) break; if (!locality.isLocal(id)) { this.cancel(id); } } }</code><technical_language>Iterating this set prone ConcurrentModificationExceptions</technical_language>

Target:
public void cancel(Locality locality) { for (I id: this.expirationFutures.keySet()) { if (Thread.currentThread().isInterrupted()) break; if (!locality.isLocal(id)) { this.cancel(id); } } }
Source:
<code>public void selectAllAdvancedOptions() { clickAdvancedButton(); <START> chooseAdvancedOption(0); <END> }</code><technical_language>log()</technical_language>

Target:
public void selectAllAdvancedOptions() { clickAdvancedButton(); chooseAdvancedOption(0); PageObjectLogging.log("selectAllAdvancedOptions", "All advance options are selected", true, driver); }
Source:
<code>public int hashCode() { return AvailableConnectionManager.class.hashCode(); <START> } <END></code><technical_language>I is a reason this class implements equals. default</technical_language>

Target:
public int hashCode() { return Objects.hash(predicate, connectionThatMatched); }
Source:
<code>public OneCoreTickCounters(Integer[] c) { <START> assert (c != null && c.length >= 7); <END> fUser = c[0]; fNice = c[1]; fSystem = c[2]; fIdle = c[3]; fIowait = c[4]; fIrq = c[5]; fSoftirq = c[6]; }</code><technical_language>I if (c == null || c.length < 7) return; else hav NPE</technical_language>

Target:
public OneCoreTickCounters(Integer[] c) { assert (c != null && c.length >= 7); if (c == null || c.length < 7) return; fUser = c[0]; fNice = c[1]; fSystem = c[2]; fIdle = c[3]; fIowait = c[4]; fIrq = c[5]; fSoftirq = c[6]; }
Source:
<code>public void connectionChanged(String property, Object oldValue, Object newValue) { if (ConnectionProperties.PROPERTY_RESOURCE.equals(property)) { if (newValue != null) { IResource newResource = (IResource) newValue; ProjectWrapper projectWrapper = findProjectWrapper(newResource); if (projectWrapper != null) { if (projectWrapper.getResource().equals(newResource)) { projectWrapper.updateWith((IProject) newResource); } else { IResource oldVersion = resourceCache.getCachedVersion(newResource); if (oldVersion == null) { handleAdd(projectWrapper, newResource); } else if (OpenshiftUIModel.isOlder(oldVersion, newResource)) { handleUpdate(projectWrapper, newResource); } } } } else if (oldValue != null) { IResource oldResource = resourceCache.getCachedVersion((IResource) oldValue); if (oldResource != null) { ProjectWrapper projectWrapper = findProjectWrapper(oldResource); handleRemove(projectWrapper, oldResource); } } else { OpenShiftUIActivator.log(IStatus.WARNING, "old and new value are null", <START> new RuntimeException("Warnign origing")); <END> } } else if (ConnectionProperties.PROPERTY_PROJECTS.equals(property) && (newValue instanceof List)) { handleProjectsChanged((List<IProject>)newValue); } }</code><technical_language>spelling of 'warning'</technical_language>

Target:
void connectionChanged(String property, Object oldValue, Object newValue) { if (ConnectionProperties.PROPERTY_RESOURCE.equals(property)) { if (newValue != null) { IResource newResource = (IResource) newValue; ProjectWrapper projectWrapper = findProjectWrapper(newResource); if (projectWrapper != null) { if (projectWrapper.getWrapped().equals(newResource)) { projectWrapper.updateWith((IProject) newResource); } else { IResource oldVersion = resourceCache.getCachedVersion(newResource); if (oldVersion == null) { handleAdd(projectWrapper, newResource); } else if (OpenshiftUIModel.isOlder(oldVersion, newResource)) { handleUpdate(projectWrapper, newResource); } } } } else if (oldValue != null) { IResource oldResource = resourceCache.getCachedVersion((IResource) oldValue); if (oldResource != null) { ProjectWrapper projectWrapper = findProjectWrapper(oldResource); handleRemove(projectWrapper, oldResource); } } else { OpenShiftUIActivator.log(IStatus.WARNING, "old and new value are null", new RuntimeException("Warning origing")); } } else if (ConnectionProperties.PROPERTY_PROJECTS.equals(property) && (newValue instanceof List)) { updateWithResources((List<IProject>)newValue); } }
Source:
<code>private EntityInteractHandler onRightClickEntity() { return (e, item, hand) -> { if ((e.getRightClicked() instanceof Sheep) && (e.getRightClicked() instanceof LivingEntity)) { Sheep s = (Sheep) e.getRightClicked(); if (s.getCustomName() != null) { <START> if (s.getCustomName().equals(ChatColor.DARK_PURPLE+"Tainted Sheep") && s.getColor() == DyeColor.PURPLE) { return; } <END> } if (e.getPlayer().getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, false); } s.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 60, 2)); s.setColor(DyeColor.PURPLE); s.setCustomName(ChatColor.DARK_PURPLE+"Tainted Sheep"); e.setCancelled(true); } }; }</code><technical_language>suggestion return; this</technical_language>

Target:
private EntityInteractHandler onRightClickEntity() { return (e, item, hand) -> { if (e.getRightClicked() instanceof Sheep) { Sheep s = (Sheep) e.getRightClicked(); if (s.getCustomName() != null) { e.setCancelled(true); return; } if (e.getPlayer().getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, false); } s.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 60, 2)); s.setColor(DyeColor.PURPLE); s.setCustomName(ChatColor.DARK_PURPLE + "Tainted Sheep"); e.setCancelled(true); } }; }
Source:
<code>public void does_not_generate_events_for_same_markers() throws Exception { IMarker marker = this.testFile.createMarker(IMarker.PROBLEM); marker.setAttribute(IMarker.LINE_NUMBER, 1); IMarker marker2 = this.testFile.createMarker(IMarker.PROBLEM); marker2.setAttribute(IMarker.LINE_NUMBER, 2); <START> this.workspace.save(true, null); <END> Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); this.testFile.appendContents(generateFileStreamLines(10), true, true, null); this.workspace.save(true, null); Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); ArgumentCaptor<StaticAnalysisWarningEvent> captor = ArgumentCaptor.forClass(StaticAnalysisWarningEvent.class); Mockito.verify(this.trackingEventManager, Mockito.times(2)).addEvent(captor.capture()); assertTrue(captor.getAllValues().stream() .allMatch(event -> event.getType() == TrackingEventType.SA_WARNING_CREATED)); }</code><technical_language>method names do follow camel casing</technical_language>

Target:
public void does_not_generate_events_for_same_markers() throws Exception { IMarker marker = this.testFile.createMarker(IMarker.PROBLEM); marker.setAttribute(IMarker.LINE_NUMBER, 1); IMarker marker2 = this.testFile.createMarker(IMarker.PROBLEM); marker2.setAttribute(IMarker.LINE_NUMBER, 2); this.saveWorkspaceAndWaitForBuild(); this.testFile.appendContents(generateFileStreamLines(10), true, true, null); this.saveWorkspaceAndWaitForBuild(); assertEquals(generatedEvents.size(), 2); assertTrue(generatedEvents.stream() .allMatch(TrackingEventType.SA_WARNING_CREATED::equals)); }
Source:
<code>protected void updateConfiguration() { Configuration configuration = getConfig(); universe = new Universe(MIN_UNIVERSE_ID); receiverNodes.clear(); if (configuration.get(CONFIG_ADDRESS) == null) { receiverNodes.put(new IpNode("localhost:9020"), null); logger.debug("sending to for {}", receiverNodes, this.thing.getUID()); } else { for (IpNode receiverNode : IpNode.fromString((String) configuration.get(CONFIG_ADDRESS), DEFAULT_PORT)) { receiverNodes.put(receiverNode, null); logger.debug("sending to for {}", receiverNode, this.thing.getUID()); } } super.updateConfiguration(); <START> updateStatus(ThingStatus.ONLINE); <END> logger.debug("updated configuration for Lib485 bridge {}", this.thing.getUID()); }</code><technical_language>If do a connection established bridge set ONLINE</technical_language>

Target:
protected void updateConfiguration() { Configuration configuration = getConfig(); universe = new Universe(MIN_UNIVERSE_ID); receiverNodes.clear(); if (configuration.get(CONFIG_ADDRESS) == null) { receiverNodes.put(new IpNode("localhost:9020"), null); logger.debug("sending to for {}", receiverNodes, this.thing.getUID()); } else { try { for (IpNode receiverNode : IpNode.fromString((String) configuration.get(CONFIG_ADDRESS), DEFAULT_PORT)) { receiverNodes.put(receiverNode, null); logger.debug("sending to for {}", receiverNode, this.thing.getUID()); } } catch (IllegalArgumentException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); return; } } super.updateConfiguration(); updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE); logger.debug("updated configuration for Lib485 bridge {}", this.thing.getUID()); }
Source:
<code>private void updateProperties() { String selectedFileFormatDefinitionStr = format.getValue(); if (!StringUtils.isEmpty(selectedFileFormatDefinitionStr) && !StringUtils.equals(previousFormatValue, selectedFileFormatDefinitionStr)) { V props = referenceMemento.get(selectedFileFormatDefinitionStr); if (props == null) { Definition<V> fileFormatDefinition = getDefinitionRegistry().getDefinitionsMapByType(getDefinitionClass()) .get(selectedFileFormatDefinitionStr); props = getDefinitionRegistry().createProperties(fileFormatDefinition, FORMAT_PROPERTIES_NAME); <START> referenceMemento.put(selectedFileFormatDefinitionStr, props); <END> } formatProperties = props; } else if (!StringUtils.isEmpty(selectedFileFormatDefinitionStr) && StringUtils.equals(previousFormatValue, selectedFileFormatDefinitionStr)) { referenceMemento.put(selectedFileFormatDefinitionStr, (V) formatProperties); } else { formatProperties = PropertiesImpl.createNewInstance(PropertiesImpl.class, FORMAT_PROPERTIES_NAME); } previousFormatValue = selectedFileFormatDefinitionStr; }</code><technical_language>Do need this memento, a cache I if this more complicated for nothing</technical_language>

Target:
private void updateProperties() { String selectedFileFormatDefinitionStr = format.getValue(); if (!StringUtils.isEmpty(selectedFileFormatDefinitionStr) && !StringUtils.equals(previousFormatValue, selectedFileFormatDefinitionStr)) { V props = referenceMemento.get(selectedFileFormatDefinitionStr); if (props == null) { Definition<V> fileFormatDefinition = getDefinitionRegistry().getDefinitionsMapByType(getDefinitionClass()) .get(selectedFileFormatDefinitionStr); props = getDefinitionRegistry().createProperties(fileFormatDefinition, FORMAT_PROPERTIES_NAME); referenceMemento.put(selectedFileFormatDefinitionStr, props); } formatProperties = props; } else if (!StringUtils.isEmpty(selectedFileFormatDefinitionStr) && StringUtils.equals(previousFormatValue, selectedFileFormatDefinitionStr)) { referenceMemento.put(selectedFileFormatDefinitionStr, (V) formatProperties); } previousFormatValue = selectedFileFormatDefinitionStr; }
Source:
<code><START> public List<ChangeControl> controlsFor(Iterable<Change> changes) <END> throws NoSuchChangeException { final List<ChangeControl> controls = new ArrayList<ChangeControl>(); for (Change c : changes) { controls.add(controlFor(c)); } return controls; }</code><technical_language>Do want this public</technical_language>

Target:
private List<ChangeControl> controlsFor(Iterable<Change> changes) throws NoSuchChangeException { final List<ChangeControl> controls = new ArrayList<ChangeControl>(); for (Change c : changes) { controls.add(controlFor(c)); } return controls; }
Source:
<code>public void mapGuestAgentSsoFromBackendToRest() throws Exception { SsoMethod backendSsoMethod = SsoMethod.GUEST_AGENT; Sso restSso = SsoMapper.map(backendSsoMethod, null); assertNotNull(restSso); assertNotNull(restSso.getMethods()); assertNotNull(restSso.getMethods().getMethods()); <START> assertTrue(restSso.getMethods().getMethods().size() == 1); <END> assertEquals(org.ovirt.engine.api.model.SsoMethod.GUEST_AGENT.toString(), restSso.getMethods().getMethods().get(0)); }</code><technical_language>assertEquals(restSso.getMethods().size(), 1), if is a failure get actual length of list in error message</technical_language>

Target:
public void mapGuestAgentSsoFromBackendToRest() throws Exception { SsoMethod backendSsoMethod = SsoMethod.GUEST_AGENT; Sso restSso = SsoMapper.map(backendSsoMethod, null); assertNotNull(restSso); assertNotNull(restSso.getMethods()); assertNotNull(restSso.getMethods().getMethods()); assertEquals(1, restSso.getMethods().getMethods().size()); assertEquals(org.ovirt.engine.api.model.SsoMethod.GUEST_AGENT.toString(), restSso.getMethods().getMethods().get(0)); }
Source:
<code>private static void onWriteCompleted(ResultHandler completeHandler, AtomicInteger openInstances, PersistenceManager<?> persistenceManager) { persistenceManager.shutdown(); <START> openInstances.decrementAndGet(); if (openInstances.get() == 0) { <END> log.info("flushAllDataToDisk completed"); UserThread.execute(completeHandler::handleResult); } }</code><technical_language>reduce confusion, suggestion if (openInstances.decrementAndGet() == 0) {</technical_language>

Target:
private static void onWriteCompleted(ResultHandler completeHandler, AtomicInteger openInstances, PersistenceManager<?> persistenceManager) { persistenceManager.shutdown(); if (openInstances.decrementAndGet() == 0) { log.info("flushAllDataToDisk completed"); UserThread.execute(completeHandler::handleResult); } }
Source:
<code>private void loadThumbnail(String imageUrl) { if (imageUrl == null) { AppLog.e(AppLog.T.MEDIA, "Image url is null! Show the default error image."); showErrorImage(); } Uri uri = Uri.parse(imageUrl); String filepath = uri.getLastPathSegment(); if (MediaUtils.isValidImage(filepath)) { int size = DisplayUtils.dpToPx( getActivity(), getResources().getDimensionPixelSize(R.dimen.image_settings_dialog_thumbnail_size) ); mImageView.setVisibility(View.GONE); mProgress.setVisibility(View.VISIBLE); mImageLoader.get(imageUrl, new ImageLoader.ImageListener() { @Override public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) { if (!isAdded()) { return; } if (response.getBitmap() != null) { mImageView.setVisibility(View.VISIBLE); <START> mProgress.setVisibility(View.GONE); <END> mImageView.setImageBitmap(response.getBitmap()); } else { if (!isImmediate) { showErrorImage(); } } } @Override public void onErrorResponse(VolleyError error) { AppLog.e(AppLog.T.MEDIA, error); if (!isAdded()) { return; } showErrorImage(); } }, size, 0); } else { showErrorImage(); } }</code><technical_language>~~We want hide progress bar bitmap is null. hide in onErrorResponse below.~~ Scratch that, I hidden showErrorImage</technical_language>

Target:
private void loadThumbnail(String imageUrl) { if (imageUrl == null) { AppLog.e(AppLog.T.MEDIA, "Image url is null! Show the default error image."); showErrorImage(); return; } Uri uri = Uri.parse(imageUrl); String filepath = uri.getLastPathSegment(); if (MediaUtils.isValidImage(filepath)) { int size = DisplayUtils.dpToPx( getActivity(), getResources().getDimensionPixelSize(R.dimen.image_settings_dialog_thumbnail_size) ); mImageView.setVisibility(View.GONE); mProgress.setVisibility(View.VISIBLE); mImageLoader.get(imageUrl, new ImageLoader.ImageListener() { @Override public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) { if (!isAdded()) { return; } if (response.getBitmap() != null) { mImageView.setVisibility(View.VISIBLE); mProgress.setVisibility(View.GONE); mImageView.setImageBitmap(response.getBitmap()); } else { if (!isImmediate) { showErrorImage(); } } } @Override public void onErrorResponse(VolleyError error) { AppLog.e(AppLog.T.MEDIA, error); if (!isAdded()) { return; } showErrorImage(); } }, size, 0); } else { showErrorImage(); } }
Source:
<code>void stopProfileServices() { Class[] supportedProfileServices = Config.getSupportedProfiles(); if (mRunningProfiles.size() > 0) { setAllProfileServiceStates(supportedProfileServices, BluetoothAdapter.STATE_OFF); } <START> debugLog("stopProfileServices() - No profiles services to stop or already stopped."); <END> }</code><technical_language>meaning of this log message changes removing return statements</technical_language>

Target:
void stopProfileServices() { Class[] supportedProfileServices = Config.getSupportedProfiles(); if (mRunningProfiles.size() == 0) { debugLog("stopProfileServices() - No profiles services to stop or already stopped."); return; } setAllProfileServiceStates(supportedProfileServices, BluetoothAdapter.STATE_OFF); }
Source:
<code><START> public Mono<IndexDocumentsResult> uploadDocuments(Iterable<?> documents) { <END> return this.uploadDocumentsWithResponse(documents) .map(Response::getValue); }</code><technical_language>public API methods in Sync Async clients @ServiceMethod annotation</technical_language>

Target:
public Mono<IndexDocumentsResult> uploadDocuments(Iterable<?> documents) { try { return this.uploadDocumentsWithResponse(documents) .map(Response::getValue); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public Statement apply(final Statement base, FrameworkMethod method, Object target) { return new Statement() { @Override public void evaluate() throws Throwable { runCount++; base.evaluate(); } <START> ; <END> }; }</code><technical_language>nit: this is</technical_language>

Target:
public Statement apply(final Statement base, FrameworkMethod method, Object target) { return new Statement() { @Override public void evaluate() throws Throwable { runCount++; base.evaluate(); } }; }
Source:
<code><START> public void allowsOnlyProperlyNamedLocalVariables() throws Exception { <END> this.validateCheckstyle( "LocalVariableNames.java", false, Matchers.allOf( Matchers.not( Matchers.stringContainsInOrder( Arrays.asList( "aaa", "twelveletter", "ise" ) ) ), Matchers.stringContainsInOrder( Arrays.asList( "LocalVariableNames.java", "Name 'prolongations' must match pattern", "Name 'camelCase' must match pattern '^[a-z]{3,12}$'.", "Name 'number1' must match pattern '^[a-z]{3,12}$'.", "Name 'ex' must match pattern '^[a-z]{3,12}$'.", "Name 'a' must match pattern '^[a-z]{3,12}$'.", "Name 'ae' must match pattern '^ex|[a-z]{3,12}$'.", "Name 'e' must match pattern '^ex|[a-z]{3,12}$'." ) ) ) ); }</code><technical_language>@mkordas good check number of names check violations is equal number checking. Basically names in valid() method passing this check</technical_language>

Target:
public void allowsOnlyProperlyNamedLocalVariables() throws Exception { final String result = this.runValidation( "LocalVariableNames.java", false ); MatcherAssert.assertThat( StringUtils.countMatches(result, "LocalVariableNames.java"), Matchers.is(Tv.SEVEN) ); MatcherAssert.assertThat( result, Matchers.allOf( Matchers.not( Matchers.stringContainsInOrder( Arrays.asList( "aaa", "twelveletter", "ise" ) ) ), Matchers.stringContainsInOrder( Arrays.asList( "Name 'prolongations' must match pattern", "Name 'camelCase' must match pattern '^[a-z]{3,12}$'.", "Name 'number1' must match pattern '^[a-z]{3,12}$'.", "Name 'ex' must match pattern '^[a-z]{3,12}$'.", "Name 'a' must match pattern '^[a-z]{3,12}$'.", "Name 'ae' must match pattern '^ex|[a-z]{3,12}$'.", "Name 'e' must match pattern '^ex|[a-z]{3,12}$'." ) ) ) ); }
Source:
<code>public void onPrepareOptionsMenu(Menu menu) { MenuItem sosItem = menu.findItem(R.id.sosBroadcast); <START> if(sharedPreferences.getBoolean(KEY_STATUS, false)){ <END> sosItem.setEnabled(false); } else { sosItem.setEnabled(true); } super.onPrepareOptionsMenu(menu); }</code><technical_language>formatting consistent rest of code</technical_language>

Target:
public void onPrepareOptionsMenu(Menu menu) { MenuItem sosItem = menu.findItem(R.id.sosBroadcast); sosItem.setEnabled(!sharedPreferences.getBoolean(KEY_STATUS, false)); super.onPrepareOptionsMenu(menu); }
Source:
<code>public long transferFrom(FileChannel fileChannel, long position, long count) throws IOException { if (state == State.CLOSING) throw closingException(); if (state != State.READY) return 0; if (!flush(netWriteBuffer)) return 0; long channelSize = fileChannel.size(); if (position > channelSize) return 0; int bytesToWrite = (int) Math.min(Math.min(count, channelSize - position), Integer.MAX_VALUE); if (fileChannelBuffer == null) { int transferSize = 16384; fileChannelBuffer = ByteBuffer.allocateDirect(transferSize); } else { <START> fileChannelBuffer.clear(); <END> } int bytesWritten = 0; long pos = position; try { while (bytesWritten < bytesToWrite) { int bytesRemaining = bytesToWrite - bytesWritten; if (bytesRemaining < fileChannelBuffer.limit()) fileChannelBuffer.limit(bytesRemaining); int bytesRead = fileChannel.read(fileChannelBuffer, pos); if (bytesRead <= 0) break; fileChannelBuffer.flip(); int networkBytesWritten = write(fileChannelBuffer); bytesWritten += networkBytesWritten; if (networkBytesWritten != bytesRead) break; pos += networkBytesWritten; fileChannelBuffer.clear(); } return bytesWritten; } catch (IOException x) { if (bytesWritten > 0) return bytesWritten; throw x; } }</code><technical_language>If allocate this a direct buffer here, need force deallocated in SslTransportLayer#close. off-heap buffers build time starve system of memory. garbage collector "see" direct buffers in a versions of Java, get cleaned a full GC</technical_language>

Target:
public long transferFrom(FileChannel fileChannel, long position, long count) throws IOException { if (state == State.CLOSING) throw closingException(); if (state != State.READY) return 0; if (!flush(netWriteBuffer)) return 0; long channelSize = fileChannel.size(); if (position > channelSize) return 0; int totalBytesToWrite = (int) Math.min(Math.min(count, channelSize - position), Integer.MAX_VALUE); if (fileChannelBuffer == null) { int transferSize = 32768; fileChannelBuffer = ByteBuffer.allocateDirect(transferSize); fileChannelBuffer.position(fileChannelBuffer.limit()); } int totalBytesWritten = 0; long pos = position; try { while (totalBytesWritten < totalBytesToWrite) { if (!fileChannelBuffer.hasRemaining()) { fileChannelBuffer.clear(); int bytesRemaining = totalBytesToWrite - totalBytesWritten; if (bytesRemaining < fileChannelBuffer.limit()) fileChannelBuffer.limit(bytesRemaining); int bytesRead = fileChannel.read(fileChannelBuffer, pos); if (bytesRead <= 0) break; fileChannelBuffer.flip(); } int networkBytesWritten = write(fileChannelBuffer); totalBytesWritten += networkBytesWritten; if (fileChannelBuffer.hasRemaining()) break; pos += networkBytesWritten; } return totalBytesWritten; } catch (IOException e) { if (totalBytesWritten > 0) return totalBytesWritten; throw e; } }
Source:
<code>public Iterator<ItemStack> iterator() { <START> return Iterators.singletonIterator(item.copy()); <END> }</code><technical_language>Copy potentially get expensive. trust modders screw up</technical_language>

Target:
public Iterator<ItemStack> iterator() { return Iterators.singletonIterator(new ItemStack(item.get(), 1, damage)); }
Source:
<code>private void restoreAutoCommitState(final Handle handle) { try { final LocalStuff stuff = localStuff.remove(handle); if (stuff != null) { handle.getConnection().setAutoCommit(stuff.getInitialAutocommit()); stuff.getCheckpoints().clear(); } } catch (SQLException e) { throw new UnableToRestoreAutoCommitStateException(e); } finally { <START> if (localStuff.containsKey(handle)) { <END> localStuff.remove(handle); } } }</code><technical_language>Checking containsKey calling remove is redundant removed</technical_language>

Target:
private void restoreAutoCommitState(final Handle handle) { try { final LocalStuff stuff = localStuff.remove(handle); if (stuff != null) { handle.getConnection().setAutoCommit(stuff.getInitialAutocommit()); stuff.getCheckpoints().clear(); } } catch (SQLException e) { throw new UnableToRestoreAutoCommitStateException(e); } finally { localStuff.remove(handle); } }
Source:
<code>public void closeDriverFactoryIfFullyCreated() { if (closed) { return; } if (isNoMoreDriverRunner() && pendingCreation.get() == 0) { driverFactory.noMoreDrivers(Lifespan.taskWide()); driverFactory.noMoreDrivers(); <START> closed = true; <END> } }</code><technical_language>Curious: need track closed in DriverSplitRunnerFactory</technical_language>

Target:
public void closeDriverFactoryIfFullyCreated() { if (closed.get()) { return; } if (isNoMoreDriverRunner() && pendingCreation.get() == 0) { if (!closed.compareAndSet(false, true)) { return; } driverFactory.noMoreDrivers(Lifespan.taskWide()); driverFactory.noMoreDrivers(); } }
Source:
<code>protected CallbackTracker(RestRequest restRequest, String operationType, Histogram operationTimeTracker, Histogram callbackProcessingTimeTracker) { this.restRequest = restRequest; <START> this.operationType = operationType; <END> this.operationTimeTracker = operationTimeTracker; this.callbackProcessingTimeTracker = callbackProcessingTimeTracker; blobId = RestUtils.getOperationOrBlobIdFromUri(restRequest); }</code><technical_language>define enums for operation type</technical_language>

Target:
CallbackTracker(RestRequest restRequest, String operationType, Histogram operationTimeTracker, Histogram callbackProcessingTimeTracker) { this.restRequest = restRequest; this.operationType = operationType; this.operationTimeTracker = operationTimeTracker; this.callbackProcessingTimeTracker = callbackProcessingTimeTracker; blobId = RestUtils.getOperationOrBlobIdFromUri(restRequest); }
Source:
<code>public void channelInactive(ChannelHandlerContext ctx) throws Exception { <START> LOG.trace("Channel inactive {}", ctx.channel()); <END> allChannels.remove(ctx.channel()); NettyServerCnxn cnxn = ctx.channel().attr(CONNECTION_ATTRIBUTE).getAndSet(null); if (cnxn != null) { LOG.trace("Channel inactive caused close {}", cnxn); cnxn.close(); } }</code><technical_language>isTraceEnabled is missing here</technical_language>

Target:
public void channelInactive(ChannelHandlerContext ctx) throws Exception { if (LOG.isTraceEnabled()) { LOG.trace("Channel inactive {}", ctx.channel()); } allChannels.remove(ctx.channel()); NettyServerCnxn cnxn = ctx.channel().attr(CONNECTION_ATTRIBUTE).getAndSet(null); if (cnxn != null) { if (LOG.isTraceEnabled()) { LOG.trace("Channel inactive caused close {}", cnxn); } cnxn.close(); } }