auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addPluginDependenciesAdditionalLibraries(List<BundleDependency> applicationDependencies) { List<BundleDependency> mulePlugins = applicationDependencies .stream() <START> .filter(bundleDependency -> Classifier.MULE_PLUGIN <END> .equals(bundleDependency.getDescriptor().getClassifier().orElse(null))) .collect(Collectors.toList()); Collection<Plugin> additionalDependenciesFromMulePlugins = resolveAdditionalDependenciesFromMulePlugins(mulePlugins); pluginsWithAdditionalDependencies.addAll(additionalDependenciesFromMulePlugins.stream() .filter(notIsRedefinedAtApplicationLevel()) .collect(Collectors.toList())); }</code><technical_language>static import</technical_language>

Target:
private void addPluginDependenciesAdditionalLibraries(List<BundleDependency> applicationDependencies) { List<BundleDependency> mulePlugins = applicationDependencies .stream() .filter(bundleDependency -> MULE_PLUGIN .equals(bundleDependency.getDescriptor().getClassifier().orElse(null))) .collect(Collectors.toList()); Collection<Plugin> additionalDependenciesFromMulePlugins = resolveAdditionalDependenciesFromMulePlugins(mulePlugins); pluginsWithAdditionalDependencies.addAll(additionalDependenciesFromMulePlugins.stream() .filter(isNotRedefinedAtApplicationLevel()) .collect(Collectors.toList())); }
Source:
<code>public JavaReferenceCodeMining(IJavaElement element, JavaEditor editor, IDocument document, ICodeMiningProvider provider, boolean showReferencesAtLeastOne) throws JavaModelException, BadLocationException { super(element, document, provider, null); this.showReferencesAtLeastOne= showReferencesAtLeastOne; <START> action= e -> new FindReferencesAction(editor).run(element); <END> }</code><technical_language>set in doResolve instead</technical_language>

Target:
public JavaReferenceCodeMining(IJavaElement element, JavaEditor editor, IDocument document, ICodeMiningProvider provider, boolean showReferencesAtLeastOne) throws JavaModelException, BadLocationException { super(element, document, provider, null); this.editor= editor; this.showReferencesAtLeastOne= showReferencesAtLeastOne; }
Source:
<code>public void testOpenIntervalFirstRuleConsistency() throws Exception { final String restPath = RestBaseController.ROOT_PATH + "/sldservice/cite:ClassificationPoints2/" + getServiceUrl() + ".xml?" + "attribute=bar&ramp=red&method=quantile&intervals=2&open=true"; Document dom = getAsDOM(restPath, 200); print(dom); ByteArrayOutputStream baos = new ByteArrayOutputStream(); print(dom, baos); String resultXml = baos.toString().replace("\r", "").replace("\n", ""); Rule[] rules = checkSLD(resultXml.replace("<Rules>", sldPrefix).replace("</Rules>", sldPostfix)); assertTrue(rules.length == 2); assertTrue(rules[0].getFilter() instanceof PropertyIsEqualTo); final String restPathJenks = RestBaseController.ROOT_PATH <START> + "/sldservice/cite:ClassificationPoints2/" <END> + getServiceUrl() + ".xml?" + "attribute=bar&ramp=red&method=jenks&intervals=2&open=true"; Document domJenks = getAsDOM(restPathJenks, 200); print(domJenks); ByteArrayOutputStream baosJenks = new ByteArrayOutputStream(); print(domJenks, baosJenks); String resultXmlJenks = baosJenks.toString().replace("\r", "").replace("\n", ""); Rule[] rulesJenks = checkSLD( resultXmlJenks .replace("<Rules>", sldPrefix) .replace("</Rules>", sldPostfix)); assertTrue(rulesJenks.length == 2); assertTrue(rulesJenks[0].getFilter() instanceof PropertyIsEqualTo); }</code><technical_language>check rule here, overlap</technical_language>

Target:
public void testOpenIntervalFirstRuleConsistency() throws Exception { final String restPath = RestBaseController.ROOT_PATH + "/sldservice/cite:ClassificationPoints2/" + getServiceUrl() + ".xml?" + "attribute=bar&ramp=red&method=quantile&intervals=2&open=true"; Document dom = getAsDOM(restPath, 200); print(dom); ByteArrayOutputStream baos = new ByteArrayOutputStream(); print(dom, baos); String resultXml = baos.toString().replace("\r", "").replace("\n", ""); Rule[] rules = checkSLD(resultXml.replace("<Rules>", sldPrefix).replace("</Rules>", sldPostfix)); assertTrue(rules.length == 2); assertTrue(rules[0].getFilter() instanceof PropertyIsEqualTo); assertTrue(rules[1].getFilter() instanceof PropertyIsGreaterThan); checkNotOverlappingRules(rules[0], rules[1]); final String restPathJenks = RestBaseController.ROOT_PATH + "/sldservice/cite:ClassificationPoints2/" + getServiceUrl() + ".xml?" + "attribute=bar&ramp=red&method=jenks&intervals=2&open=true"; Document domJenks = getAsDOM(restPathJenks, 200); print(domJenks); ByteArrayOutputStream baosJenks = new ByteArrayOutputStream(); print(domJenks, baosJenks); String resultXmlJenks = baosJenks.toString().replace("\r", "").replace("\n", ""); Rule[] rulesJenks = checkSLD( resultXmlJenks .replace("<Rules>", sldPrefix) .replace("</Rules>", sldPostfix)); assertTrue(rulesJenks.length == 2); assertTrue(rulesJenks[0].getFilter() instanceof PropertyIsEqualTo); assertTrue(rulesJenks[1].getFilter() instanceof PropertyIsGreaterThan); checkNotOverlappingRules(rulesJenks[0], rulesJenks[1]); }
Source:
<code>public LatestLinkBuilder(File dir) throws IOException { System.out.println(String.format("Writing plugin symlinks and redirects to dir: %s", dir)); index = new IndexHtmlBuilder(dir,"Permalinks to latest files"); <START> htaccess = new PrintWriter(new OutputStreamWriter(new FileOutputStream(new File(dir,".htaccess")), "UTF-8")); <END> htaccess.println("# GENERATED. DO NOT MODIFY."); htaccess.println("RewriteEngine on"); }</code><technical_language>parameter true (for autoFlush) forgotten in go</technical_language>

Target:
public LatestLinkBuilder(File dir) throws IOException { System.out.println(String.format("Writing plugin symlinks and redirects to dir: %s", dir)); index = new IndexHtmlBuilder(dir,"Permalinks to latest files"); htaccess = new PrintWriter(new OutputStreamWriter(new FileOutputStream(new File(dir,".htaccess"), true), "UTF-8")); htaccess.println("# GENERATED. DO NOT MODIFY."); htaccess.println("RewriteEngine on"); }
Source:
<code>private long calculateWaitTimeMillis(ExponentialBackOff backoff, Optional<TDClientException> rootCause) { long waitTimeMillis = backoff.nextWaitTimeMillis(); if (rootCause.isPresent() && rootCause.get() instanceof TDClientHttpTooManyRequestsException) { TDClientHttpTooManyRequestsException tooManyRequestsException = (TDClientHttpTooManyRequestsException) rootCause.get(); Optional<Long> retryAfterSeconds = tooManyRequestsException.getRetryAfterSeconds(); if (retryAfterSeconds.isPresent()) { <START> long maxWaitMillis = config.retryLimit * config.retryMaxIntervalMillis; <END> long retryAfterMillis = SECONDS.toMillis(retryAfterSeconds.get()); if (retryAfterMillis > maxWaitMillis) { throw tooManyRequestsException; } waitTimeMillis = Math.max(waitTimeMillis, retryAfterMillis); } } return waitTimeMillis; }</code><technical_language>Hmm.. wait more config.retryMaxIntervalMillis..</technical_language>

Target:
private long calculateWaitTimeMillis(ExponentialBackOff backoff, Optional<TDClientException> rootCause) { long waitTimeMillis = backoff.nextWaitTimeMillis(); if (rootCause.isPresent() && rootCause.get() instanceof TDClientHttpException) { TDClientHttpException httpException = (TDClientHttpException) rootCause.get(); Optional<Date> retryAfter = httpException.getRetryAfter(); if (retryAfter.isPresent()) { long maxWaitMillis = config.retryLimit * config.retryMaxIntervalMillis; long now = System.currentTimeMillis(); long retryAfterMillis = retryAfter.get().getTime() - now; if (retryAfterMillis > maxWaitMillis) { throw httpException; } waitTimeMillis = Math.max(waitTimeMillis, retryAfterMillis); } } return waitTimeMillis; }
Source:
<code><START> default <U> U fold(Function<Seq<? extends E>, ? extends U> fInvalid, Function<? super T, ? extends U> fValid) { <END> Objects.requireNonNull(fInvalid, "fInvalid is null"); Objects.requireNonNull(fValid, "fValid is null"); if (isInvalid()) { final Seq<? extends E> error = this.getErrors(); return fInvalid.apply(error); } else { final T value = this.get(); return fValid.apply(value); } }</code><technical_language>contra-variant position, i.e. Function<? super Seq<? super E>, ? extends U></technical_language>

Target:
default <U> U fold(Function<Seq<? extends E>, ? extends U> fInvalid, Function<? super T, ? extends U> fValid) { Objects.requireNonNull(fInvalid, "fInvalid is null"); Objects.requireNonNull(fValid, "fValid is null"); if (isInvalid()) { return fInvalid.apply(this.getErrors()); } else { final T value = this.get(); return fValid.apply(value); } }
Source:
<code>private boolean isInvariantTypeCastSafe( AnnotatedTypeMirror castType, AnnotatedTypeMirror exprType, AnnotationMirror top) { if (!isTypeCastSafe(castType, exprType)) { return false; } AnnotationMirror castTypeAnno = castType.getEffectiveAnnotationInHierarchy(top); AnnotationMirror exprTypeAnno = exprType.getEffectiveAnnotationInHierarchy(top); <START> ; <END> if (atypeFactory.hasQualifierParameterInHierarchy(exprType, top)) { return atypeFactory.getQualifierHierarchy().isSubtype(castTypeAnno, exprTypeAnno); } AnnotationMirror bottom = atypeFactory.getQualifierHierarchy().getBottomAnnotation(top); return AnnotationUtils.areSame(castTypeAnno, bottom) && AnnotationUtils.areSame(exprTypeAnno, bottom); }</code><technical_language>Remove</technical_language>

Target:
private boolean isInvariantTypeCastSafe( AnnotatedTypeMirror castType, AnnotatedTypeMirror exprType, AnnotationMirror top) { if (!isTypeCastSafe(castType, exprType)) { return false; } AnnotationMirror castTypeAnno = castType.getEffectiveAnnotationInHierarchy(top); AnnotationMirror exprTypeAnno = exprType.getEffectiveAnnotationInHierarchy(top); if (atypeFactory.hasQualifierParameterInHierarchy(exprType, top)) { return atypeFactory.getQualifierHierarchy().isSubtype(castTypeAnno, exprTypeAnno); } AnnotationMirror bottom = atypeFactory.getQualifierHierarchy().getBottomAnnotation(top); return AnnotationUtils.areSame(castTypeAnno, bottom) && AnnotationUtils.areSame(exprTypeAnno, bottom); }
Source:
<code>public MessageEncoder visit(AstExpressionValue<?> value, Void parameter) { Supplier<Object> supplier = () -> value.getValue(Object.class); <START> return new WriteExpressionEncoder(supplier, value.getExpression()); <END> }</code><technical_language>Suggest return new WriteExpressionEncoder(value::getValue, value.getExpression); instead</technical_language>

Target:
public MessageEncoder visit(AstExpressionValue<?> value, Void parameter) { return new WriteExpressionEncoder(value::getValue, value.getExpression()); }
Source:
<code>ThrowingEvaluator(String message, Throwable cause) { <START> this.exception = new ScriptEvaluationException(message, cause); <END> }</code><technical_language>Hmmmm... if evaluation is cause, throw ExtensionConfigurationException get rid of ScriptEvaluationException subclass (if unused)</technical_language>

Target:
ThrowingEvaluator(String message, Throwable cause) { this.exception = new ExtensionConfigurationException(message, cause); }
Source:
<code><START> private org.eclipse.emf.common.util.EList<Port> getAllInheritedPorts(org.eclipse.uml2.uml.Class aClass) { <END> org.eclipse.emf.common.util.BasicEList<Port> ports = new org.eclipse.emf.common.util.BasicEList<Port>(); ports.addAll(aClass.getOwnedPorts()); for (org.eclipse.uml2.uml.Classifier parent : aClass.allParents()) { if (parent instanceof org.eclipse.uml2.uml.Class) { ports.addAll(getAllInheritedPorts((org.eclipse.uml2.uml.Class)parent)); } } return ports; }</code><technical_language>Please, generic interface for variable declarations. e.g., here: private List<Port> getAllInheritedPorts(...) List<Port> ports = new org.eclipse.emf.common.util.BasicEList<Port>(); Then, do a reason instantiate a BasicEList instead of a simple ArrayList</technical_language>

Target:
private List<Port> getAllInheritedPorts(org.eclipse.uml2.uml.Class aClass) { ArrayList<Port> ports = new ArrayList<Port>(); ports.addAll(aClass.getOwnedPorts()); for (org.eclipse.uml2.uml.Classifier parent : aClass.allParents()) { if (parent instanceof org.eclipse.uml2.uml.Class) { ports.addAll(getAllInheritedPorts((org.eclipse.uml2.uml.Class)parent)); } } return ports; }
Source:
<code>public static LocalDate getClosestExpirationFromStaticDate(Matcher matcher) { int day = Integer.valueOf(matcher.group(1)); int month = Integer.valueOf(matcher.group(2)); int year = LocalDate.now().getYear(); boolean extensionInNextYear; LocalDate extensionDate = LocalDate.of(year, month, day); extensionInNextYear = extensionDate.isBefore(LocalDate.now()); <START> LocalDate localDate = LocalDate.of(year, month, day); <END> if (extensionInNextYear) { localDate = localDate.plusYears(1); } return localDate; }</code><technical_language>this moment, need localDate, extensionDate return it</technical_language>

Target:
public static LocalDate getClosestExpirationFromStaticDate(Matcher matcher) { int day = Integer.valueOf(matcher.group(1)); int month = Integer.valueOf(matcher.group(2)); int year = LocalDate.now().getYear(); LocalDate extensionDate = LocalDate.of(year, month, day); boolean extensionThisYear = LocalDate.now().isBefore(extensionDate); if (!extensionThisYear) { extensionDate = extensionDate.plusYears(1); } return extensionDate; }
Source:
<code>abstract void storeCommand() throws PersistenceException; protected String createCql(String user, String cql) { <START> if (StringUtils.isBlank(user)) return ""; <END> if (StringUtils.isNotBlank(cql)) { cql = "( " + cql + ") AND user='" + user + "'"; } else { cql = "user='" + user + "'"; } return cql; }</code><technical_language>question: CQL returned if is user</technical_language>

Target:
abstract void storeCommand() throws PersistenceException; protected String addUserConstraintToCql(String user, String cql) { if (StringUtils.isNotBlank(user)) { if (StringUtils.isNotBlank(cql)) { cql = cql + " AND user='" + user + "'"; } else { cql = "user='" + user + "'"; } } return cql; }
Source:
<code>public void putCount(final CountCategory category, final int value) { if (value < 0) { <START> throw new IllegalArgumentException("Count value must be greater than zero"); <END> } counts.put(category, value); }</code><technical_language>Zero count is allowed, error message is misleading. "Count non-negative" sufficiently clear correct. Also, add a note allowed range parameter: @param non-negative character count</technical_language>

Target:
public void putCount(final CountCategory category, final int value) { if (value < 0) { throw new IllegalArgumentException("Count value must be greater than or equals to zero"); } counts.put(category, value); }
Source:
<code>public void testInboundAdapterWithMessageConverterDefaults() { @SuppressWarnings("unchecked") List<HttpMessageConverter<?>> messageConverters = TestUtils.getPropertyValue(postOnlyAdapterWithCustomConverter, "messageConverters", List.class); <START> assertThat(messageConverters.size() > 1 , is(true)); <END> assertThat(messageConverters.get(0), instanceOf(SerializingHttpMessageConverter.class)); }</code><technical_language>assertTrue? :smile:</technical_language>

Target:
public void testInboundAdapterWithMessageConverterDefaults() { @SuppressWarnings("unchecked") List<HttpMessageConverter<?>> messageConverters = TestUtils.getPropertyValue(adapterWithCustomConverterWithDefaults, "messageConverters", List.class); assertTrue("There should be more than 1 message converter. The customized one and the defaults", messageConverters.size() > 1); assertThat(messageConverters.get(0), instanceOf(SerializingHttpMessageConverter.class)); }
Source:
<code>private ArrayList<Long> getPathIDsForType(BlackboardArtifact.ARTIFACT_TYPE type) throws TskCoreException { <START> ArrayList<Long> idList = new ArrayList(); <END> for (BlackboardArtifact artifact : currentCase.getSleuthkitCase().getBlackboardArtifacts(type)) { BlackboardAttribute pathIDAttribute = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID)); if (pathIDAttribute != null) { long contentID = pathIDAttribute.getValueLong(); if (contentID != -1) { idList.add(contentID); } } } return idList; }</code><technical_language>add <> "new ArrayList()" avoid warnings</technical_language>

Target:
private Set<Long> getPathIDsForType(BlackboardArtifact.ARTIFACT_TYPE type) throws TskCoreException { Set<Long> idList = new HashSet<>(); for (BlackboardArtifact artifact : currentCase.getSleuthkitCase().getBlackboardArtifacts(type)) { BlackboardAttribute pathIDAttribute = artifact.getAttribute(new BlackboardAttribute.Type(TSK_PATH_ID)); if (pathIDAttribute != null) { long contentID = pathIDAttribute.getValueLong(); if (contentID != -1) { idList.add(contentID); } } } return idList; }
Source:
<code>public void shouldPreserveAddressOrderOnInsertions() { Socks5Proxy proxy = Socks5Proxy.getSocks5Proxy(); <START> List<String> addresses = new ArrayList<>(proxy.getLocalAddresses()); <END> for (int i = 1 ; i <= 3; i++) { String addr = Integer.toString(i); if (!addresses.contains(addr)) { addresses.add(addr); } } for (String address : addresses) { proxy.addLocalAddress(address); } List<String> localAddresses = proxy.getLocalAddresses(); for (int i = 0; i < addresses.size(); i++) { assertEquals(addresses.get(i), localAddresses.get(i)); } }</code><technical_language>This LinkedHashSet, reduce LOC !contains() check avoided</technical_language>

Target:
public void shouldPreserveAddressOrderOnInsertions() { Socks5Proxy proxy = Socks5Proxy.getSocks5Proxy(); LinkedHashSet<String> addresses = new LinkedHashSet<>(proxy.getLocalAddresses()); for (int i = 1 ; i <= 3; i++) { addresses.add(Integer.toString(i)); } for (String address : addresses) { proxy.addLocalAddress(address); } List<String> localAddresses = proxy.getLocalAddresses(); Iterator<String> iterator = addresses.iterator(); for (int i = 0; i < addresses.size(); i++) { assertEquals(iterator.next(), localAddresses.get(i)); } }
Source:
<code>public void beforeMethod() throws Exception { subConsumers = new LineConsumer[] { lineConsumer1, lineConsumer2, lineConsumer3 }; concurrentCompositeLineConsumer = new ConcurrentCompositeLineConsumer(subConsumers); <START> executor = Executors.newFixedThreadPool(5); <END> }</code><technical_language>Do 5 threads here</technical_language>

Target:
public void beforeMethod() throws Exception { subConsumers = new LineConsumer[] { lineConsumer1, lineConsumer2, lineConsumer3 }; concurrentCompositeLineConsumer = new ConcurrentCompositeLineConsumer(subConsumers); executor = Executors.newFixedThreadPool(3); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_google_login); mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) .addScope(new Scope(Scopes.PROFILE)) .addScope(new Scope(Scopes.EMAIL)) .build(); <START> findViewById(R.id.sign_in_button).setOnClickListener(this); <END> }</code><technical_language>is listener in activity_google_login.xml file</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_google_login); mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) .addScope(new Scope(Scopes.PROFILE)) .addScope(new Scope(Scopes.EMAIL)) .build(); mGoogleSingInButton = (SignInButton) findViewById(R.id.googleSignInButton); mButtonCancelGoogleConnection = (Button) findViewById(R.id.buttonCancelGoogleConnection); mProgressBarGoogleConnection = (ProgressBar) findViewById(R.id.progressBarGoogleConnection); mTextViewGoogleConnecting = (TextView) findViewById(R.id.textViewGoogleConnecting); mGoogleSingInButton.setOnClickListener(this); }
Source:
<code>public NonBlockingStatsDClient build() throws StatsDClientException { Callable<SocketAddress> lookup = addressLookup; <START> Callable<SocketAddress> telemetryLookup = null; <END> if (lookup == null) { lookup = staticStatsDAddressResolution(hostname, port); } if (telemetryLookup == null) { if (telemetryHostname == null) { telemetryLookup = lookup; } else { telemetryLookup = staticStatsDAddressResolution(telemetryHostname, telemetryPort); } } return new NonBlockingStatsDClient(prefix, queueSize, constantTags, errorHandler, lookup, telemetryLookup, timeout, socketBufferSize, maxPacketSizeBytes, entityID, bufferPoolSize, processorWorkers, senderWorkers, blocking, enableTelemetry, telemetryFlushInterval); }</code><technical_language>Callable<SocketAddress> telemetryLookup = telemetryAddressLookup</technical_language>

Target:
public NonBlockingStatsDClient build() throws StatsDClientException { Callable<SocketAddress> lookup = addressLookup; Callable<SocketAddress> telemetryLookup = telemetryAddressLookup; if (lookup == null) { lookup = staticStatsDAddressResolution(hostname, port); } if (telemetryLookup == null) { if (telemetryHostname == null) { telemetryLookup = lookup; } else { telemetryLookup = staticStatsDAddressResolution(telemetryHostname, telemetryPort); } } return new NonBlockingStatsDClient(prefix, queueSize, constantTags, errorHandler, lookup, telemetryLookup, timeout, socketBufferSize, maxPacketSizeBytes, entityID, bufferPoolSize, processorWorkers, senderWorkers, blocking, enableTelemetry, telemetryFlushInterval); }
Source:
<code>public void associateCookie(final AgentIdentifier agentIdentifier, final String cookie) { final String uuid = agentIdentifier.getUuid(); final String key = agentCacheKey(uuid); List<String> uuids = singletonList(agentIdentifier.getUuid()); AgentMutex mutex = agentMutexes.acquire(uuids); synchronized (mutex) { transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Agent agent = fetchAgentFromDBByUUID(uuid); if (agent == null) { <START> agent = new Agent(uuid, agentIdentifier.getHostName(), agentIdentifier.getIpAddress(), cookie); <END> } else { agent.setFieldValues(cookie, agentIdentifier.getHostName(), agentIdentifier.getIpAddress()); } getHibernateTemplate().saveOrUpdate(agent); final Agent updatedAgent = agent; registerCommitCallback(() -> clearCacheAndNotifyAgentEntityChangeListeners(key, updatedAgent)); } }); agentMutexes.release(uuids, mutex); } }</code><technical_language>this a security issue? unregistered agent a request associate cookie end registered enabled in GoCD</technical_language>

Target:
public void associateCookie(final AgentIdentifier agentIdentifier, final String cookie) { final String uuid = agentIdentifier.getUuid(); final String key = agentCacheKey(uuid); List<String> uuids = singletonList(agentIdentifier.getUuid()); AgentMutex mutex = agentMutexes.acquire(uuids); synchronized (mutex) { transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Agent agent = fetchAgentFromDBByUUID(uuid); if (agent == null) { throw new UnregisteredAgentException(format("Agent [%s] is not registered.", uuid), uuid); } agent.setFieldValues(cookie, agentIdentifier.getHostName(), agentIdentifier.getIpAddress()); getHibernateTemplate().saveOrUpdate(agent); final Agent updatedAgent = agent; registerAfterCommitCallback(() -> clearCacheAndNotifyAgentEntityChangeListeners(key, updatedAgent)); } }); agentMutexes.release(uuids, mutex); } }
Source:
<code>public static String getCertKeyIdSubject(X509Certificate cert) { if (null == cert) { return null; } byte[] subjectKeyID = cert.getExtensionValue(SUBJECT_KEY_ID); String ski = null; try { if (subjectKeyID != null) { DERDecoder extVal = new DERDecoder(subjectKeyID); extVal.expect(DERDecoder.TYPE_OCTET_STRING); <START> extVal.getLength(); <END> extVal.expect(DERDecoder.TYPE_OCTET_STRING); int keyIDLen = extVal.getLength(); byte[] hexValue = extVal.getBytes(keyIDLen); ski = Hex.encodeHexString(hexValue); } } catch (WSSecurityException e) { LOG.error("Unable to convert SKI into human readable {}", e.getLocalizedMessage(), e); } return ski; }</code><technical_language>do need this method</technical_language>

Target:
public static String getCertKeyIdSubject(X509Certificate cert) { String ski = null; if (null != cert) { byte[] subjectKeyID = cert.getExtensionValue(SUBJECT_KEY_ID); try { if (subjectKeyID != null) { DERDecoder extVal = new DERDecoder(subjectKeyID); extVal.expect(DERDecoder.TYPE_OCTET_STRING); extVal.getLength(); extVal.expect(DERDecoder.TYPE_OCTET_STRING); int keyIDLen = extVal.getLength(); byte[] hexValue = extVal.getBytes(keyIDLen); ski = Hex.encodeHexString(hexValue); } } catch (WSSecurityException e) { LOG.error("Unable to decode certificate subject: {}", e.getLocalizedMessage(), e); } } return ski; }
Source:
<code>public static boolean hasUnresolvedReferences(@NotNull List<GoExpression> expressionList) { for (GoExpression expression : expressionList) { if (expression instanceof GoReferenceExpression) { if (expression.getReference() == null || <START> expression.getReference().resolve() == null) { <END> return true; } if (isIllegalUseOfTypeAsExpression(expression)) { return true; } } } return false; }</code><technical_language>Please extract a variable simplify</technical_language>

Target:
public static boolean hasUnresolvedReferences(@NotNull List<GoExpression> expressionList) { for (GoExpression expression : expressionList) { if (expression instanceof GoReferenceExpression) { PsiReference ref = expression.getReference(); if (ref == null || ref.resolve() == null || isIllegalUseOfTypeAsExpression(expression)) return true; } } return false; }
Source:
<code>public void initTopologyId() { if (persistenceManager.isPreloaded()) { if (preloadedTopologyId > 0) { clusterTopologyManager.setInitialCacheTopologyId(componentRegistry.getCacheName(), preloadedTopologyId + 1); } return; } AtomicInteger maxTopologyId = new AtomicInteger(preloadedTopologyId); Publisher<MarshalledEntry<Object, Object>> publisher = persistenceManager.publishEntries(false, true); <START> Flowable.fromPublisher(publisher).map(MarshalledEntry::getMetadata).blockingForEach(metadata -> { <END> EntryVersion entryVersion = metadata.version(); if (entryVersion instanceof SimpleClusteredVersion) { int entryTopologyId = ((SimpleClusteredVersion) entryVersion).topologyId; if (maxTopologyId.get() < entryTopologyId) { maxTopologyId.updateAndGet(current -> Math.max(current, entryTopologyId)); } } }); if (maxTopologyId.get() > 0) { clusterTopologyManager.setInitialCacheTopologyId(componentRegistry.getCacheName(), maxTopologyId.get() + 1); } }</code><technical_language>Is benefit in extracting getMetadata() call a separate step</technical_language>

Target:
public void initTopologyId() { if (persistenceManager.isPreloaded()) { if (preloadedTopologyId > 0) { clusterTopologyManager.setInitialCacheTopologyId(componentRegistry.getCacheName(), preloadedTopologyId + 1); } return; } AtomicInteger maxTopologyId = new AtomicInteger(preloadedTopologyId); Publisher<MarshalledEntry<Object, Object>> publisher = persistenceManager.publishEntries(false, true); Flowable.fromPublisher(publisher).blockingForEach(me -> { Metadata metadata = me.getMetadata(); EntryVersion entryVersion = metadata.version(); if (entryVersion instanceof SimpleClusteredVersion) { int entryTopologyId = ((SimpleClusteredVersion) entryVersion).topologyId; if (maxTopologyId.get() < entryTopologyId) { maxTopologyId.updateAndGet(current -> Math.max(current, entryTopologyId)); } } }); if (maxTopologyId.get() > 0) { clusterTopologyManager.setInitialCacheTopologyId(componentRegistry.getCacheName(), maxTopologyId.get() + 1); } }
Source:
<code>private List<FeedbackSession> getFeedbackSessionEntitiesNeedingClosedEmail() { Query q = getPm().newQuery(FeedbackSession.class); q.declareParameters("boolean sentParam, boolean enableParam, Enum notTypeParam"); q.setFilter("sentClosedEmail == sentParam && isClosedEmailEnabled == enableParam " <START> + "&& feedbackSessionType != notTypeParam"); <END> return (List<FeedbackSession>) q.execute(false, false, FeedbackSessionType.PRIVATE); }</code><technical_language>filter closing time</technical_language>

Target:
private List<FeedbackSession> getFeedbackSessionEntitiesNeedingClosedEmail() { Query q = getPm().newQuery(FeedbackSession.class); q.declareParameters("boolean sentParam, boolean enableParam, Enum notTypeParam"); q.setFilter("sentClosedEmail == sentParam && isClosingEmailEnabled == enableParam " + "&& feedbackSessionType != notTypeParam"); return (List<FeedbackSession>) q.execute(false, true, FeedbackSessionType.PRIVATE); }
Source:
<code>public boolean validate(String value, String digest) { <START> String salt = StringUtils.substringBefore(digest, delimiter); <END> return saltValue(value, salt).equals(digest); }</code><technical_language>if is delimiter here? Ideally empty String, support case of a hashed salts. a test-case for this well</technical_language>

Target:
public boolean validate(String value, String digest) { if (delimiter == NO_DELIMITER) { return (digestSource.digest(value, new byte[0])).equals(digest); } try { if (digest.indexOf(delimiter) < 0) { throw new IllegalArgumentException("No delimiter found in digest."); } final String saltBase64 = StringUtils.substringBefore(digest, valueOf(delimiter)); final byte[] salt = decode(saltBase64.getBytes(EncodingUtils.ENCODING)); return (saltBase64 + delimiter + digestSource.digest(value, salt)).equals(digest); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
Source:
<code>public void testIteratorContents() { Deque<Character> expected = new LinkedList<>(); assertFalse(charQueue.iterator().hasNext()); for (int i = 0; i < 50; i++) { char c = testString.charAt(i); charQueue.put(c); expected.addFirst(c); } LinkedList<Character> actual = new LinkedList<>(); Iterators.addAll(actual, charQueue.iterator()); assertTrue(containsSameElements(expected, actual)); <START> <END> for (int i = 50; i < 60; i++) { char c = testString.charAt(i); charQueue.put(c); charQueue.flushInputBuffer(); expected.addFirst(c); } actual = new LinkedList<>(); Iterators.addAll(actual, charQueue.iterator()); assertTrue(containsSameElements(expected, actual)); for (int i = 0; i < 30; i++) { charQueue.take(); expected.removeLast(); } actual = new LinkedList<>(); Iterators.addAll(actual, charQueue.iterator()); assertTrue(containsSameElements(expected, actual)); while (!charQueue.isEmpty()) { charQueue.take(); expected.removeLast(); } assertFalse(charQueue.iterator().hasNext()); }</code><technical_language>flush if is good? iterate list while flushing in for loop? set<?> bla; for( Object actualO: actual){ bla.add( actualO ); charQueue.flush(); }</technical_language>

Target:
public void testIteratorContents() { Deque<String> expected = new LinkedList<>(); assertFalse(fStringQueue.iterator().hasNext()); for (int i = 0; i < 50; i++) { String element = TEST_STRING.get(i); fStringQueue.put(NonNullUtils.checkNotNull(element)); expected.addFirst(element); } LinkedList<String> actual = new LinkedList<>(); Iterators.addAll(actual, fStringQueue.iterator()); containsSameElements(expected, actual); for (int i = 50; i < 60; i++) { String c = TEST_STRING.get(i); fStringQueue.put(NonNullUtils.checkNotNull(c)); fStringQueue.flushInputBuffer(); expected.addFirst(c); } actual = new LinkedList<>(); Iterators.addAll(actual, fStringQueue.iterator()); containsSameElements(expected, actual); for (int i = 0; i < 30; i++) { fStringQueue.take(); expected.removeLast(); } actual = new LinkedList<>(); Iterators.addAll(actual, fStringQueue.iterator()); containsSameElements(expected, actual); while (!fStringQueue.isEmpty()) { fStringQueue.take(); expected.removeLast(); } assertFalse(fStringQueue.iterator().hasNext()); }
Source:
<code>public static void fillTableWithIdx(BenchmarkConfiguration cfg, IgniteEx ignite, String tblName, long range, CacheAtomicityMode atomicMode) { IgniteSemaphore sem = ignite.semaphore("sql-setup", 1, true, true); try { if (sem.tryAcquire()) { println(cfg, "Create table..."); StringBuilder qry = new StringBuilder(String.format("CREATE TABLE %s (", tblName) + <START> "id LONG PRIMARY KEY, " + <END> "DEC_COL DECIMAL, " + "DATE_COL DATE, " + "BIG_INT_COL BIGINT" + ") WITH \"wrap_value=true"); if (atomicMode != null) qry.append(", atomicity=").append(atomicMode.name()); qry.append("\";"); String qryStr = qry.toString(); println(cfg, "Creating table with schema: " + qryStr); GridQueryProcessor qProc = ignite.context().query(); qProc.querySqlFields(new SqlFieldsQuery(qryStr), true); println(cfg, "Populate data..."); for (long l = 1; l < range; ++l) { qProc.querySqlFields( new SqlFieldsQuery(String.format("INSERT INTO %s VALUES (?, ?, ?, ?)", tblName)) .setArgs(l, new BigDecimal(l + 1), LocalDate.ofEpochDay(l), l + 2), true); if (l % 10000 == 0) println(cfg, "Populate " + l); } qProc.querySqlFields(new SqlFieldsQuery(String.format("CREATE INDEX idx1 ON %s (DEC_COL, " + "DATE_COL) inline_size 16", tblName)), true); qProc.querySqlFields(new SqlFieldsQuery(String.format("CREATE INDEX idx2 ON %s (DATE_COL, " + "BIG_INT_COL) inline_size 16", tblName)), true); println(cfg, "Finished populating data"); } else { println(cfg, "Waits for setup..."); sem.acquire(); } } finally { sem.release(); } }</code><technical_language>I is append instead of + symbol</technical_language>

Target:
public static void fillTableWithIdx(BenchmarkConfiguration cfg, IgniteEx ignite, String tblName, long range, CacheAtomicityMode atomicMode) { IgniteSemaphore sem = ignite.semaphore("sql-setup", 1, true, true); try { if (sem.tryAcquire()) { println(cfg, "Create table..."); StringBuilder qry = new StringBuilder(String.format("CREATE TABLE %s (", tblName) + "id LONG PRIMARY KEY, " + "DEC_COL DECIMAL, " + "DATE_COL DATE, " + "BIG_INT_COL BIGINT" + ") WITH \"wrap_value=true"); if (atomicMode != null) qry.append(", atomicity=").append(atomicMode.name()); qry.append("\";"); String qryStr = qry.toString(); println(cfg, "Creating table with schema: " + qryStr); GridQueryProcessor qProc = ignite.context().query(); qProc.querySqlFields(new SqlFieldsQuery(qryStr), true); println(cfg, "Populate data..."); for (long r = 1; r < range; ++r) { qProc.querySqlFields( new SqlFieldsQuery(String.format("INSERT INTO %s VALUES (?, ?, ?, ?)", tblName)) .setArgs(r, new BigDecimal(r + 1), LocalDate.ofEpochDay(r), r + 2), true); if (r % 10000 == 0) println(cfg, "Populate " + r); } qProc.querySqlFields(new SqlFieldsQuery(String.format("CREATE INDEX idx1 ON %s (DEC_COL, " + "DATE_COL) inline_size 16", tblName)), true); qProc.querySqlFields(new SqlFieldsQuery(String.format("CREATE INDEX idx2 ON %s (DATE_COL, " + "BIG_INT_COL) inline_size 16", tblName)), true); println(cfg, "Finished populating data"); } else { println(cfg, "Waits for setup..."); sem.acquire(); } } finally { sem.release(); } }
Source:
<code>public Result getAppResponse() { try { if (responseFuture.isDone()) { return responseFuture.get(); } } catch (Exception e) { logger.error("Got exception when trying to fetch the underlying result from AsyncRpcResult.", e); } ConsumerModel consumerModel = ApplicationModel.getConsumerModel(invocation.getTargetServiceUniqueName()); <START> String methodName = invocation.getMethodName(); <END> String params = ReflectUtils.getDesc(invocation.getParameterTypes()); MethodDescriptor method = consumerModel.getServiceModel().getMethod(methodName, params); return new AppResponse(ReflectUtils.defaultReturn(method.getReturnClass())); }</code><technical_language>I get consumerModel invocation attributes</technical_language>

Target:
public Result getAppResponse() { try { if (responseFuture.isDone()) { return responseFuture.get(); } } catch (Exception e) { logger.error("Got exception when trying to fetch the underlying result from AsyncRpcResult.", e); } return createDefaultValue(invocation); }
Source:
<code>public UiAction.Description getDescription(RevisionResource resource) { PatchSet.Id current = resource.getChange().currentPatchSetId(); Map<String, String> params = ImmutableMap.of( <START> "patchSetNumber", <END> String.valueOf(resource.getPatchSet().getPatchSetId()), "branch", resource.getChange().getDest().getShortName()); return new UiAction.Description() .setLabel(label) .setTitle(tooltipPattern.replace(params)) .setVisible(!resource.getPatchSet().isDraft() && resource.getChange().getStatus().isOpen() && resource.getPatchSet().getId().equals(current) && resource.getControl().canSubmit()); }</code><technical_language>patchSet</technical_language>

Target:
public UiAction.Description getDescription(RevisionResource resource) { PatchSet.Id current = resource.getChange().currentPatchSetId(); Map<String, String> params = ImmutableMap.of( "patchSet", String.valueOf(resource.getPatchSet().getPatchSetId()), "branch", resource.getChange().getDest().getShortName()); return new UiAction.Description() .setLabel(label) .setTitle(Strings.emptyToNull(titlePattern.replace(params))) .setVisible(!resource.getPatchSet().isDraft() && resource.getChange().getStatus().isOpen() && resource.getPatchSet().getId().equals(current) && resource.getControl().canSubmit()); }
Source:
<code>public boolean configure(StaplerRequest req, JSONObject json) throws FormException { try { configuredBuildDiscarders.rebuildHetero(req, json, BackgroundBuildDiscarderStrategyDescriptor.all(), "configuredBuildDiscarders"); return true; } catch (IOException x) { <START> throw new FormException(x, "artifactManagerFactories"); <END> } }</code><technical_language>shipit: suggestion throw new FormException(x, "configuredBuildDiscarders");</technical_language>

Target:
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { try { configuredBuildDiscarders.rebuildHetero(req, json, GlobalBuildDiscarderStrategyDescriptor.all(), "configuredBuildDiscarders"); return true; } catch (IOException x) { throw new FormException(x, "configuredBuildDiscarders"); } }
Source:
<code>public static void invokeMethod(Method method, Object methodObj, Object methodParam) { try { method.invoke(methodObj, methodParam); } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException e) { <START> debug("Could not update config via %s: %s", method.getName(), e.getMessage()); <END> } }</code><technical_language>minor: rephrase error message</technical_language>

Target:
public static Object invokeMethod(Method method, Object methodObj, Object methodParam) { try { return method.invoke(methodObj, methodParam); } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException e) { debug("Could not invoke method %s: %s", method.getName(), e.getMessage()); } return null; }
Source:
<code>private String resolveCommonJsModuleFromRegistry(String requireName) { for (Map.Entry<String, ImmutableSet<String>> nodeModulesFolder : nodeModulesRegistry.entrySet()) { if (!this.path.startsWith(nodeModulesFolder.getKey())) { continue; } <START> String fullModulePath = nodeModulesFolder.getKey() + "node_modules/" + requireName; <END> String loadAddress = resolveCommonJsModuleFile(fullModulePath); if (loadAddress != null) { return loadAddress; } loadAddress = resolveCommonJsModuleDirectory(fullModulePath); if (loadAddress != null) { return loadAddress; } } return null; }</code><technical_language>MODULE_SLASH here</technical_language>

Target:
private String resolveCommonJsModuleFromRegistry(String requireName) { for (Map.Entry<String, ImmutableSet<String>> nodeModulesFolder : nodeModulesRegistry.entrySet()) { if (!this.path.startsWith(nodeModulesFolder.getKey())) { continue; } String fullModulePath = nodeModulesFolder.getKey() + "node_modules" + MODULE_SLASH + requireName; String loadAddress = resolveCommonJsModuleFile(fullModulePath); if (loadAddress != null) { return loadAddress; } loadAddress = resolveCommonJsModuleDirectory(fullModulePath); if (loadAddress != null) { return loadAddress; } } return null; }
Source:
<code>static String writeJsonError(String error) throws IOException { StringWriter writer = new StringWriter(); JsonGenerator generator = JSON_FACTORY.createGenerator(writer); <START> generator.useDefaultPrettyPrinter(); <END> generator.writeStartObject(); generator.writeStringField("status", STATUS_DOWN); generator.writeObjectFieldStart("zipkin"); generator.writeStringField("status", STATUS_DOWN); generator.writeObjectFieldStart("details"); generator.writeStringField("error", error); generator.writeEndObject(); generator.writeEndObject(); generator.writeEndObject(); generator.flush(); return writer.toString(); }</code><technical_language>I calling this time is equivalent this factory .enable(SerializationFeature.INDENT_OUTPUT);</technical_language>

Target:
static String writeJsonError(String error) throws IOException { StringWriter writer = new StringWriter(); try (JsonGenerator generator = JSON_FACTORY.createGenerator(writer)) { generator.useDefaultPrettyPrinter(); generator.writeStartObject(); generator.writeStringField("status", STATUS_DOWN); generator.writeObjectFieldStart("zipkin"); generator.writeStringField("status", STATUS_DOWN); generator.writeObjectFieldStart("details"); generator.writeStringField("error", error); generator.writeEndObject(); generator.writeEndObject(); generator.writeEndObject(); } return writer.toString(); }
Source:
<code>private static void _chmod(File f, int mask) throws IOException { if (File.pathSeparatorChar==';') return; if (Util.NATIVE_CHMOD_MODE) { PosixAPI.jnr().chmod(f.getAbsolutePath(), mask); } else { <START> Files.setPosixFilePermissions(Util.fileToPath(f).toAbsolutePath(), Util.modeToPermissions(mask)); <END> } }</code><technical_language>call toAbsolutePath? unnecessary</technical_language>

Target:
private static void _chmod(File f, int mask) throws IOException { if (File.pathSeparatorChar==';') return; if (Util.NATIVE_CHMOD_MODE) { PosixAPI.jnr().chmod(f.getAbsolutePath(), mask); } else { Files.setPosixFilePermissions(Util.fileToPath(f), Util.modeToPermissions(mask)); } }
Source:
<code>private <T, U extends T> Supplier<T> createSupplier(SecurityContext securityContext, U event, EventMetadata metadata, ObserverExceptionHandler exceptionHandler, boolean handleExceptions, Runnable notifyAction) { return () -> { final ThreadLocalStackReference<EventMetadata> stack = currentEventMetadata.pushIfNotNull(metadata); final RequestContext requestContext = requestContextHolder.get(); final FastEvent<Object> requestInitializedEvent = requestInitializedEventHolder.get(); final FastEvent<Object> requestBeforeDestroyedEvent = requestBeforeDestroyedEventHolder.get(); final FastEvent<Object> requestDestroyedEvent = requestDestroyedEventHolder.get(); try { securityContext.associate(); <START> requestInitializedEvent.fire(toString()); <END> requestContext.activate(); notifyAction.run(); } finally { stack.pop(); requestBeforeDestroyedEvent.fire(toString()); requestContext.invalidate(); requestContext.deactivate(); requestDestroyedEvent.fire(toString()); securityContext.dissociate(); securityContext.close(); } if (handleExceptions) { handleExceptions(exceptionHandler); } return event; }; }</code><technical_language>I a dedicated ContextEvent instance a payload, similar org.jboss.weld.event.ContextEvent.REQUEST_INITIALIZED_EJB</technical_language>

Target:
private <T, U extends T> Supplier<T> createSupplier(SecurityContext securityContext, U event, EventMetadata metadata, ObserverExceptionHandler exceptionHandler, boolean handleExceptions, Runnable notifyAction) { return () -> { final ThreadLocalStackReference<EventMetadata> stack = currentEventMetadata.pushIfNotNull(metadata); final RequestContext requestContext = requestContextHolder.get(); try { securityContext.associate(); requestContext.activate(); notifyAction.run(); } finally { stack.pop(); requestContext.invalidate(); requestContext.deactivate(); securityContext.dissociate(); securityContext.close(); } if (handleExceptions) { handleExceptions(exceptionHandler); } return event; }; }
Source:
<code><START> public void setRequestCategories(Map<String, Long> requestCategories) { <END> this.requestCategories = requestCategories; }</code><technical_language>complaint in lgtm says: json { "ruleId": "com.lgtm/java-queries:java/unsynchronized-getter", "ruleIndex": 2, "message": { "text": "This get method is unsynchronized, [set method](1) is synchronized." }, "locations": [ { "physicalLocation": { "artifactLocation": { "uri": "opengrok-indexer/src/main/java/org/opengrok/indexer/web/Statistics.java", "uriBaseId": "%SRCROOT%", "index": 4 }, "region": { "startLine": 151, "startColumn": 30, "endLine": 151, "endColumn": 50, "charOffset": 5186, "charLength": 20 } } } ], this unintended side effects</technical_language>

Target:
public synchronized void setRequestCategories(Map<String, Long> requestCategories) { this.requestCategories = requestCategories; }
Source:
<code>private ConcurrentMap<String, WanReplicationPublisher> createPublishers(WanReplicationConfig wanConfig) { List<CustomWanPublisherConfig> customPublisherConfigs = wanConfig.getCustomPublisherConfigs(); int publisherCount = customPublisherConfigs.size(); if (publisherCount == 0) { return createConcurrentHashMap(1); } ConcurrentMap<String, WanReplicationPublisher> publishers = createConcurrentHashMap(publisherCount); Map<String, AbstractWanPublisherConfig> publisherConfigs = createHashMap(publisherCount); customPublisherConfigs.forEach( publisherConfig -> { String publisherId = getPublisherIdOrGroupName(publisherConfig); <START> if (publishers.containsKey(publisherId)) { <END> throw new InvalidConfigurationException( "Detected duplicate publisher ID '" + publisherId + "' for a single WAN replication config"); } WanReplicationPublisher publisher = createPublisher(publisherConfig); publishers.put(publisherId, publisher); publisherConfigs.put(publisherId, publisherConfig); }); for (Entry<String, WanReplicationPublisher> publisherEntry : publishers.entrySet()) { String publisherId = publisherEntry.getKey(); WanReplicationPublisher publisher = publisherEntry.getValue(); node.getSerializationService().getManagedContext().initialize(publisher); publisher.init(wanConfig, publisherConfigs.get(publisherId)); } return publishers; }</code><technical_language>null is a valid for publisherId. This lead NPE</technical_language>

Target:
private ConcurrentMap<String, WanReplicationPublisher> createPublishers(WanReplicationConfig wanConfig) { List<CustomWanPublisherConfig> customPublisherConfigs = wanConfig.getCustomPublisherConfigs(); int publisherCount = customPublisherConfigs.size(); if (publisherCount == 0) { return createConcurrentHashMap(1); } ConcurrentMap<String, WanReplicationPublisher> publishers = createConcurrentHashMap(publisherCount); Map<String, AbstractWanPublisherConfig> publisherConfigs = createHashMap(publisherCount); customPublisherConfigs.forEach( publisherConfig -> { String publisherId = getWanPublisherId(publisherConfig); if (publishers.containsKey(publisherId)) { throw new InvalidConfigurationException( "Detected duplicate publisher ID '" + publisherId + "' for a single WAN replication config"); } WanReplicationPublisher publisher = createPublisher(publisherConfig); publishers.put(publisherId, publisher); publisherConfigs.put(publisherId, publisherConfig); }); for (Entry<String, WanReplicationPublisher> publisherEntry : publishers.entrySet()) { String publisherId = publisherEntry.getKey(); WanReplicationPublisher publisher = publisherEntry.getValue(); node.getSerializationService().getManagedContext().initialize(publisher); publisher.init(wanConfig, publisherConfigs.get(publisherId)); } return publishers; }
Source:
<code><START> public void selectMetadataTab() { selectTab(METADATA_TAB); } <END></code><technical_language>Also, I part of this commit, "selectTab" named "clickTab" conventions <LINK_0></technical_language>

Target:
public void selectMetadataTab() { clickTab(METADATA_TAB); }
Source:
<code>public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { <START> classAnnotations.clear(); <END> coverage.setSignature(stringPool.get(signature)); coverage.setSuperName(stringPool.get(superName)); coverage.setInterfaces(stringPool.get(interfaces)); }</code><technical_language>AFAIR instances of ClassAnalyzer reused, this clear() useless</technical_language>

Target:
public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { coverage.setSignature(stringPool.get(signature)); coverage.setSuperName(stringPool.get(superName)); coverage.setInterfaces(stringPool.get(interfaces)); }