auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void lockCanBeUpdated() { UUID leaderId = UUID.randomUUID(); LockWatchStateUpdate update = LockWatchStateUpdate.update(leaderId, 1, ImmutableList.of( LockEvent.builder(ImmutableSet.of(DESCRIPTOR)).build(0), <START> UnlockEvent.builder(ImmutableSet.of(DESCRIPTOR)).build(1))); <END> tracker.updateState(update); VersionedLockWatchState state = tracker.currentState(); assertThat(state.version()).isEqualTo(OptionalLong.of(1)); assertThat(state.leaderId()).isEqualTo(leaderId); assertThat(state.lockWatchState(DESCRIPTOR)).isEqualTo(LockWatchInfo.of(UNLOCKED, OptionalLong.of(0))); LockWatchStateUpdate secondUpdate = LockWatchStateUpdate.update(leaderId, 2, ImmutableList.of( LockEvent.builder(ImmutableSet.of(DESCRIPTOR)).build(2))); tracker.updateState(secondUpdate); state = tracker.currentState(); assertThat(state.version()).isEqualTo(OptionalLong.of(2)); assertThat(state.leaderId()).isEqualTo(leaderId); assertThat(state.lockWatchState(DESCRIPTOR)).isEqualTo(LockWatchInfo.of(LOCKED, OptionalLong.of(2))); }</code><technical_language>assumption here, I guess, is events filtered relevant watched - this registration of some watch covering DESCRIPTOR place in past</technical_language>

Target:
public void lockCanBeUpdated() { UUID leaderId = UUID.randomUUID(); LockWatchStateUpdate update = LockWatchStateUpdate.update(leaderId, 1, ImmutableList.of( LockEvent.builder(ImmutableSet.of(DESCRIPTOR)).build(0), UnlockEvent.builder(ImmutableSet.of(DESCRIPTOR)).build(1))); tracker.updateState(update); VersionedLockWatchState state = tracker.currentState(); assertThat(state.version()).hasValue(1); assertThat(state.leaderId()).isEqualTo(leaderId); assertThat(state.lockWatchState(DESCRIPTOR)).isEqualTo(LockWatchInfo.of(UNLOCKED, OptionalLong.of(0))); LockWatchStateUpdate secondUpdate = LockWatchStateUpdate.update(leaderId, 2, ImmutableList.of( LockEvent.builder(ImmutableSet.of(DESCRIPTOR)).build(2))); tracker.updateState(secondUpdate); state = tracker.currentState(); assertThat(state.version()).hasValue(2); assertThat(state.leaderId()).isEqualTo(leaderId); assertThat(state.lockWatchState(DESCRIPTOR)).isEqualTo(LockWatchInfo.of(LOCKED, OptionalLong.of(2))); }
Source:
<code>public final MesosClient<Send, Receive> build() { return new MesosClient<>( checkNotNull(mesosUri), checkNotNull(applicationUserAgentEntry), checkNotNull(sendCodec), checkNotNull(receiveCodec), checkNotNull(subscribe), checkNotNull(streamProcessor), <START> checkNotNull(byteStreamTransformer)); <END> }</code><technical_language>Style: bump closing paren next line indent</technical_language>

Target:
public final MesosClient<Send, Receive> build() { return new MesosClient<>( checkNotNull(mesosUri), checkNotNull(applicationUserAgentEntry), checkNotNull(sendCodec), checkNotNull(receiveCodec), checkNotNull(subscribe), checkNotNull(streamProcessor), checkNotNull(backpressureTransformer) ); }
Source:
<code>private CreateConnectionViewRequest createConnectionViewRequest(final IElementType type, final EditPart source, final EditPart target, final Point sourcePoint, final Point targetPoint) { CreateConnectionViewRequest connectionRequest = CreateViewRequestFactory.getCreateConnectionRequest(type, ((IGraphicalEditPart) getDiagramEditPart()).getDiagramPreferencesHint()); connectionRequest.setLocation(sourcePoint); connectionRequest.setSourceEditPart(null); connectionRequest.setTargetEditPart(source); connectionRequest.setType(RequestConstants.REQ_CONNECTION_START); Command <START> cmd = <END> source.getCommand(connectionRequest); connectionRequest.setSourceEditPart(source); connectionRequest.setTargetEditPart(target); connectionRequest.setType(RequestConstants.REQ_CONNECTION_END); connectionRequest.setLocation(targetPoint); EObject container = getRootEditPart().resolveSemanticElement(); connectionRequest.getExtendedData().put(SOURCE_MODEL_CONTAINER, container); connectionRequest.getExtendedData().put(TARGET_MODEL_CONTAINER, container); return connectionRequest; }</code><technical_language>Unused local var</technical_language>

Target:
private CreateConnectionViewRequest createConnectionViewRequest(final IElementType type, final EditPart source, final EditPart target, final Point sourcePoint, final Point targetPoint) { CreateConnectionViewRequest connectionRequest = CreateViewRequestFactory.getCreateConnectionRequest(type, ((IGraphicalEditPart) getDiagramEditPart()).getDiagramPreferencesHint()); connectionRequest.setLocation(sourcePoint); connectionRequest.setSourceEditPart(null); connectionRequest.setTargetEditPart(source); connectionRequest.setType(RequestConstants.REQ_CONNECTION_START); source.getCommand(connectionRequest); connectionRequest.setSourceEditPart(source); connectionRequest.setTargetEditPart(target); connectionRequest.setType(RequestConstants.REQ_CONNECTION_END); connectionRequest.setLocation(targetPoint); EObject container = getRootEditPart().resolveSemanticElement(); connectionRequest.getExtendedData().put(SOURCE_MODEL_CONTAINER, container); connectionRequest.getExtendedData().put(TARGET_MODEL_CONTAINER, container); return connectionRequest; }
Source:
<code>protected LinkedHashMap<String, ZuulRoute> locateRoutes() { LinkedHashMap<String, ZuulRoute> routesMap = new LinkedHashMap<>(); addConfiguredRoutes(routesMap); routesMap.putAll(staticRoutes); List<String> services = discovery.getServices(); for (String serviceId : services) { String key = "/" + serviceId + "/**"; if (!properties.getIgnoredServices().contains(serviceId) && !routesMap.containsKey(key)) { routesMap.put(key, new ZuulRoute(key, serviceId)); } } if (routesMap.get(DEFAULT_ROUTE) != null) { ZuulRoute defaultRoute = routesMap.get(DEFAULT_ROUTE); routesMap.remove(DEFAULT_ROUTE); <START> routesMap.put(DEFAULT_ROUTE, new ZuulRoute(defaultRoute.getPath(), defaultRoute.getLocation())); <END> } LinkedHashMap<String, ZuulRoute> values = new LinkedHashMap<>(); for (Entry<String, ZuulRoute> entry : routesMap.entrySet()) { String path = entry.getKey(); if (!path.startsWith("/")) { path = "/" + path; } if (StringUtils.hasText(properties.getPrefix())) { path = properties.getPrefix() + path; if (!path.startsWith("/")) { path = "/" + path; } } values.put(path, entry.getValue()); } return values; }</code><technical_language>put defaultRoute</technical_language>

Target:
protected LinkedHashMap<String, ZuulRoute> locateRoutes() { LinkedHashMap<String, ZuulRoute> routesMap = new LinkedHashMap<>(); addConfiguredRoutes(routesMap); routesMap.putAll(staticRoutes); List<String> services = discovery.getServices(); for (String serviceId : services) { String key = "/" + serviceId + "/**"; if (!properties.getIgnoredServices().contains(serviceId) && !routesMap.containsKey(key)) { routesMap.put(key, new ZuulRoute(key, serviceId)); } } if (routesMap.get(DEFAULT_ROUTE) != null) { ZuulRoute defaultRoute = routesMap.get(DEFAULT_ROUTE); routesMap.remove(DEFAULT_ROUTE); routesMap.put(DEFAULT_ROUTE, defaultRoute); } LinkedHashMap<String, ZuulRoute> values = new LinkedHashMap<>(); for (Entry<String, ZuulRoute> entry : routesMap.entrySet()) { String path = entry.getKey(); if (!path.startsWith("/")) { path = "/" + path; } if (StringUtils.hasText(properties.getPrefix())) { path = properties.getPrefix() + path; if (!path.startsWith("/")) { path = "/" + path; } } values.put(path, entry.getValue()); } return values; }
Source:
<code><START> private void toHtmlForPeriodical(StringBuilder result) { <END> appendNames(creators, result); appendYear(result); appendArticle(result); appendContainedIn(result); appendNames(contributors, result); appendTitle(result); appendVolumeInformation(result); appendEdition(result, true); appendPlaceAndPublisher(result); appendOverallTitleAndNumber(result); appendPagerange(result); }</code><technical_language>toHtmlForAnthology. mixed up</technical_language>

Target:
private void toHtmlForPeriodical(StringBuilder result) { appendNames(creators, result); appendYear(result); appendArticle(result); if (Objects.nonNull(part)) { result.append(' '); result.append(part); } appendContainedIn(result); appendTitle(result); if (Objects.nonNull(subseries)) { result.append(' '); result.append(subseries); } if (Objects.nonNull(volume)) { result.append(' '); result.append(volume); } if (Objects.nonNull(published)) { result.append(" ("); result.append(published.toString(PUBLICATION_DATE_FORMAT)); result.append(')'); } if (Objects.nonNull(number)) { result.append(' '); result.append(number); } appendPagerange(result); if (Objects.nonNull(accessed)) { result.append(" ("); appendAccessed(result); result.append(')'); } appendURL(result); }
Source:
<code><START> public static Map<String, Integer> calculateAveragePartitionWeight( <END> Map<String, Map<String, Integer>> partitionCapacityMap) { Map<String, PartitionWeightCounterEntry> countPartitionWeightMap = aggregatePartitionWeight(partitionCapacityMap); Map<String, Integer> averagePartitionWeightMap = new HashMap<>(); for (Map.Entry<String, PartitionWeightCounterEntry> entry : countPartitionWeightMap.entrySet()) { String capacityKey = entry.getKey(); PartitionWeightCounterEntry weightEntry = entry.getValue(); int averageWeight = weightEntry.getWeight() / weightEntry.getPartitions(); averagePartitionWeightMap.put(capacityKey, averageWeight); } return averagePartitionWeightMap; }</code><technical_language>simplify this merging 2 methods</technical_language>

Target:
public static Map<String, Integer> calculateAveragePartitionWeight( Map<String, Map<String, Integer>> partitionCapacityMap) { Map<String, PartitionWeightCounterEntry> countPartitionWeightMap = new HashMap<>(); partitionCapacityMap.values().forEach(partitionCapacityEntry -> partitionCapacityEntry.forEach((capacityKey, weight) -> countPartitionWeightMap .computeIfAbsent(capacityKey, counterEntry -> new PartitionWeightCounterEntry()) .increase(1, weight))); Map<String, Integer> averagePartitionWeightMap = new HashMap<>(); for (Map.Entry<String, PartitionWeightCounterEntry> entry : countPartitionWeightMap.entrySet()) { String capacityKey = entry.getKey(); PartitionWeightCounterEntry weightEntry = entry.getValue(); int averageWeight = (int) (weightEntry.getWeight() / weightEntry.getPartitions()); averagePartitionWeightMap.put(capacityKey, averageWeight); } return averagePartitionWeightMap; }
Source:
<code>private static <E extends Expression> HasTypeRef getTypeRefOfExpression(final Optional<E> expression, final HasExpression hasExpression) { <START> HasTypeRef hasTypeRef = expression.get(); <END> final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }</code><technical_language>_"unsafe"_ .get(), instead of calling .get() do calling orElseThrow(..) explaining expression is present here? :-) this (with a error message): java HasTypeRef hasTypeRef = expression.orElseThrow(() -> new UnsupportedOperationException("'expression' is null, this is called (..) (?)"));</technical_language>

Target:
private static <E extends Expression> HasTypeRef getTypeRefOfExpression(final Optional<E> expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression.orElseThrow(() -> new UnsupportedOperationException("'expression' should never be null for grids supporting NameAndDataTypeHeaderMetaData.")); final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }
Source:
<code>public Optional<String> checkTypeForDoNotMockViolation(Class<?> type) { return Arrays.stream(type.getAnnotations()).filter( annotation -> annotation.annotationType().getName().endsWith("org.mockito.DoNotMock")) .findFirst() .map(annotation -> { <START> String exceptionMessage = type + " is annotated with @DoNoMock and can't be mocked."; <END> if (DoNotMock.class.equals(annotation.annotationType())) { exceptionMessage += " " + type.getAnnotation(DoNotMock.class).value(); } return exceptionMessage; }); }</code><technical_language>do want "is annotated org.mockito.@DoNotMock"</technical_language>

Target:
public String checkTypeForDoNotMockViolation(Class<?> type) { for (Annotation annotation : type.getAnnotations()) { if (annotation.annotationType().getName().endsWith("org.mockito.DoNotMock")) { String exceptionMessage = type + " is annotated with org.mockito.@DoNoMock and can't be mocked."; if (DoNotMock.class.equals(annotation.annotationType())) { exceptionMessage += " " + type.getAnnotation(DoNotMock.class).value(); } return exceptionMessage; } } return null; }
Source:
<code>private void createPresenterModule() { RenderedTemplate renderedTemplate = null; <START> if (presenterConfigModel.getNestedPresenter()) { <END> renderedTemplate = createdNestedPresenterTemplates.getModule(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getModule(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getModule(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); createdPsiClass.navigate(true); }</code><technical_language>extract</technical_language>

Target:
private void createPresenterModule() { RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getModule(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getModule(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getModule(); } createdModulePsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); navigateToClass(createdModulePsiClass); }
Source:
<code>public static String printMoneyArray(Money[] array) { String values = ""; for(int i = 0; i < array.length; i++) { values += array[i].toXmlString(); <START> if(i < (array.length-1)) { <END> values += ","; } } return values; }</code><technical_language>I missed this, this a StringBuilder. While more correct, more obvious write: java StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; ++i) { if (i > 0) { builder.append(","); } builder.append(array[i].toXmlString()); } return builder.toString();</technical_language>

Target:
public static String printMoneyArray(Money[] array) { StringBuilder values = new StringBuilder(); for(int i = 0; i < array.length; i++) { values.append(array[i].toXmlString()); if(i < (array.length-1)) { values.append(","); } } return values.toString(); }
Source:
<code>public FormValidation doSendTestMail( @QueryParameter String smtpServer, @QueryParameter String adminAddress, @QueryParameter boolean useSMTPAuth, @QueryParameter String smtpAuthUserName, @QueryParameter Secret smtpAuthPasswordSecret, @QueryParameter boolean useSsl, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException, ServletException, InterruptedException { try { final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { throw new IOException("Jenkins instance is not ready"); } if (!useSMTPAuth) { smtpAuthUserName = null; smtpAuthPasswordSecret = null; } MimeMessage msg = new MimeMessage(createSession(smtpServer, smtpPort, useSsl, smtpAuthUserName, smtpAuthPasswordSecret)); <START> msg.setSubject(Messages.Mailer_TestMail_Subject(incrementTestEmailCount()), charset); <END> msg.setText(Messages.Mailer_TestMail_Content(getTestEmailCount(), jenkins.getDisplayName()), charset); msg.setFrom(stringToAddress(adminAddress, charset)); if (StringUtils.isNotBlank(replyToAddress)) { msg.setReplyTo(new Address[]{stringToAddress(replyToAddress, charset)}); } msg.setSentDate(new Date()); msg.setRecipient(Message.RecipientType.TO, stringToAddress(sendTestMailTo, charset)); Transport.send(msg); return FormValidation.ok(Messages.Mailer_EmailSentSuccessfully()); } catch (MessagingException e) { return FormValidation.errorWithMarkup("<p>"+Messages.Mailer_FailedToSendEmail()+"</p><pre>"+Util.escape(Functions.printThrowable(e))+"</pre>"); } }</code><technical_language>I findbugs complained = new code thread safe, code..</technical_language>

Target:
public FormValidation doSendTestMail( @QueryParameter String smtpServer, @QueryParameter String adminAddress, @QueryParameter boolean useSMTPAuth, @QueryParameter String smtpAuthUserName, @QueryParameter Secret smtpAuthPasswordSecret, @QueryParameter boolean useSsl, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException, ServletException, InterruptedException { try { final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { throw new IOException("Jenkins instance is not ready"); } if (!useSMTPAuth) { smtpAuthUserName = null; smtpAuthPasswordSecret = null; } MimeMessage msg = new MimeMessage(createSession(smtpServer, smtpPort, useSsl, smtpAuthUserName, smtpAuthPasswordSecret)); msg.setSubject(Messages.Mailer_TestMail_Subject(testEmailCount.incrementAndGet()), charset); msg.setText(Messages.Mailer_TestMail_Content(testEmailCount.get(), jenkins.getDisplayName()), charset); msg.setFrom(stringToAddress(adminAddress, charset)); if (StringUtils.isNotBlank(replyToAddress)) { msg.setReplyTo(new Address[]{stringToAddress(replyToAddress, charset)}); } msg.setSentDate(new Date()); msg.setRecipient(Message.RecipientType.TO, stringToAddress(sendTestMailTo, charset)); Transport.send(msg); return FormValidation.ok(Messages.Mailer_EmailSentSuccessfully()); } catch (MessagingException e) { return FormValidation.errorWithMarkup("<p>"+Messages.Mailer_FailedToSendEmail()+"</p><pre>"+Util.escape(Functions.printThrowable(e))+"</pre>"); } }
Source:
<code>public UpdateRequest processPreUpdate( UpdateRequest input, Map<String, Metacard> existingMetacards) throws StopProcessingException { Function<Metacard, Metacard> oldVersionOfMetacard = <START> (update) -> Optional.of(existingMetacards.get(update.getId())).orElse(null); <END> boolean foundInaccessibleMetacard = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter( newVersionOfMetacard -> isAccessControlUpdated( oldVersionOfMetacard.apply(newVersionOfMetacard), newVersionOfMetacard)) .filter(Objects::nonNull) .filter(mc -> !subjectIsAccessAdmin.test(mc) && !subjectIsOwner.test(mc)) .findFirst() .isPresent(); if (foundInaccessibleMetacard) { throw new StopProcessingException( "Cannot update metacard(s). Subject cannot change access control permissions because they are not in the assigned access-administrators list."); } return input; }</code><technical_language>get() return null</technical_language>

Target:
public UpdateRequest processPreUpdate( UpdateRequest input, Map<String, Metacard> existingMetacards) throws StopProcessingException { Function<Metacard, Metacard> oldVersionOfMetacard = (update) -> { Optional<Metacard> oldMetacard = Optional.ofNullable(existingMetacards.get(update.getId())); if (oldMetacard.isPresent()) { return oldMetacard.get(); } return null; }; boolean foundInaccessibleMetacard = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter( newVersionOfMetacard -> isAccessControlUpdated( oldVersionOfMetacard.apply(newVersionOfMetacard), newVersionOfMetacard)) .filter(Objects::nonNull) .filter(mc -> !subjectIsAccessAdmin.test(mc) && !subjectIsOwner.test(mc)) .findFirst() .isPresent(); if (foundInaccessibleMetacard) { throw new StopProcessingException( "Cannot update metacard(s). Subject cannot change access control permissions because they are not in the assigned access-administrators list."); } return input; }
Source:
<code>private void createModeSelectionControl(Map<String, ILaunchGroup> modes, Composite comp) { Label label = new Label(comp, SWT.NONE); label.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_4); Map<String, String> labelToMode = new LinkedHashMap<>(); modes.forEach((modeName, launchGrp) -> { String launchGrpLabel = DebugUIPlugin.removeAccelerators(launchGrp.getLabel()); labelToMode.put(launchGrpLabel, modeName); }); Combo cvMode = new Combo(comp, SWT.READ_ONLY); GridDataFactory.fillDefaults().applyTo(cvMode); cvMode.setItems(labelToMode.keySet().toArray(new String[labelToMode.size()])); int index = 0; for (String m : modes.keySet()) { if (m.equals(mode)) { cvMode.select(index); break; } index++; } cvMode.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { modeLabel = cvMode.getText(); mode = <START> labelToMode.get(cvMode.getText()); <END> validate(); } }); Composite c = new Composite(comp, SWT.NONE); GridLayoutFactory.fillDefaults().applyTo(c); GridDataFactory.fillDefaults().span(2, 1).applyTo(c); }</code><technical_language>"modeLabel"</technical_language>

Target:
private void createModeSelectionControl(Map<String, ILaunchGroup> modes, Composite comp) { Label label = new Label(comp, SWT.NONE); label.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_4); Map<String, String> labelToMode = new LinkedHashMap<>(); modes.forEach((modeName, launchGrp) -> { String launchGrpLabel = DebugUIPlugin.removeAccelerators(launchGrp.getLabel()); labelToMode.put(launchGrpLabel, modeName); }); Combo cvMode = new Combo(comp, SWT.READ_ONLY); GridDataFactory.fillDefaults().applyTo(cvMode); cvMode.setItems(labelToMode.keySet().toArray(new String[labelToMode.size()])); int index = 0; for (String m : modes.keySet()) { if (m.equals(mode)) { cvMode.select(index); break; } index++; } cvMode.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { mode = labelToMode.get(cvMode.getText()); validate(); } }); Composite c = new Composite(comp, SWT.NONE); GridLayoutFactory.fillDefaults().applyTo(c); GridDataFactory.fillDefaults().span(2, 1).applyTo(c); }
Source:
<code>void connectSensors() { addEnricher(Enrichers.builder() .propagatingAllBut(SERVICE_UP, ROOT_URL, GROUP_MEMBERS, GROUP_SIZE) <START> .from(getCluster()) <END> .build()); addEnricher(Enrichers.builder() .propagating(LoadBalancer.HOSTNAME, Attributes.ADDRESS, SERVICE_UP, ROOT_URL) .from(getController()) .build()); }</code><technical_language>stop() calls sequentially stop() nginx entity cluster. propagating service_state of getCluster() stopping stopping cluster</technical_language>

Target:
void connectSensors() { addEnricher(Enrichers.builder() .propagatingAllBut(SERVICE_STATE, SERVICE_UP, ROOT_URL, GROUP_MEMBERS, GROUP_SIZE) .from(getCluster()) .build()); addEnricher(Enrichers.builder() .propagating(LoadBalancer.HOSTNAME, Attributes.ADDRESS, ROOT_URL) .from(getController()) .build()); SensorEventListener<Boolean> updateServiceUp = new SensorEventListener<Boolean>() { @Override public void onEvent(SensorEvent<Boolean> event) { setAttribute(SERVICE_UP, calculateServiceUp()); } }; SensorEventListener<Lifecycle> updateServiceState = new SensorEventListener<Lifecycle>() { @Override public void onEvent(SensorEvent<Lifecycle> event) { setAttribute(SERVICE_STATE, calculateServiceState()); } }; subscribe(getCluster(), SERVICE_STATE, updateServiceState); subscribe(getController(), SERVICE_STATE, updateServiceState); subscribe(getCluster(), SERVICE_UP, updateServiceUp); subscribe(getController(), SERVICE_UP, updateServiceUp); }
Source:
<code>public String makeString() { <START> return UiUtils.typeFormatHtml(makeBaseString(), getReturnType()); <END> }</code><technical_language>this a typeFormat Html? suggestion return UiUtils.typeFormat(makeBaseString(), getReturnType()); overriden makeStringHtml() method: java @Override public String makeStringHtml() { return UiUtils.typeFormatHtml(makeBaseString(), getReturnType()); }</technical_language>

Target:
public String makeString() { return UiUtils.typeFormat(makeBaseString(), getReturnType()); }
Source:
<code>public Optional<Invocation> getModelClass() { final Invocation invocation = new Invocation(); <START> return Optional.of(invocation); <END> }</code><technical_language>return Optional.of(new Invocation());</technical_language>

Target:
public Optional<Invocation> getModelClass() { return Optional.of(new Invocation()); }
Source:
<code>private PlanNodeStatsEstimate calculateRemoteSourceStats(RemoteSourceNode node, StatsProvider statsProvider) { PlanNodeStatsEstimate estimate = null; for (PlanFragment sourceFragment : sourceProvider.getSourceFragments(node)) { <START> PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(statsProvider.getStats(sourceFragment.getRoot()), sourceFragment.getPartitioningScheme().getOutputLayout(), node.getOutputSymbols()); <END> if (estimate != null) { addStatsAndMaxDistinctValues(estimate, sourceStatsWithMappedSymbols); } else { estimate = sourceStatsWithMappedSymbols; } } verify(estimate != null, "estimate is null"); return estimate; }</code><technical_language>FragmentedPlanSourceProvider::getSources for RemoteSourceNode return nodes output symbols mapped? need map symbols here</technical_language>

Target:
private PlanNodeStatsEstimate calculateRemoteSourceStats(RemoteSourceNode node, StatsProvider statsProvider) { PlanNodeStatsEstimate estimate = null; for (PlanFragment sourceFragment : sourceProvider.getSourceFragments(node)) { PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(statsProvider.getStats(sourceFragment.getRoot()), sourceFragment.getPartitioningScheme().getOutputLayout(), node.getOutputSymbols()); if (estimate != null) { estimate = addStatsAndMaxDistinctValues(estimate, sourceStatsWithMappedSymbols); } else { estimate = sourceStatsWithMappedSymbols; } } verify(estimate != null, "estimate is null"); return estimate; }
Source:
<code>protected C3Color createColor() { <START> return factory.c3Color(new String[0], null); <END> }</code><technical_language>Calling factory.c3Color null parameter a code smell me. If want 2nd argument, c3Color method overloaded accepting String []</technical_language>

Target:
protected C3Color createColor() { return factory.c3Color(new String[0]); }
Source:
<code>public static TmfStateValue readSerializedValue(ISafeByteBufferReader buffer) { byte customType = buffer.get(); CustomStateValueFactory customFactory = CustomStateValue.getCustomFactory(customType); if (customFactory == null) { Activator.getDefault().logWarning("Custom factory for type " + customType + " does not exist"); <START> return NullStateValue.INSTANCE; <END> } return customFactory.readCustomValue(buffer); }</code><technical_language>Kind of breaks pattern state values TmfStateValue</technical_language>

Target:
public static TmfStateValue readSerializedValue(ISafeByteBufferReader buffer) { byte customType = buffer.get(); CustomStateValueFactory customFactory = CustomStateValue.getCustomFactory(customType); if (customFactory == null) { Activator.getDefault().logWarning("Custom factory for type " + customType + " does not exist"); return TmfStateValue.nullValue(); } return customFactory.readCustomValue(buffer); }
Source:
<code>public void shouldSetTheRedirectAttribute() { String redirectUrl = "www.openmrs.org/_HASHTAG_"; MockHttpServletRequest mockRequest = new MockHttpServletRequest(); mockRequest.setParameter("redirect_url", redirectUrl); <START> <END> WebRequest webRequest = new ServletWebRequest(mockRequest); webRequest.setAttribute(WebConstants.INSUFFICIENT_PRIVILEGES, true, WebRequest.SCOPE_SESSION); ModelMap model = new ModelMap(); controller.handleRequest(webRequest, model); assertEquals(webRequest.getAttribute(WebConstants.OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, 1), "www.openmrs.org/#"); }</code><technical_language>Is this test setting redirect attribute replacing _HASHTAG_ #</technical_language>

Target:
public void shouldSetTheRedirectAttribute() { String redirectUrl = "www.openmrs.org/index"; MockHttpServletRequest mockRequest = new MockHttpServletRequest(); mockRequest.setParameter("redirect_url", redirectUrl); WebRequest webRequest = new ServletWebRequest(mockRequest); webRequest.setAttribute(WebConstants.INSUFFICIENT_PRIVILEGES, true, WebRequest.SCOPE_SESSION); ModelMap model = new ModelMap(); controller.handleRequest(webRequest, model); assertEquals(webRequest.getAttribute(WebConstants.OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, 1), "www.openmrs.org/index"); }
Source:
<code>private String getRandomText(int textLength) { SecureRandom random = new SecureRandom(); <START> return new BigInteger(5 * textLength, random).toString(32); <END> }</code><technical_language>2 lines merged</technical_language>

Target:
private String getRandomText(int textLength) { return new BigInteger(5 * textLength, new SecureRandom()).toString(32); }
Source:
<code>protected boolean canDoAction() { boolean retValue = false; String event; if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); return false; } if (getParameters().getAction() == FenceActionType.Start) { event = AuditLogType.USER_VDS_STOP.name(); } else { event = AuditLogType.USER_VDS_START.name(); } if (getVds().getpm_enabled() && isPowerManagementLegal()) { Date waitTo = Backend.getInstance() .getStartedAt() .addSeconds((Integer) Config.getValue(ConfigValues.DisableFenceAtStartupInSec)); Date now = new Date(); if (waitTo.before(now) || waitTo.equals(now)) { <START> int secondsLeftToNextPmOp = <END> (isInternalExecution() || (getParameters().getParentCommand() == VdcActionType.RestartVds)) ? 0 : DbFacade.getInstance() .getAuditLogDao() .getTimeToWaitForNextPmOp(getVds().getName(), event); if (secondsLeftToNextPmOp <= 0) { if (createProxyHostLocator().isProxyHostAvailable()) { retValue = true; } else { addCanDoActionMessage(VdcBllMessages.VDS_NO_VDS_PROXY_FOUND); } } else { addCanDoActionMessage(VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME); addCanDoActionMessageVariable("seconds", secondsLeftToNextPmOp); } } else { addCanDoActionMessage(VdcBllMessages.VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL); } } if (!retValue) { handleError(); } else { addCanDoActionMessage(VdcBllMessages.VDS_FENCE_DISABLED); handleError(); } getReturnValue().setSucceeded(retValue); return retValue; }</code><technical_language>Please reformat: int secondsLeftToNextPmOp = (isInternalExecution() || (getParameters().getParentCommand() == VdcActionType.RestartVds)) ? 0 : DbFacade.getInstance().getAuditLogDao().getTimeToWaitForNextPmOp( getVds().getName(), event);</technical_language>

Target:
protected boolean canDoAction() { boolean retValue = false; String event; if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); return false; } if (getParameters().getAction() == FenceActionType.Start) { event = AuditLogType.USER_VDS_STOP.name(); } else { event = AuditLogType.USER_VDS_START.name(); } if (getVds().getpm_enabled() && isPowerManagementLegal()) { Date waitTo = Backend.getInstance() .getStartedAt() .addSeconds((Integer) Config.getValue(ConfigValues.DisableFenceAtStartupInSec)); Date now = new Date(); if (waitTo.before(now) || waitTo.equals(now)) { int secondsLeftToNextPmOp = (isInternalExecution() || (getParameters().getParentCommand() == VdcActionType.RestartVds)) ? 0 : DbFacade.getInstance() .getAuditLogDao() .getTimeToWaitForNextPmOp(getVds().getName(), event); if (secondsLeftToNextPmOp <= 0) { if (createProxyHostLocator().isProxyHostAvailable()) { retValue = true; } else { addCanDoActionMessage(VdcBllMessages.VDS_NO_VDS_PROXY_FOUND); } } else { addCanDoActionMessage(VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME); addCanDoActionMessageVariable("seconds", secondsLeftToNextPmOp); } } else { addCanDoActionMessage(VdcBllMessages.VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL); } if (!retValue) { handleError(); } } else { addCanDoActionMessage(VdcBllMessages.VDS_FENCE_DISABLED); handleError(); } getReturnValue().setSucceeded(retValue); return retValue; }
Source:
<code>public Mono<Void> start() { PartitionLoadBalancerImpl self = this; synchronized (lock) { if (this.started) { throw new IllegalStateException("Partition load balancer already started"); } this.started = true; this.cancellationTokenSource = new CancellationTokenSource(); } return Mono.fromRunnable( () -> { <START> Thread thread = new Thread(() -> self.run(self.cancellationTokenSource.getToken()).subscribe()); <END> executorService.execute(thread); }); }</code><technical_language>creating threads here?! rely reactor stream platform provide creating threads</technical_language>

Target:
public Mono<Void> start() { synchronized (lock) { if (this.started) { throw new IllegalStateException("Partition load balancer already started"); } this.started = true; this.cancellationTokenSource = new CancellationTokenSource(); } return Mono.fromRunnable( () -> { scheduler.schedule(() -> this.run(this.cancellationTokenSource.getToken()).subscribe()); }); }
Source:
<code>public void testGroupMaxSizeExceptionIsFatal() { setupCoordinator(); mockClient.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); coordinator.ensureCoordinatorReady(mockTime.timer(0)); mockClient.prepareResponse(joinGroupFollowerResponse(defaultGeneration, memberId, JoinGroupResponse.UNKNOWN_MEMBER_ID, Errors.GROUP_MAX_SIZE_REACHED)); <START> RequestFuture<ByteBuffer> future = coordinator.sendJoinGroupRequest(coordinator.generation); <END> assertTrue(consumerClient.poll(future, mockTime.timer(REQUEST_TIMEOUT_MS))); assertTrue(future.exception().getClass().isInstance(Errors.GROUP_MAX_SIZE_REACHED.exception())); assertFalse(future.isRetriable()); }</code><technical_language>Ditto here, internal generation id matter if a race condition changing it</technical_language>

Target:
public void testGroupMaxSizeExceptionIsFatal() { setupCoordinator(); mockClient.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); coordinator.ensureCoordinatorReady(mockTime.timer(0)); mockClient.prepareResponse(joinGroupFollowerResponse(defaultGeneration, memberId, JoinGroupResponse.UNKNOWN_MEMBER_ID, Errors.GROUP_MAX_SIZE_REACHED)); RequestFuture<ByteBuffer> future = coordinator.sendJoinGroupRequest(); assertTrue(consumerClient.poll(future, mockTime.timer(REQUEST_TIMEOUT_MS))); assertTrue(future.exception().getClass().isInstance(Errors.GROUP_MAX_SIZE_REACHED.exception())); assertFalse(future.isRetriable()); }
Source:
<code>private void populateAnnouncements(List<AnnouncementsModel> announcementsList) { if(announcementsList !=null && announcementsList.size()>0) { hideEmptyAnnouncementMessage(); for (AnnouncementView view : announcementViewList) { view.stop(); } announcementViewList.clear(); announcementContainer.removeAllViews(); for (AnnouncementsModel m : announcementsList) { AnnouncementView announcementView = generateAnnouncementView(m); announcementViewList.add(announcementView); <START> announcementContainer.addView(announcementView.getView()); <END> } } else { showEmptyAnnouncementMessage(); } }</code><technical_language>This create a view for announcement. Android manages view memory differently a problem, this iOS, some courses a lot of long announcements caused a crash (I Global Terrorism course)</technical_language>

Target:
private void populateAnnouncements(List<AnnouncementsModel> announcementsList) { if(announcementsList !=null && announcementsList.size()>0) { hideEmptyAnnouncementMessage(); final String divider = "<div style='height:2px; width:100%; background-color: #E2E3E5'></div>"; StringBuffer buff = new StringBuffer(); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); for (AnnouncementsModel m : announcementsList) { String entry = String.format("%s <br/><br/> %s <br/> %s <br/><br/>", m.getDate(), divider, m.getContent()); buff.append(entry); } announcementWebView.loadDataWithBaseURL(Config.getInstance().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); } else { showEmptyAnnouncementMessage(); } }
Source:
<code>public static AcidTable decode(String encoded) throws IOException { if (!encoded.startsWith(PROLOG_V1)) { throw new IllegalStateException("Unsupported version."); } encoded = encoded.substring(PROLOG_V1.length()); byte[] decoded = Base64.decodeBase64(encoded); AcidTable table = null; try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(decoded))) { String databaseName = in.readUTF(); String tableName = in.readUTF(); boolean createPartitions = in.readBoolean(); long transactionId = in.readLong(); TableType tableType = TableType.valueOf(in.readByte()); int thriftLength = in.readInt(); table = new AcidTable(databaseName, tableName, createPartitions, tableType); <START> table.setWriteId(transactionId); <END> Table metaTable = null; if (thriftLength > 0) { metaTable = new Table(); try { byte[] thriftEncoded = new byte[thriftLength]; in.readFully(thriftEncoded, 0, thriftLength); new TDeserializer(new TCompactProtocol.Factory()).deserialize(metaTable, thriftEncoded); table.setTable(metaTable); } catch (TException e) { throw new IOException("Error deserializing meta store table.", e); } } } return table; }</code><technical_language>transactionId - is this writeId</technical_language>

Target:
public static AcidTable decode(String encoded) throws IOException { if (!encoded.startsWith(PROLOG_V1)) { throw new IllegalStateException("Unsupported version."); } encoded = encoded.substring(PROLOG_V1.length()); byte[] decoded = Base64.decodeBase64(encoded); AcidTable table = null; try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(decoded))) { String databaseName = in.readUTF(); String tableName = in.readUTF(); boolean createPartitions = in.readBoolean(); long writeId = in.readLong(); TableType tableType = TableType.valueOf(in.readByte()); int thriftLength = in.readInt(); table = new AcidTable(databaseName, tableName, createPartitions, tableType); table.setWriteId(writeId); Table metaTable = null; if (thriftLength > 0) { metaTable = new Table(); try { byte[] thriftEncoded = new byte[thriftLength]; in.readFully(thriftEncoded, 0, thriftLength); new TDeserializer(new TCompactProtocol.Factory()).deserialize(metaTable, thriftEncoded); table.setTable(metaTable); } catch (TException e) { throw new IOException("Error deserializing meta store table.", e); } } } return table; }
Source:
<code>private static URL getServiceUrl() { try { if (service == null) { Path logFile = Files.createTempFile("edgedriver", ".log"); boolean isLegacy = System.getProperty("webdriver.edge.edgehtml") == null || Boolean.getBoolean("webdriver.edge.edgehtml"); EdgeDriverService.Builder<?, ?> builder = StreamSupport.stream(ServiceLoader.load(DriverService.Builder.class).spliterator(), false) .filter(b -> b instanceof EdgeDriverService.Builder) .map(b -> (EdgeDriverService.Builder<?, ?>) b) .filter(b -> b.isLegacy() == isLegacy) .findFirst().orElseThrow(WebDriverException::new); service = (EdgeDriverService) builder.withVerbose(true).withLogFile(logFile.toFile()).build(); <START> LOG.fine("edgedriver will log to " + logFile); <END> service.start(); Runtime.getRuntime().addShutdownHook(new Thread(() -> service.stop())); } return service.getUrl(); } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>This is deliberately this level</technical_language>

Target:
private static URL getServiceUrl() { try { if (service == null) { Path logFile = Files.createTempFile("edgedriver", ".log"); boolean isLegacy = System.getProperty("webdriver.edge.edgehtml") == null || Boolean.getBoolean("webdriver.edge.edgehtml"); EdgeDriverService.Builder<?, ?> builder = StreamSupport.stream(ServiceLoader.load(DriverService.Builder.class).spliterator(), false) .filter(b -> b instanceof EdgeDriverService.Builder) .map(b -> (EdgeDriverService.Builder<?, ?>) b) .filter(b -> b.isLegacy() == isLegacy) .findFirst().orElseThrow(WebDriverException::new); service = (EdgeDriverService) builder.withVerbose(true).withLogFile(logFile.toFile()).build(); LOG.info("edgedriver will log to " + logFile); service.start(); Runtime.getRuntime().addShutdownHook(new Thread(() -> service.stop())); } return service.getUrl(); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public Construct exec(Target t, Env environment, Construct... args) throws ConfigRuntimeException { MCPlayer m = environment.GetPlayer(); String listName; if(args.length == 2){ m = Static.GetPlayer(args[0]); listName = args[1].nval(); } else { listName = args[0].nval(); } if (listName.length() > 16) { <START> throw new ConfigRuntimeException("set_list_name([player,] name) expects name to be 16 characters or less", t); <END> } Static.AssertPlayerNonNull(m, t); m.setPlayerListName(listName); return new CVoid(t); }</code><technical_language>wrong constructor here, this is uncatchable exception, is reserved for system level code. need exception type ExceptionType.LengthException (or type be.)</technical_language>

Target:
public Construct exec(Target t, Env environment, Construct... args) throws ConfigRuntimeException { MCPlayer m = environment.GetPlayer(); String listName; if(args.length == 2){ m = Static.GetPlayer(args[0]); listName = args[1].nval(); } else { listName = args[0].nval(); } if (listName.length() > 16) { throw new ConfigRuntimeException("set_list_name([player,] name) expects name to be 16 characters or less", Exceptions.ExceptionType.LengthException, t); } Static.AssertPlayerNonNull(m, t); m.setPlayerListName(listName); return new CVoid(t); }
Source:
<code>public DistroXV1Request convert(StackV4Request source) { DistroXV1Request request = new DistroXV1Request(); request.setName(source.getName()); if (source.getEnvironmentCrn() != null) { <START> Optional<DetailedEnvironmentResponse> environment = getEnvironmentName(source.getEnvironmentCrn()); <END> environment.ifPresent(env -> request.setEnvironmentName(getIfNotNull(env, EnvironmentBaseResponse::getName))); } request.setImage(getIfNotNull(source.getImage(), imageConverter::convert)); request.setCluster(getIfNotNull(source.getCluster(), clusterConverter::convert)); request.setInstanceGroups(getIfNotNull(source.getInstanceGroups(), instanceGroupConverter::convertFrom)); request.setNetwork(getIfNotNull(source.getNetwork(), networkConverter::convertToNetworkV1Request)); request.setAws(getIfNotNull(source.getAws(), stackParameterConverter::convert)); request.setAzure(getIfNotNull(source.getAzure(), stackParameterConverter::convert)); request.setGcp(getIfNotNull(source.getGcp(), stackParameterConverter::convert)); request.setYarn(getIfNotNull(source.getYarn(), stackParameterConverter::convert)); request.setInputs(source.getInputs()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); request.setSdx(getIfNotNull(source.getSharedService(), sdxConverter::getSdx)); request.setGatewayPort(source.getGatewayPort()); request.setExternalDatabase(getIfNotNull(source.getExternalDatabase(), databaseRequestConverter::convert)); return request; }</code><technical_language>if source env crn woul query</technical_language>

Target:
public DistroXV1Request convert(StackV4Request source) { DistroXV1Request request = new DistroXV1Request(); request.setName(source.getName()); if (source.getEnvironmentCrn() != null) { getEnvironmentName(source.getEnvironmentCrn()).ifPresent(envName -> request.setEnvironmentName(envName)); } request.setImage(getIfNotNull(source.getImage(), imageConverter::convert)); request.setCluster(getIfNotNull(source.getCluster(), clusterConverter::convert)); request.setInstanceGroups(getIfNotNull(source.getInstanceGroups(), instanceGroupConverter::convertFrom)); request.setNetwork(getIfNotNull(source.getNetwork(), networkConverter::convertToNetworkV1Request)); request.setAws(getIfNotNull(source.getAws(), stackParameterConverter::convert)); request.setAzure(getIfNotNull(source.getAzure(), stackParameterConverter::convert)); request.setGcp(getIfNotNull(source.getGcp(), stackParameterConverter::convert)); request.setYarn(getIfNotNull(source.getYarn(), stackParameterConverter::convert)); request.setInputs(source.getInputs()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); request.setSdx(getIfNotNull(source.getSharedService(), sdxConverter::getSdx)); request.setGatewayPort(source.getGatewayPort()); request.setExternalDatabase(getIfNotNull(source.getExternalDatabase(), databaseRequestConverter::convert)); return request; }
Source:
<code><START> private void signalRemoving(Path p, SftpEventListener listener, ServerSession session, <END> boolean isDirectory) throws IOException { if (isDirectory) { listener.removingDirectory(session, p); } else { listener.removingFile(session, p); } }</code><technical_language>protected please - try allow users override behavior</technical_language>

Target:
protected void signalRemoving( Path p, SftpEventListener listener, ServerSession session, boolean isDirectory) throws IOException { if (isDirectory) { listener.removingDirectory(session, p); } else { listener.removingFile(session, p); } }
Source:
<code>void cleanObsoleteContent() { if (controlledProcessStateService.getCurrentState() == ControlledProcessState.State.RUNNING) { try { String hostName = getHostName(); PathAddress address = PathAddress.EMPTY_ADDRESS; if (!hostName.isEmpty()) { address = address.append(HOST, hostName); } ModelNode response = client.execute(Util.createOperation(CleanObsoleteContentHandler.OPERATION_NAME, address)); if (!FAILED.equals(response.get(OUTCOME).asString())) { if(response.get(RESULT).isDefined()) { ServerLogger.ROOT_LOGGER.debug(response.get(RESULT)); } } else { if (response.hasDefined(FAILURE_DESCRIPTION)) { ServerLogger.ROOT_LOGGER.error("Error cleaning content " + response.get(FAILURE_DESCRIPTION)); } else { ServerLogger.ROOT_LOGGER.error("Error cleaning content " + response); } } } catch (IOException e) { <START> ServerLogger.ROOT_LOGGER.error("Error cleaning content ", e); <END> } } }</code><technical_language>i18n</technical_language>

Target:
void cleanObsoleteContent() { if (controlledProcessStateService.getCurrentState() == ControlledProcessState.State.RUNNING) { try { PathAddress address = PathAddress.EMPTY_ADDRESS; if (!server) { ModelNode response = client.execute(Util.getReadAttributeOperation(PathAddress.EMPTY_ADDRESS, LOCAL_HOST_NAME)); if (SUCCESS.equals(response.get(OUTCOME).asString()) && response.get(RESULT).isDefined()) { address = address.append(HOST, response.get(RESULT).asString()); } else if (CANCELLED.equals(response.get(OUTCOME).asString())) { return; } else if (FAILED.equals(response.get(OUTCOME).asString())) { error(response); } } ModelNode response = client.execute(Util.createOperation(CleanObsoleteContentHandler.OPERATION_NAME, address)); if (SUCCESS.equals(response.get(OUTCOME).asString())) { if(response.get(RESULT).isDefined()) { ServerLogger.ROOT_LOGGER.debug(response.get(RESULT)); } } else if (CANCELLED.equals(response.get(OUTCOME).asString())) { return; } else if (FAILED.equals(response.get(OUTCOME).asString())) { error(response); } } catch (IOException e) { ServerLogger.ROOT_LOGGER.failedToCleanObsoleteContent(e); } } }
Source:
<code>private boolean isIDBrokerInstanceGroup(InstanceGroup instanceGroup) { <START> return groupNameIDBroker.equalsIgnoreCase(instanceGroup.getGroupName()); <END> }</code><technical_language>nit: a constant a function, another helper function. string compare directly? Also, static strings upper case. IDBROKER_GROUP_NAME.equalsIgnoreCase(instanceGroup.getGroupName());</technical_language>

Target:
private boolean isIDBrokerInstanceGroup(InstanceGroup instanceGroup) { return GROUP_NAME_ID_BROKER.equalsIgnoreCase(instanceGroup.getGroupName()); }