auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void recognizeEntitiesSingleText() { final RecognizeEntitiesResult recognizeEntitiesResult = textAnalyticsClient.recognizeEntities("Satya Nadella is the CEO of Microsoft"); for (NamedEntity entity : recognizeEntitiesResult.getNamedEntities()) { System.out.printf( "Recognized entity: %s, entity type: %s, entity subtype: %s, offset: %s, length: %s, score: %s.%n", entity.getText(), entity.getType(), <START> entity.getSubtype() == null || entity.getSubtype().isEmpty() ? "N/A" : entity.getSubtype(), <END> entity.getOffset(), entity.getLength(), entity.getScore()); } END: com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities#String }</code><technical_language>snippet shorter? other examples</technical_language>

Target:
public void recognizeEntitiesSingleText() { final RecognizeEntitiesResult recognizeEntitiesResult = textAnalyticsClient.recognizeEntities("Satya Nadella is the CEO of Microsoft"); for (NamedEntity entity : recognizeEntitiesResult.getNamedEntities()) { System.out.printf("Recognized entity: %s, entity type: %s, score: %s.%n", entity.getText(), entity.getType(), entity.getScore()); } END: com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities#String }
Source:
<code>private Map<SourceKey, Future<SourceAvailability>> startAvailabilityChecks( final Map<SourceKey, Source> sourceKeyMap) { Map<SourceKey, Future<SourceAvailability>> availabilityFutures = new HashMap<>(); for (final Entry<SourceKey, Source> entry : sourceKeyMap.entrySet()) { final Source source = entry.getValue(); final SourceKey sourceKey = entry.getKey(); boolean sourceIsNotInCache = cache.getIfPresent(sourceKey) == null; if (sourceIsNotInCache) { LOGGER.debug("Found a new SourceKey for source id={}", source.getId()); cache.put(sourceKey, SourceAvailability.unknown()); } <START> LOGGER.trace("Starting a process to check the availability of source id={}", source.getId()); <END> Future<SourceAvailability> sourceAvailabilityFuture = Futures.withTimeout( sourceAvailabilityChecksThreadPool.submit(() -> checkAvailability(source)), DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_TIME_UNIT, pollAllSourcesThreadPool); availabilityFutures.put(sourceKey, sourceAvailabilityFuture); } LOGGER.trace("Successfully submitted availability checks for all of the sources"); return availabilityFutures; }</code><technical_language>making debug logs troubleshooting source polling issues easier</technical_language>

Target:
private Map<SourceKey, Future<SourceStatus>> startAvailabilityChecks( final Map<SourceKey, Source> sourceKeyMap) { Map<SourceKey, Future<SourceStatus>> sourceStatusFutures = new HashMap<>(); for (final Entry<SourceKey, Source> entry : sourceKeyMap.entrySet()) { final Source source = entry.getValue(); final SourceKey sourceKey = entry.getKey(); LOGGER.trace("Starting a process to check the availability of source id={}", source.getId()); Future<SourceStatus> sourceStatusFuture = Futures.withTimeout( availabilityChecksThreadPool.submit( () -> source.isAvailable() ? SourceStatus.AVAILABLE : SourceStatus.UNAVAILABLE), DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_TIME_UNIT, pollAllSourcesThreadPool); sourceStatusFutures.put(sourceKey, sourceStatusFuture); } LOGGER.trace("Successfully submitted availability checks for all of the sources"); return sourceStatusFutures; }
Source:
<code><START> public void clientHandling( final PacketValueConfig message, final MessageContext ctx ) <END> { final Container c = Minecraft.getMinecraft().thePlayer.openContainer; if( message.name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).customName = message.value; } else if( message.name.startsWith( "SyncDat." ) ) { ( (AEBaseContainer) c ).stringSync( Integer.parseInt( message.name.substring( 8 ) ), message.value ); } else if( message.name.equals( "CraftingStatus" ) && message.value.equals( "Clear" ) ) { final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftingCPU ) { ( (GuiCraftingCPU) gs ).clearItems(); } } else if( c instanceof IConfigurableObject ) { final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); for( final Settings e : cm.getSettings() ) { if( e.name().equals( message.name ) ) { final Enum<?> def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), message.value ) ); } catch( final IllegalArgumentException err ) { } break; } } } }</code><technical_language>![MAJOR](<LINK_1> Remove unused method parameter(s) "ctx". [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public void clientHandling( final PacketValueConfig message, final MessageContext ctx ) { final Container c = Minecraft.getMinecraft().thePlayer.openContainer; if( message.name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).setCustomName( message.value ); } else if( message.name.startsWith( "SyncDat." ) ) { ( (AEBaseContainer) c ).stringSync( Integer.parseInt( message.name.substring( 8 ) ), message.value ); } else if( message.name.equals( "CraftingStatus" ) && message.value.equals( "Clear" ) ) { final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftingCPU ) { ( (GuiCraftingCPU) gs ).clearItems(); } } else if( c instanceof IConfigurableObject ) { final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); for( final Settings e : cm.getSettings() ) { if( e.name().equals( message.name ) ) { final Enum<?> def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), message.value ) ); } catch( final IllegalArgumentException err ) { } break; } } } }
Source:
<code>public HealthStatus getHealthStatus() { HealthStatus globalHealthStatus = HealthStatus.HEALTHY; <START> Set<HealthStatus> userCacheHealthStatus = getHealthStatus(cacheManager.getCacheNames()); <END> Set<HealthStatus> internalCacheHealthStatus = getHealthStatus(internalCacheRegistry.getInternalCacheNames()); if (userCacheHealthStatus.contains(HealthStatus.UNHEALTHY) || internalCacheHealthStatus.contains(HealthStatus.UNHEALTHY)) { globalHealthStatus = HealthStatus.UNHEALTHY; } else if (userCacheHealthStatus.contains(HealthStatus.REBALANCING) || internalCacheHealthStatus.contains(HealthStatus.REBALANCING)) { globalHealthStatus = HealthStatus.REBALANCING; } return globalHealthStatus; }</code><technical_language>I logic easier if created a map of Cache names / Health Status check if of caches is unhealthy rebalancing</technical_language>

Target:
public HealthStatus getHealthStatus() { HealthStatus globalHealthStatus = HealthStatus.HEALTHY; Set<HealthStatus> healthStatuses = Stream.concat(cacheManager.getCacheNames().stream(), internalCacheRegistry.getInternalCacheNames().stream()) .map(cacheName -> cacheManager.getCache(cacheName, false)) .filter(Objects::nonNull) .map(CacheHealthImpl::new) .map(CacheHealthImpl::getStatus) .collect(Collectors.toSet()); if (healthStatuses.contains(HealthStatus.UNHEALTHY)) { globalHealthStatus = HealthStatus.UNHEALTHY; } else if (healthStatuses.contains(HealthStatus.REBALANCING)) { globalHealthStatus = HealthStatus.REBALANCING; } return globalHealthStatus; }
Source:
<code>public void bindTo(MeterRegistry registry) { for (CircuitBreaker circuitBreaker : circuitBreakerRegistry.getAllCircuitBreakers()) { <START> addMetrics(registry, circuitBreaker, circuitBreakerRegistry); <END> } circuitBreakerRegistry.getEventPublisher() .onEntryAdded(event -> addMetrics(registry, event.getAddedEntry())); circuitBreakerRegistry.getEventPublisher() .onEntryRemoved(event -> removeMetrics(registry, event.getRemovedEntry().getName())); circuitBreakerRegistry.getEventPublisher().onEntryReplaced(event -> { removeMetrics(registry, event.getOldEntry().getName()); addMetrics(registry, event.getNewEntry()); }); }</code><technical_language>Is needed? If instance(CircuitBreaker) is registry, instance instance's tag registry's tags. I addMetrics(registry, circuitBreaker). do think</technical_language>

Target:
public void bindTo(MeterRegistry registry) { for (CircuitBreaker circuitBreaker : circuitBreakerRegistry.getAllCircuitBreakers()) { addMetrics(registry, circuitBreaker); } circuitBreakerRegistry.getEventPublisher() .onEntryAdded(event -> addMetrics(registry, event.getAddedEntry())); circuitBreakerRegistry.getEventPublisher() .onEntryRemoved(event -> removeMetrics(registry, event.getRemovedEntry().getName())); circuitBreakerRegistry.getEventPublisher().onEntryReplaced(event -> { removeMetrics(registry, event.getOldEntry().getName()); addMetrics(registry, event.getNewEntry()); }); }
Source:
<code>protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); <START> notifyNewLeaderOfTxnDone(); <END> boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { m_repairLog.deliver(message); return; } else if (message instanceof Iv2InitiateTaskMessage) { if (checkMisroutedIv2IntiateTaskMessage((Iv2InitiateTaskMessage)message)) { return; } initiateSPIMigrationIfRequested((Iv2InitiateTaskMessage)message); } else if (message instanceof FragmentTaskMessage) { if (checkMisroutedFragmentTaskMessage((FragmentTaskMessage)message)) { return; } } else if (message instanceof BalanceSPIMessage) { setBalanceSPIStatus((BalanceSPIMessage)message); return; } if (canDeliver) { m_scheduler.deliver(message); } else { m_repairLog.deliver(message); } }</code><technical_language>if Site thread is idle (not receiving message) BalanceSPI request is initiated? new leader get notified a new VoltMessage coming</technical_language>

Target:
protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { m_repairLog.deliver(message); return; } else if (message instanceof Iv2InitiateTaskMessage) { if (checkMisroutedIv2IntiateTaskMessage((Iv2InitiateTaskMessage)message)) { return; } initiateSPIMigrationIfRequested((Iv2InitiateTaskMessage)message); } else if (message instanceof FragmentTaskMessage) { if (checkMisroutedFragmentTaskMessage((FragmentTaskMessage)message)) { return; } } else if (message instanceof MigratePartitionLeaderMessage) { setMigratePartitionLeaderStatus((MigratePartitionLeaderMessage)message); return; } if (canDeliver) { m_scheduler.deliver(message); } else { m_repairLog.deliver(message); } }
Source:
<code><START> protected void executeCommand() { <END> Provider provider = getDbFacade().getProviderDao().get(getNetwork().getProvidedBy().getProviderId()); NetworkProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); getNetwork().getProvidedBy().setExternalId(proxy.add(getNetwork())); getNetwork().setVlanId(null); super.executeCommand(); }</code><technical_language>Please add can-do-actions for provider existence in addition AddNetworkCommand validations</technical_language>

Target:
protected void executeCommand() { Provider<?> provider = getDbFacade().getProviderDao().get(getNetwork().getProvidedBy().getProviderId()); NetworkProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); getNetwork().getProvidedBy().setExternalId(proxy.add(getNetwork())); getNetwork().setVlanId(null); super.executeCommand(); }
Source:
<code>protected static void validateOptions(JobConf job) throws IOException { <START> AccumuloClient conn = InputConfigurator.getConnector(CLASS, job); <END> InputConfigurator.validatePermissions(CLASS, job, conn); }</code><technical_language>This method renamed getAccumuloClient()</technical_language>

Target:
protected static void validateOptions(JobConf job) throws IOException { AccumuloClient conn = InputConfigurator.getClient(CLASS, job); InputConfigurator.validatePermissions(CLASS, job, conn); }
Source:
<code>public ServiceCall<Value> createValue(CreateValueOptions createValueOptions) { Validator.notNull(createValueOptions, "createValueOptions cannot be null"); RequestBuilder builder = RequestBuilder.post(String.format("/v1/workspaces/%s/entities/%s/values", createValueOptions.workspaceId(), createValueOptions.entity())); builder.query(VERSION, versionDate); final JsonObject contentJson = new JsonObject(); if (createValueOptions.metadata() != null) { contentJson.add("metadata", GsonSingleton.getGson().toJsonTree(createValueOptions.metadata())); } if (createValueOptions.synonyms() != null) { contentJson.add("synonyms", GsonSingleton.getGson().toJsonTree(createValueOptions.synonyms())); } <START> if (createValueOptions.patterns() != null) { <END> contentJson.add("patterns", GsonSingleton.getGson().toJsonTree(createValueOptions.patterns())); } contentJson.addProperty("value", createValueOptions.value()); builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Value.class)); }</code><technical_language>patterns support is finalized. want leave out</technical_language>

Target:
public ServiceCall<Value> createValue(CreateValueOptions createValueOptions) { Validator.notNull(createValueOptions, "createValueOptions cannot be null"); RequestBuilder builder = RequestBuilder.post(String.format("/v1/workspaces/%s/entities/%s/values", createValueOptions.workspaceId(), createValueOptions.entity())); builder.query(VERSION, versionDate); final JsonObject contentJson = new JsonObject(); if (createValueOptions.metadata() != null) { contentJson.add("metadata", GsonSingleton.getGson().toJsonTree(createValueOptions.metadata())); } if (createValueOptions.synonyms() != null) { contentJson.add("synonyms", GsonSingleton.getGson().toJsonTree(createValueOptions.synonyms())); } contentJson.addProperty("value", createValueOptions.value()); builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Value.class)); }
Source:
<code>public Op subtract(Op otherOp) { <START> return new DoubleOp(this.val - ((DoubleOp)otherOp).val); <END> }</code><technical_language>reason for instanceof check in add subtract</technical_language>

Target:
public Op subtract(Op otherOp) { if(!(otherOp instanceof DoubleOp)) { throw new RuntimeException(); } return new DoubleOp(this.val - ((DoubleOp)otherOp).val); }
Source:
<code>public void testOverrideMethodVersion() { Properties props = new Properties(); <START> props.setProperty(API_VERSION_PREFIX + "named:getVault", "namedversion"); <END> props.setProperty(API_VERSION_PREFIX + "VersionedApi.noName", "noNameversion"); ApiVersionFilter filter = new ApiVersionFilter(config, filterStringsBoundToInjectorByName(props)); HttpRequest request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost") .invocation(noName).addQueryParam("api-version", "original", "original2").build(); HttpRequest filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=noNameversion"); request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost").invocation(named) .addQueryParam("api-version", "original", "original2").build(); filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=namedversion"); }</code><technical_language>I get more approriate</technical_language>

Target:
public void testOverrideMethodVersion() { Properties props = new Properties(); props.setProperty(API_VERSION_PREFIX + "named:get", "namedversion"); props.setProperty(API_VERSION_PREFIX + "VersionedApi.noName", "noNameversion"); ApiVersionFilter filter = new ApiVersionFilter(config, filterStringsBoundToInjectorByName(props)); HttpRequest request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost") .invocation(noName).addQueryParam("api-version", "original", "original2").build(); HttpRequest filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=noNameversion"); request = GeneratedHttpRequest.builder().method("GET").endpoint("http://localhost").invocation(named) .addQueryParam("api-version", "original", "original2").build(); filtered = filter.filter(request); assertEquals(filtered.getEndpoint().getQuery(), "api-version=namedversion"); }
Source:
<code>protected OracleOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation) { OraclePluginTask oracleTask = (OraclePluginTask) task; if (oracleTask.getDriverPath().isPresent()) { loadDriverJar(oracleTask.getDriverPath().get()); } String url; if (oracleTask.getUrl().isPresent()) { <START> url = oracleTask.getUrl().get(); <END> } else { if (!oracleTask.getHost().isPresent()) { throw new IllegalArgumentException("Field 'host' is not set."); } if (!oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("Field 'database' is not set."); } url = String.format("jdbc:oracle:thin:@%s:%d:%s", oracleTask.getHost().get(), oracleTask.getPort(), oracleTask.getDatabase().get()); } Properties props = new Properties(); props.setProperty("user", oracleTask.getUser()); props.setProperty("password", oracleTask.getPassword()); props.putAll(oracleTask.getOptions()); return new OracleOutputConnector(url, props); }</code><technical_language>adding validation this?: if (oracleTask.getHost().isPresent() || oracleTask.getPort().isPresent() || oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("'host', 'port' 'database' parameters invalid if 'url' parameter is set."); }</technical_language>

Target:
protected OracleOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation) { OraclePluginTask oracleTask = (OraclePluginTask) task; if (oracleTask.getDriverPath().isPresent()) { loadDriverJar(oracleTask.getDriverPath().get()); } String url; if (oracleTask.getUrl().isPresent()) { if (oracleTask.getHost().isPresent() || oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("'host', 'port' and 'database' parameters are invalid if 'url' parameter is set."); } url = oracleTask.getUrl().get(); } else { if (!oracleTask.getHost().isPresent()) { throw new IllegalArgumentException("Field 'host' is not set."); } if (!oracleTask.getDatabase().isPresent()) { throw new IllegalArgumentException("Field 'database' is not set."); } url = String.format("jdbc:oracle:thin:@%s:%d:%s", oracleTask.getHost().get(), oracleTask.getPort(), oracleTask.getDatabase().get()); } Properties props = new Properties(); props.setProperty("user", oracleTask.getUser()); props.setProperty("password", oracleTask.getPassword()); props.putAll(oracleTask.getOptions()); return new OracleOutputConnector(url, props); }
Source:
<code>public void testBloomFilterVirtualColumnNumber() throws Exception { BloomKFilter filter = new BloomKFilter(1500); filter.addDouble(20.2); byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); <START> String base64 = Base64.encodeBase64String(bytes); <END> testQuery( StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE bloom_filter_test(2 * CAST(dim1 AS float), '%s')", base64), ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Filtration.eternity())) .granularity(Granularities.ALL) .virtualColumns() .filters( new ExpressionDimFilter( StringUtils.format("bloom_filter_test((2 * CAST(\"dim1\", 'DOUBLE')),'%s')", base64), createExprMacroTable() ) ) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{1L} ) ); }</code><technical_language>same, java.util.Base64.getEncoder().encodeToString(bytes) better</technical_language>

Target:
public void testBloomFilterVirtualColumnNumber() throws Exception { BloomKFilter filter = new BloomKFilter(1500); filter.addDouble(20.2); byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); String base64 = StringUtils.encodeBase64String(bytes); testQuery( StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE bloom_filter_test(2 * CAST(dim1 AS float), '%s')", base64), ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Filtration.eternity())) .granularity(Granularities.ALL) .virtualColumns() .filters( new ExpressionDimFilter( StringUtils.format("bloom_filter_test((2 * CAST(\"dim1\", 'DOUBLE')),'%s')", base64), createExprMacroTable() ) ) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{1L} ) ); }
Source:
<code>public void symbols_filtering() { <START> assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.FUNCTION)).extracting("name").containsOnly("f", "func"); <END> assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.PARAMETER)).extracting("name").containsOnly("p1", "p2"); assertThat(SYMBOL_MODEL.getSymbols("a")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("arguments")).hasSize(2); assertThat(SYMBOL_MODEL.getSymbols("this")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("Object")).hasSize(1); assertThat(SYMBOL_MODEL.getSymbols("window")).hasSize(1); assertThat(SYMBOL_MODEL.getSymbols("document")).hasSize(1); }</code><technical_language>@pynicolas "eval" disappeared</technical_language>

Target:
public void symbols_filtering() { assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.FUNCTION)).extracting("name").containsOnly("f", "func"); assertThat(SYMBOL_MODEL.getSymbols(Symbol.Kind.PARAMETER)).extracting("name").containsOnly("p1", "p2"); assertThat(SYMBOL_MODEL.getSymbols("a")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("arguments")).hasSize(2); assertThat(SYMBOL_MODEL.getSymbols("this")).hasSize(3); assertThat(SYMBOL_MODEL.getSymbols("Object")).hasSize(1); assertThat(SYMBOL_MODEL.getSymbols("window")).hasSize(1); }
Source:
<code>protected void initReferences(APMSpanBuilder builder, TraceReporter reporter) { Reference primaryRef = findPrimaryReference(builder.references); if (primaryRef != null) { if (primaryRef.getReferredTo() instanceof APMSpanBuilder) { initFromExtractedTraceState(builder, reporter, primaryRef); } else if (primaryRef.getReferredTo() instanceof APMSpan) { <START> if (primaryRef.getReferenceType() == References.CHILD_OF) { <END> initChildOf(builder, reporter, primaryRef); } else if (primaryRef.getReferenceType() == References.FOLLOWS_FROM) { initFollowsFrom(builder, reporter, primaryRef); } } } else { processNoPrimaryReference(builder, reporter); } }</code><technical_language>equals here</technical_language>

Target:
protected void initReferences(APMSpanBuilder builder, TraceReporter reporter) { Reference primaryRef = findPrimaryReference(builder.references); if (primaryRef != null) { if (primaryRef.getReferredTo() instanceof APMSpanBuilder) { initFromExtractedTraceState(builder, reporter, primaryRef); } else if (primaryRef.getReferredTo() instanceof APMSpan) { if (References.CHILD_OF.equals(primaryRef.getReferenceType())) { initChildOf(builder, reporter, primaryRef); } else if (References.FOLLOWS_FROM.equals(primaryRef.getReferenceType())) { initFollowsFrom(builder, reporter, primaryRef); } } } else { processNoPrimaryReference(builder, reporter); } }
Source:
<code><START> private static String authorityToMobile(@NonNull String authority) { <END> String langCode = authorityToLanguageCode(authority); String subdomain = languageCodeToSubdomain(langCode); return authority.replaceFirst("^" + subdomain + "\\.?", "$0m."); }</code><technical_language>URL language code is a lossy operation. e.g., consider behavior for zh wiki. instance's languageCode</technical_language>

Target:
private String authorityToMobile(@NonNull String authority) { String subdomain = languageCodeToSubdomain(languageCode); return authority.replaceFirst("^" + subdomain + "\\.?", "$0m."); }
Source:
<code>public RTTestsParser() { super(Messages._Warnings_RTTests_ParserName(), Messages._Warnings_RTTests_LinkName(), Messages._Warnings_RTTests_TrendName(), <START> CYCLICTEST_WARNING_PATTERN, true); <END> }</code><technical_language>If parameter is true need overwrite isLineInteresting</technical_language>

Target:
public RTTestsParser() { super(Messages._Warnings_RTTests_ParserName(), Messages._Warnings_RTTests_LinkName(), Messages._Warnings_RTTests_TrendName(), CYCLICTEST_WARNING_PATTERN); }
Source:
<code>public Response authoriseCharge(@PathParam("chargeId") String chargeId, AuthCardDetails authCardDetails) { if (!isWellFormatted(authCardDetails)) { return badRequestResponse("Values do not match expected format/length."); } AuthorisationResponse response = cardAuthoriseService.doAuthorise(chargeId, authCardDetails); <START> return response.getGatewayError().map(this::handleError) <END> .orElseGet(() -> response.getAuthoriseStatus().map(authoriseStatus -> { if (authoriseStatus.equals(AuthoriseStatus.SUBMITTED)) { return badRequestResponse("This transaction was deferred."); } if (isAuthorisationDeclined(authoriseStatus)) { return badRequestResponse("This transaction was declined."); } return ResponseUtil.successResponseWithEntity(ImmutableMap.of("status", authoriseStatus.getMappedChargeStatus().toString())); }).orElseGet(() -> ResponseUtil.serviceErrorResponse("InterpretedStatus not found for Gateway response"))); }</code><technical_language>I find mini methods breakdown a bit easier read..</technical_language>

Target:
public Response authoriseCharge(@PathParam("chargeId") String chargeId, AuthCardDetails authCardDetails) { if (!isWellFormatted(authCardDetails)) { return badRequestResponse("Values do not match expected format/length."); } AuthorisationResponse response = cardAuthoriseService.doAuthorise(chargeId, authCardDetails); return response.getGatewayError().map(this::handleError) .orElseGet(() -> response.getAuthoriseStatus().map(this::handleAuthResponse) .orElseGet(() -> ResponseUtil.serviceErrorResponse("InterpretedStatus not found for Gateway response"))); }
Source:
<code>protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException { super.deserializeStateData(serializer); ReopenTableRegionsStateData data = serializer.deserialize(ReopenTableRegionsStateData.class); tableName = ProtobufUtil.toTableName(data.getTableName()); regions = data.getRegionList().stream().map(ProtobufUtil::toRegionLocation) .collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(data.getRegionNamesList())) { regionNames = new ArrayList<>(); <START> data.getRegionNamesList().forEach(regionName -> regionNames.add(regionName.toByteArray())); <END> } else { regionNames = null; } }</code><technical_language>stream collect</technical_language>

Target:
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException { super.deserializeStateData(serializer); ReopenTableRegionsStateData data = serializer.deserialize(ReopenTableRegionsStateData.class); tableName = ProtobufUtil.toTableName(data.getTableName()); regions = data.getRegionList().stream().map(ProtobufUtil::toRegionLocation) .collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(data.getRegionNamesList())) { regionNames = data.getRegionNamesList().stream().map(ByteString::toByteArray) .collect(Collectors.toList()); } else { regionNames = Collections.emptyList(); } }
Source:
<code>public TextSelectedShareAdapter(PageActivity parentActivity) { super(parentActivity); app = (WikipediaApp) getActivity().getApplicationContext(); <START> clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE); <END> clipChangedListener = new ClipboardManager.OnPrimaryClipChangedListener() { @Override public void onPrimaryClipChanged() { if (expectClipChange && clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) { expectClipChange = false; CharSequence selectedText = clipboard.getPrimaryClip().getItemAt(0) .coerceToText(getActivity()); Log.d("Share", ">>> Clipboard text: " + selectedText); shareSnippet(selectedText, false); } } }; clipboard.addPrimaryClipChangedListener(clipChangedListener); }</code><technical_language>parentActivity for previous statements</technical_language>

Target:
public TextSelectedShareAdapter(PageActivity parentActivity) { super(parentActivity); app = (WikipediaApp) parentActivity.getApplicationContext(); clipboard = (ClipboardManager) parentActivity.getSystemService(Context.CLIPBOARD_SERVICE); clipChangedListener = new ClipboardManager.OnPrimaryClipChangedListener() { @Override public void onPrimaryClipChanged() { if (expectClipChange && clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) { expectClipChange = false; CharSequence selectedText = clipboard.getPrimaryClip().getItemAt(0) .coerceToText(getActivity()); Log.d("Share", ">>> Clipboard text: " + selectedText); shareSnippet(selectedText, false); } } }; clipboard.addPrimaryClipChangedListener(clipChangedListener); }
Source:
<code>public void tearDown(ManagementClient managementClient, String serverId) throws Exception { setTimeout(managementClient, 300); <START> executeReload(managementClient); <END> awaitReload(managementClient); }</code><technical_language>This method awaitReload() removed in favor of org.jboss.as.test.shared.ServerReload.executeReloadAndWaitForCompletion()</technical_language>

Target:
public void tearDown(ManagementClient managementClient, String serverId) throws Exception { final int timeout = originalTimeout == -1 ? 300 : originalTimeout; setTimeout(managementClient, timeout); ServerReload.executeReloadAndWaitForCompletion(managementClient.getControllerClient()); }
Source:
<code>private static int getVersion(String keyName) { <START> String[] keyNameArray = keyName.split("\\."); if (keyNameArray[keyNameArray.length - 1].startsWith("v")) { try { return Integer.parseInt(keyNameArray[keyNameArray.length - 1].substring(1)); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Parse version of encryption key error, key: " + keyName); } } <END> return 0; }</code><technical_language>I efficient call "split" here, care is segment. instead call keyName.lastIndexOf('.') call substring index</technical_language>

Target:
private static int getVersion(String keyName) { int idx = keyName.lastIndexOf('.'); try { return Integer.parseInt(keyName.substring(idx + 2)); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Parse version of encryption key error, key: " + keyName); } return 0; }
Source:
<code>public void testTwoInitThrows() throws Exception { assertThrows(IllegalStateException.class, () -> { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); <START> mapEntryStructField.init(); <END> }); }</code><technical_language>this line in assertThrows</technical_language>

Target:
public void testTwoInitThrows() throws Exception { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); assertThrows(IllegalStateException.class, () -> { mapEntryStructField.init(); }); }
Source:
<code>public int getHeadingRecordIndex(List<CSVRecord> allCsvRecords) { int headingIndex = -1; if (allCsvRecords != null) { Optional<CSVRecord> headingRecord = allCsvRecords.stream().filter(currRecord -> hasHeading(currRecord)) <START> .findFirst(); <END> if (headingRecord.isPresent() && headingRecord.get() != null) { headingIndex = (int) headingRecord.get().getRecordNumber() - 1; } else { LOGGER.warn("No heading row was found."); } } return headingIndex; }</code><technical_language>this need a findFirst a findAny? a minor performance difference</technical_language>

Target:
public int getHeadingRecordIndex(List<CSVRecord> allCsvRecords) { int headingIndex = -1; if (allCsvRecords != null) { Optional<CSVRecord> headingRecord = allCsvRecords.stream().filter(currRecord -> hasHeading(currRecord)) .findAny(); if (headingRecord.isPresent() && headingRecord.get() != null) { headingIndex = (int) headingRecord.get().getRecordNumber() - 1; } else { LOGGER.warn("No heading row was found."); } } return headingIndex; }
Source:
<code>private static KubernetesClientConfig createFromSystemConfig(final Optional<String> name, final io.digdag.client.config.Config systemConfig) { final String clusterName; if (!name.isPresent()) { if (!systemConfig.get("agent.command_executor.type", String.class, "").equals("kubernetes")) { throw new ConfigException("agent.command_executor.type: is not 'kubernetes'"); } clusterName = systemConfig.get(KUBERNETES_CLIENT_PARAMS_PREFIX + "name", String.class); } else { clusterName = name.get(); } final String keyPrefix = KUBERNETES_CLIENT_PARAMS_PREFIX + clusterName + "."; final Config extracted = validateParams(StorageManager.extractKeyPrefix(systemConfig, keyPrefix)); if (extracted.get("use_kube_config", boolean.class, false)){ io.fabric8.kubernetes.client.Config kubeConfig; kubeConfig = getKubeConfigFromPath(extracted.get("kube_config_path", String.class)); return create(clusterName, kubeConfig.getMasterUrl(), kubeConfig.getCaCertData(), kubeConfig.getOauthToken(), kubeConfig.getNamespace() ); <START> }else{ <END> return create(clusterName, extracted.get("master", String.class), extracted.get("certs_ca_data", String.class), extracted.get("oauth_token", String.class), extracted.get("namespace", String.class)); } }</code><technical_language>nitpick: } else {</technical_language>

Target:
static KubernetesClientConfig createFromSystemConfig(final Optional<String> name, final io.digdag.client.config.Config systemConfig) { final String clusterName; if (!name.isPresent()) { if (!systemConfig.get("agent.command_executor.type", String.class, "").equals("kubernetes")) { throw new ConfigException("agent.command_executor.type: is not 'kubernetes'"); } clusterName = systemConfig.get(KUBERNETES_CLIENT_PARAMS_PREFIX + "name", String.class); } else { clusterName = name.get(); } final String keyPrefix = KUBERNETES_CLIENT_PARAMS_PREFIX + clusterName + "."; final Config extracted = StorageManager.extractKeyPrefix(systemConfig, keyPrefix); if (extracted.has("kube_config_path")) { String kubeConfigPath = extracted.get("kube_config_path", String.class); io.fabric8.kubernetes.client.Config validatedKubeConfig; validatedKubeConfig = validateKubeConfig(getKubeConfigFromPath(kubeConfigPath)); return create(clusterName, validatedKubeConfig.getMasterUrl(), validatedKubeConfig.getCaCertData(), validatedKubeConfig.getOauthToken(), validatedKubeConfig.getNamespace()); } else { final Config validatedConfig = validateConfig(extracted); return create(clusterName, validatedConfig.get("master", String.class), validatedConfig.get("certs_ca_data", String.class), validatedConfig.get("oauth_token", String.class), validatedConfig.get("namespace", String.class)); } }
Source:
<code>public void setUp() throws Exception { <START> <END> removeDir(new File(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath())); removeDir(new File(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath())); logger.debug("Generate releases..."); TestCaseWithArtifactGeneration generator = new TestCaseWithArtifactGeneration(); TestCaseWithArtifactGeneration.generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.metadata:strongbox-metadata", new String[]{ "3.0.1", "3.0.2", "3.1", "3.2" }); generator.createTimestampedSnapshotArtifact(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(), "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.1", "jar", null, 3); generator.createTimestampedSnapshotArtifact(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(), "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.2", "jar", null, 4); generator.createTimestampedSnapshotArtifact(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(), "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.1", "jar", null, 5); }</code><technical_language>remove this blank line</technical_language>

Target:
public static void setUp() throws Exception { removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/org/carlspring/strongbox/metadata/strongbox-metadata"); removeDir(REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath() + "/org/carlspring/strongbox/metadata/strongbox-metadata"); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.metadata:strongbox-metadata", "3.0.1", "3.0.2", "3.1", "3.2"); TestCaseWithArtifactGeneration generator = new TestCaseWithArtifactGeneration(); String snapshotPath = REPOSITORY_BASEDIR_SNAPSHOTS.getAbsolutePath(); generator.createTimestampedSnapshotArtifact(snapshotPath, "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.1", "jar", null, 3); generator.createTimestampedSnapshotArtifact(snapshotPath, "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.0.2", "jar", null, 4); generator.createTimestampedSnapshotArtifact(snapshotPath, "org.carlspring.strongbox.metadata", "strongbox-metadata", "3.1", "jar", null, 5); }
Source:
<code>protected SamHeaderAndIterator openInputs() { final List<SAMFileHeader> headers = new ArrayList<>(INPUT.size()); final List<SamReader> readers = new ArrayList<>(INPUT.size()); for (final String input : INPUT) { SamReader reader = SamReaderFactory.makeDefault() .enable(SamReaderFactory.Option.EAGERLY_DECODE) .open(SamInputResource.of(input)); final SAMFileHeader header = reader.getFileHeader(); headers.add(header); readers.add(reader); } <START> if(ASSUME_ORDER != null) { <END> headers.get(0).setSortOrder(ASSUME_ORDER); } if (headers.size() == 1) { return new SamHeaderAndIterator(headers.get(0), readers.get(0).iterator()); } else { final SamFileHeaderMerger headerMerger = new SamFileHeaderMerger(headers.get(0).getSortOrder(), headers, false); final MergingSamRecordIterator iterator = new MergingSamRecordIterator(headerMerger, readers, ASSUME_ORDER != null); return new SamHeaderAndIterator(headerMerger.getMergedHeader(), iterator); } }</code><technical_language>space if</technical_language>

Target:
protected SamHeaderAndIterator openInputs() { final List<SAMFileHeader> headers = new ArrayList<>(INPUT.size()); final List<SamReader> readers = new ArrayList<>(INPUT.size()); for (final String input : INPUT) { SamReader reader = SamReaderFactory.makeDefault() .enable(SamReaderFactory.Option.EAGERLY_DECODE) .open(SamInputResource.of(input)); final SAMFileHeader header = reader.getFileHeader(); headers.add(header); readers.add(reader); } if (ASSUME_SORT_ORDER != null || ASSUME_SORTED) { if (ASSUME_SORT_ORDER == null) { ASSUME_SORT_ORDER = SAMFileHeader.SortOrder.coordinate; ASSUME_SORTED = false; } headers.get(0).setSortOrder(ASSUME_SORT_ORDER); } if (headers.size() == 1) { return new SamHeaderAndIterator(headers.get(0), readers.get(0).iterator()); } else { final SamFileHeaderMerger headerMerger = new SamFileHeaderMerger(headers.get(0).getSortOrder(), headers, false); final MergingSamRecordIterator iterator = new MergingSamRecordIterator(headerMerger, readers, ASSUME_SORT_ORDER != null); return new SamHeaderAndIterator(headerMerger.getMergedHeader(), iterator); } }
Source:
<code>void processPullReply(final K key, final V value) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { future.setValue(value); } else { LOG.log(Level.WARNING, "Pending pull was not found for key {0}." + <START> " It may be fulfilled by another earlier response from the server", key); <END> } }</code><technical_language>sound: _Response for key arrived earlier another server_</technical_language>

Target:
void processPullReply(final K key, final V value) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { future.setValue(value); } else { LOG.log(Level.WARNING, "Pending pull was not found for key {0}." + " Response for the key may have arrived earlier from another server", key); } }
Source:
<code>public boolean performPaste(Object target, ISelection selection) { if (target instanceof IBreakpointContainer && selection instanceof IStructuredSelection) { IBreakpointContainer container = (IBreakpointContainer) target; for (Object object : <START> ((IStructuredSelection)selection)) <END> { IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(object, IBreakpoint.class); if (breakpoint != null) { container.getOrganizer().addBreakpoint(breakpoint, container.getCategory()); } } return true; } return false; }</code><technical_language>double parantheses obsolete</technical_language>

Target:
public boolean performPaste(Object target, ISelection selection) { if (target instanceof IBreakpointContainer && selection instanceof IStructuredSelection) { IBreakpointContainer container = (IBreakpointContainer) target; for (Object object : (IStructuredSelection) selection) { IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(object, IBreakpoint.class); if (breakpoint != null) { container.getOrganizer().addBreakpoint(breakpoint, container.getCategory()); } } return true; } return false; }
Source:
<code>public PlaybackControlLayer(String videoTitle, FullscreenCallback fullscreenCallback) { this.videoTitle = videoTitle; this.canSeek = true; this.fullscreenCallback = fullscreenCallback; this.shouldBePlaying = false; <START> this.savedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; <END> actionButtons = new ArrayList<ImageButton>(); }</code><technical_language>this assume app starts phone in portrait mode? grab current orientation instead of assuming portrait</technical_language>

Target:
public PlaybackControlLayer(String videoTitle, FullscreenCallback fullscreenCallback) { this.videoTitle = videoTitle; this.canSeek = true; this.fullscreenCallback = fullscreenCallback; this.shouldBePlaying = false; actionButtons = new ArrayList<ImageButton>(); }
Source:
<code>private void shareMedia() { MediaModel media = mMediaStore.getMediaWithLocalId(mMediaId); if (media == null) { ToastUtils.showToast(this, R.string.error_media_not_found); return; } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, media.getUrl()); if (!TextUtils.isEmpty(media.getTitle())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getTitle()); } else if (!TextUtils.isEmpty(media.getDescription())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getDescription()); } try { <START> startActivity(Intent.createChooser(intent, getString(R.string.reader_share_link))); <END> } catch (android.content.ActivityNotFoundException ex) { ToastUtils.showToast(this, R.string.reader_toast_err_share_intent); } }</code><technical_language>R.string.share_link instead of specific R.string.reader_share_link. yet, if localized version special for reader sharing, remove reader_share_link resource together. do think</technical_language>

Target:
private void shareMedia() { MediaModel media = mMediaStore.getMediaWithLocalId(mMediaId); if (media == null) { ToastUtils.showToast(this, R.string.error_media_not_found); return; } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, media.getUrl()); if (!TextUtils.isEmpty(media.getTitle())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getTitle()); } else if (!TextUtils.isEmpty(media.getDescription())) { intent.putExtra(Intent.EXTRA_SUBJECT, media.getDescription()); } try { startActivity(Intent.createChooser(intent, getString(R.string.share_link))); } catch (android.content.ActivityNotFoundException ex) { ToastUtils.showToast(this, R.string.reader_toast_err_share_intent); } }
Source:
<code><START> public KeyValueEncryptedFileStore(File parentDir, String storeName, String encryptionKey) { <END> storeDir = new File(parentDir, storeName); if (!storeDir.exists()) { storeDir.mkdirs(); } this.encryptionKey = encryptionKey; }</code><technical_language>Yeah, public, user suffix appended properly parent directory else</technical_language>

Target:
KeyValueEncryptedFileStore(File parentDir, String storeName, String encryptionKey) { if (!isValidStoreName(storeName)) { throw new IllegalArgumentException("Invalid store name: " + storeName); } storeDir = new File(parentDir, storeName); if (!storeDir.exists()) { storeDir.mkdirs(); } if (!storeDir.isDirectory()) { throw new IllegalArgumentException("Failed to create directory for: " + storeName); } this.encryptionKey = encryptionKey; }
Source:
<code><START> public void unlock(String requestId, String name, long start) { <END> LOG.trace("{} - Unlocking ({})", name, requestId, JavaUtils.duration(start)); ReentrantLock lock = requestLocks.computeIfAbsent(requestId, (r) -> new ReentrantLock()); lock.unlock(); }</code><technical_language>safe lock() unlock() private now, allow rest of scheduler interact runWithRequestLock()</technical_language>

Target:
private void unlock(String requestId, String name, long start) { LOG.trace("{} - Unlocking ({})", name, requestId, JavaUtils.duration(start)); ReentrantLock lock = requestLocks.computeIfAbsent(requestId, (r) -> new ReentrantLock()); lock.unlock(); }
Source:
<code>public void testCnxManagerListenerThreadConfigurableRetry() throws Exception { final Map<Long,QuorumServer> unresolvablePeers = new HashMap<>(); final long myid = 1L; unresolvablePeers.put(myid, new QuorumServer(myid, "unresolvable-domain.org:2182:2183;2181")); final QuorumPeer peer = new QuorumPeer(unresolvablePeers, ClientBase.createTmpDir(), ClientBase.createTmpDir(), <START> 2181, 3, myid, 1000, 2, 2); <END> final QuorumCnxManager cnxManager = peer.createCnxnManager(); QuorumCnxManager.Listener listener = cnxManager.listener; listener.start(); listener.join(15000); Assert.assertFalse(listener.isAlive()); Assert.assertFalse(peer.isRunning()); peer.join(15000); Assert.assertFalse(QuorumPeer.class.getSimpleName() + " not stopped after " + "listener thread death", listener.isAlive()); }</code><technical_language>is constructor this master. need add a ServerCnxnFactory</technical_language>

Target:
public void testCnxManagerListenerThreadConfigurableRetry() throws Exception { final Map<Long,QuorumServer> unresolvablePeers = new HashMap<>(); final long myid = 1L; unresolvablePeers.put(myid, new QuorumServer(myid, "unresolvable-domain.org:2182:2183;2181")); final QuorumPeer peer = new QuorumPeer(unresolvablePeers, ClientBase.createTmpDir(), ClientBase.createTmpDir(), 2181, 3, myid, 1000, 2, 2, 2); final QuorumCnxManager cnxManager = peer.createCnxnManager(); QuorumCnxManager.Listener listener = cnxManager.listener; listener.start(); listener.join(15000); Assert.assertFalse(listener.isAlive()); Assert.assertFalse(peer.isRunning()); peer.join(15000); Assert.assertFalse(QuorumPeer.class.getSimpleName() + " not stopped after " + "listener thread death", listener.isAlive()); }
Source:
<code>default boolean isDCStable(DeploymentConfig dc) { <START> return "True".equals(dc.getStatus().getConditions().get(0).getStatus()) <END> && dc.getStatus().getUnavailableReplicas() == 0; }</code><technical_language>reason mixed case case sensitive equals here</technical_language>

Target:
default boolean isDCStable(DeploymentConfig dc) { return "True".equalsIgnoreCase(dc.getStatus().getConditions().get(0).getStatus()) && dc.getStatus().getUnavailableReplicas() == 0; }
Source:
<code>private boolean isTable(RelNode relNode) { <START> if (relNode instanceof EnumerableTableScan || relNode instanceof LogicalProject) { <END> SqlIOConfig sourceTableConfig = resolveSourceConfigForTable(relNode); return sourceTableConfig != null && sourceTableConfig.getTableDescriptor().isPresent(); } else { return false; } }</code><technical_language>If relNode is a enumerableTableScan, this result in infinite loop</technical_language>

Target:
private boolean isTable(RelNode relNode) { if (relNode instanceof EnumerableTableScan) { return resolveSourceConfig(relNode).getTableDescriptor().isPresent(); } else { return false; } }