auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isStreamable() { if (!preGroupedSymbols.isEmpty() && groupingSets.size() == 1) { List<Symbol> groupingSet = Iterables.getOnlyElement(groupingSets); return !groupingSet.isEmpty() && Sets.newHashSet(preGroupedSymbols).equals(Sets.newHashSet(groupingSet)); } return false; }

Target:
public boolean isStreamable() { return !preGroupedSymbols.isEmpty() && groupingSets.size() == 1 && !Iterables.getOnlyElement(groupingSets).isEmpty(); }
Source:
public Boolean not(Boolean operand) { return operand; }

Target:
public Boolean not(Boolean operand) { return tags == null ? operand : false; }
Source:
public EC2AbstractSlave(String name, String instanceId, String description, String remoteFS, int numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses) throws FormException, IOException { super(name, remoteFS, launcher); setNumExecutors(numExecutors); setMode(mode); setLabelString(labelString); setRetentionStrategy(retentionStrategy); setNodeProperties(nodeProperties); this.instanceId = instanceId; this.templateDescription = description; this.initScript = initScript; this.tmpDir = tmpDir; this.remoteAdmin = remoteAdmin; this.jvmopts = jvmopts; this.stopOnTerminate = stopOnTerminate; this.idleTerminationMinutes = idleTerminationMinutes; this.tags = tags; this.usePrivateDnsName = connectionStrategy != null && connectionStrategy.equals(ConnectionStrategy.PRIVATE_DNS); this.useDedicatedTenancy = useDedicatedTenancy; this.cloudName = cloudName; this.launchTimeout = launchTimeout; this.amiType = amiType; this.maxTotalUses = maxTotalUses; readResolve(); fetchLiveInstanceData(true); }

Target:
public EC2AbstractSlave(String name, String instanceId, String description, String remoteFS, int numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses) throws FormException, IOException { super(name, remoteFS, launcher); setNumExecutors(numExecutors); setMode(mode); setLabelString(labelString); setRetentionStrategy(retentionStrategy); setNodeProperties(nodeProperties); this.instanceId = instanceId; this.templateDescription = description; this.initScript = initScript; this.tmpDir = tmpDir; this.remoteAdmin = remoteAdmin; this.jvmopts = jvmopts; this.stopOnTerminate = stopOnTerminate; this.idleTerminationMinutes = idleTerminationMinutes; this.tags = tags; this.usePrivateDnsName = connectionStrategy == ConnectionStrategy.PRIVATE_DNS; this.useDedicatedTenancy = useDedicatedTenancy; this.cloudName = cloudName; this.launchTimeout = launchTimeout; this.amiType = amiType; this.maxTotalUses = maxTotalUses; readResolve(); fetchLiveInstanceData(true); }
Source:
private <T> T inReadOnlyTransaction(final TransactionCallback<T> callback) { return connector.getDBI().withHandle( new HandleCallback<T>() { @Override public T withHandle(Handle handle) throws Exception { final Connection connection = handle.getConnection(); final boolean readOnly = connection.isReadOnly(); connection.setReadOnly(true); T res = handle.inTransaction(callback); connection.setReadOnly(readOnly); return res; } } ); }

Target:
private <T> T inReadOnlyTransaction(final TransactionCallback<T> callback) { return connector.getDBI().withHandle( new HandleCallback<T>() { @Override public T withHandle(Handle handle) throws Exception { final Connection connection = handle.getConnection(); final boolean readOnly = connection.isReadOnly(); connection.setReadOnly(true); try { return handle.inTransaction(callback); } finally { try { connection.setReadOnly(readOnly); } catch (SQLException e) { log.error(e, "Unable to reset connection read-only state"); } } } } ); }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitConstDeclaration(@NotNull GoConstDeclaration o) { visitDeclaration(o); } @Override public void visitShortVarDeclaration(@NotNull GoShortVarDeclaration o) { visitDeclaration(o); } @Override public void visitTypeDeclaration(@NotNull GoTypeDeclaration o) { visitDeclaration(o); } @Override public void visitImportDeclaration(@NotNull GoImportDeclaration o) { visitDeclaration(o); } private void visitDeclaration (PsiElement o) { if (o.getChildren().length == 0 && GoDocumentationProvider.getCommentsForElement(o).isEmpty() && PsiTreeUtil.findChildrenOfType(o, PsiComment.class).isEmpty()) { holder.registerProblem(o, "Empty declaration <code>#ref</code> #loc", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new GoDeleteQuickFix(QUICK_FIX_NAME, o.getClass())); } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitConstDeclaration(@NotNull GoConstDeclaration o) { visitDeclaration(o); } @Override public void visitVarDeclaration(@NotNull GoVarDeclaration o) { visitDeclaration(o); } @Override public void visitTypeDeclaration(@NotNull GoTypeDeclaration o) { visitDeclaration(o); } @Override public void visitImportDeclaration(@NotNull GoImportDeclaration o) { visitDeclaration(o); } private void visitDeclaration (PsiElement o) { if (o.getChildren().length == 0 && GoDocumentationProvider.getCommentsForElement(o instanceof GoImportDeclaration && o.getPrevSibling() == null ? o.getParent() : o).isEmpty() && PsiTreeUtil.findChildrenOfType(o, PsiComment.class).isEmpty()) { holder.registerProblem(o, "Empty declaration <code>#ref</code> #loc", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new GoDeleteQuickFix(QUICK_FIX_NAME, o.getClass())); } } }; }
Source:
private HttpConnection postAndAssertNothingReadBeforeSettingBodyGenerator(CouchConfig config) throws Exception { HttpConnection conn = new HttpConnection("POST", config.getRootUri().toURL(), "application/json"); Assert.assertEquals(bis.available(), data.getBytes().length); conn.setRequestBody(new HttpConnection.InputStreamGenerator() { @Override public InputStream getInputStream() { return bis; } }); Field interceptors = CouchClient.class.getDeclaredField("DEFAULT_REQUEST_INTERCEPTORS"); interceptors.setAccessible(true); conn.requestInterceptors.addAll((Collection<? extends HttpConnectionRequestInterceptor>) interceptors.get(null)); return conn; }

Target:
private HttpConnection postAndAssertNothingReadBeforeSettingBodyGenerator(CouchConfig config) throws Exception { HttpConnection conn = new HttpConnection("POST", config.getRootUri().toURL(), "application/json"); Assert.assertEquals(bis.available(), data.getBytes().length); conn.setRequestBody(new HttpConnection.InputStreamGenerator() { @Override public InputStream getInputStream() { return bis; } }); conn.requestInterceptors.addAll(CouchClient.DEFAULT_REQUEST_INTERCEPTORS); return conn; }
Source:
public CharSequence subSequence(int start, int end) { if ((start < 0) || (start > end) || (end > this.length())) { throw new IndexOutOfBoundsException(); } if (start == end) return ""; List<CharSequence> result = new ArrayList<>(this.sequences.size()); int relativeStart = start; int relativeEnd = end; for (CharSequence sequence : this.sequences) { if ((relativeStart < sequence.length()) && (relativeEnd > 0)) { result.add(sequence.subSequence(Math.max(relativeStart, 0), Math.min(relativeEnd, sequence.length()))); } relativeStart -= sequence.length(); relativeEnd -= sequence.length(); } return (result.size() == 1) ? result.get(0) : new CompositeCharSequence(result); }

Target:
public CharSequence subSequence(int start, int end) { if ((start < 0) || (start > end) || (end > this.length())) { throw new IndexOutOfBoundsException(); } if (start == end) return ""; List<CharSequence> result = null; int relativeStart = start; int relativeEnd = end; for (CharSequence sequence : this.sequences) { if ((relativeStart < sequence.length()) && (relativeEnd > 0)) { CharSequence subSequence = sequence.subSequence(Math.max(relativeStart, 0), Math.min(relativeEnd, sequence.length())); if (result == null) { if ((relativeStart >= 0) && (relativeEnd <= sequence.length())) { return subSequence; } result = new LinkedList<>(); } result.add(subSequence); } relativeStart -= sequence.length(); relativeEnd -= sequence.length(); } return new CompositeCharSequence(result); }
Source:
public boolean accept(Key k, Value v) { if(v.getSize() > 0) { curMeta = metadataSerDe.deserialize(v.get()); int keep = 0; if(curMeta.size() == 0) return true; for (Map<String,Object> entry : curMeta) { long expiration = getExpiration(entry, -1); long timestamp = getTimestamp(entry, 0); if (!shouldExpire(expiration, timestamp)) keep++; } return keep > 0; } return true; }

Target:
public boolean accept(Key k, Value v) { if(v.getSize() > 0) { curMeta = metadataSerDe.deserialize(v.get()); curKey = k; if(curMeta.size() == 0) return true; for (Map<String,Object> entry : curMeta) { long expiration = getExpiration(entry, -1); long timestamp = parseTimestamp(k, entry); if (!shouldExpire(expiration, timestamp)) return true; } return false; } return true; }
Source:
public void addSettingsCodeSnippet() { ConfigurationAsyncClient client = getAsyncClient(); client.addSetting("prodDBConnection", "db_connection") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { ConfigurationSetting result = response; System.out.printf("Key: %s, Value: %s", result.key(), result.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSetting#string-string client.addSettingWithResponse("prodDBConnection", "db_connection") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { ConfigurationSetting responseResult = response.value(); System.out.printf("Key: %s, Value: %s", responseResult.key(), responseResult.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSettingWithResponse#string-string client.addSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS").value("db_connection")) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { ConfigurationSetting resultSetting = response; System.out.printf("Key: %s, Value: %s", resultSetting.key(), resultSetting.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSetting#ConfigurationSetting client.addSettingWithResponse(new ConfigurationSetting().key("prodDBConnection").label("westUS") .value("db_connection")) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { ConfigurationSetting responseSetting = response.value(); System.out.printf("Key: %s, Value: %s", responseSetting.key(), responseSetting.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSettingWithResponse#ConfigurationSetting }

Target:
public void addSettingsCodeSnippet() { ConfigurationAsyncClient client = getAsyncClient(); client.addSetting("prodDBConnection", "db_connection") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { System.out.printf("Key: %s, Value: %s", response.key(), response.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSetting#string-string client.addSetting(new ConfigurationSetting().key("prodDBConnection").label("westUS").value("db_connection")) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { System.out.printf("Key: %s, Value: %s", response.key(), response.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSetting#ConfigurationSetting client.addSettingWithResponse(new ConfigurationSetting().key("prodDBConnection").label("westUS") .value("db_connection")) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(response -> { ConfigurationSetting responseSetting = response.value(); System.out.printf("Key: %s, Value: %s", responseSetting.key(), responseSetting.value()); }); END: com.azure.data.appconfiguration.configurationasyncclient.addSettingWithResponse#ConfigurationSetting }
Source:
public static Instant convertLocalDateTimeToInstant(LocalDateTime localDateTime, ZoneId timeZone) { if (localDateTime == null) { return null; } Instant timeInUtc = localDateTime.toInstant(ZoneOffset.UTC); if (isSpecialTime(timeInUtc)) { return timeInUtc; } return localDateTime.atZone(timeZone).toInstant(); }

Target:
public static Instant convertLocalDateTimeToInstant(LocalDateTime localDateTime, ZoneId timeZone) { return localDateTime == null ? null : localDateTime.atZone(timeZone).toInstant(); }
Source:
protected void scanFile(XmlFile file) { NodeList nodeList = evaluate(singleConnectionFactoryBeansExpression, file.getNamespaceUnawareDocument()); for (int i = 0; i < nodeList.getLength(); i++) { if (!hasPropertyAsAttribute(nodeList.item(i)) && !hasPropertyAsChild(nodeList.item(i))) { reportIssue(nodeList.item(i), "Add a \"reconnectOnException\" property, set to \"true\""); } } }

Target:
protected void scanFile(XmlFile file) { evaluateAsList(singleConnectionFactoryBeansExpression, file.getNamespaceUnawareDocument()).forEach(bean -> { if (!hasPropertyAsAttribute(bean) && !hasPropertyAsChild(bean)) { reportIssue(bean, "Add a \"reconnectOnException\" property, set to \"true\""); } }); }
Source:
public static Slice createHll(@SqlType(StandardTypes.BIGINT) long value) { HyperLogLog hll = HyperLogLog.newInstance(ApproximateCountDistinctAggregation.standardErrorToBuckets(ApproximateSetAggregation.DEFAULT_STANDARD_ERROR)); hll.add(value); return hll.serialize(); }

Target:
public static Slice createHll(@SqlType(StandardTypes.BIGINT) long value) { HyperLogLog hll = HyperLogLog.newInstance(standardErrorToBuckets(DEFAULT_STANDARD_ERROR)); hll.add(value); return hll.serialize(); }
Source:
public @Nullable Object resolve(@NonNull ISegment segment) { if (segment instanceof CalledFunction) { CalledFunction calledFunction = (CalledFunction) segment; ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { String symbolText; ISymbolProvider provider = SymbolProviderManager.getInstance().getSymbolProvider(trace); ITmfStateValue symbol = ((ITmfStateValue) calledFunction.getSymbol()); switch (symbol.getType()) { case LONG: Long longAddress = symbol.unboxLong(); symbolText = provider.getSymbolText(longAddress); if (symbolText == null) { return "0x" + Long.toHexString(longAddress); } return symbolText; case STRING: return symbol.unboxStr(); case INTEGER: Integer intAddress = symbol.unboxInt(); symbolText = provider.getSymbolText(intAddress); if (symbolText == null) { return "0x" + Integer.toHexString(intAddress); } return symbolText; case DOUBLE: case NULL: case CUSTOM: default: break; } } } return null; }

Target:
public @Nullable Object resolve(@NonNull ISegment segment) { if (segment instanceof CalledFunction) { CalledFunction calledFunction = (CalledFunction) segment; ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { String symbolText; ISymbolProvider provider = SymbolProviderManager.getInstance().getSymbolProvider(trace); if (calledFunction.getSymbol() instanceof ITmfStateValue) { ITmfStateValue symbol = ((ITmfStateValue) calledFunction.getSymbol()); switch (symbol.getType()) { case LONG: Long longAddress = symbol.unboxLong(); symbolText = provider.getSymbolText(longAddress); if (symbolText == null) { return "0x" + Long.toHexString(longAddress); } return symbolText; case STRING: return symbol.unboxStr(); case INTEGER: Integer intAddress = symbol.unboxInt(); symbolText = provider.getSymbolText(intAddress); if (symbolText == null) { return "0x" + Integer.toHexString(intAddress); } return symbolText; case DOUBLE: case NULL: case CUSTOM: default: break; } } } } return null; }
Source:
public void testMismatchMessage() { final String expected = new StringBuilder() .append("header was: equalToIgnoringCase") .append("(\"content-type\") -> values: <[image/png]>") .toString(); final HmRqHeader matcher = new HmRqHeader( "content-type", "text/plain" ); final StringDescription description = new StringDescription(); final RqWithHeaders req = new RqWithHeaders(new RqFake(), "content-type: image/png"); matcher.matchesSafely(req); matcher.describeMismatchSafely(req, description); MatcherAssert.assertThat( description.toString(), Matchers.equalTo(expected) ); }

Target:
public void testMismatchMessage() { final HmRqHeader matcher = new HmRqHeader( "content-type", "text/plain" ); final StringDescription description = new StringDescription(); final RqWithHeaders req = new RqWithHeaders(new RqFake(), "content-type: image/png"); matcher.matchesSafely(req); matcher.describeMismatchSafely(req, description); MatcherAssert.assertThat( description.toString(), Matchers.equalTo(new StringBuilder() .append("header was: equalToIgnoringCase") .append("(\"content-type\") -> values: <[image/png]>") .toString() ) ); }
Source:
public void circularBufferTTL() throws InterruptedException { final int ttlInSeconds = 5; final RedisCircularBuffer<UUID> buffer = new RedisCircularBuffer<>(rdbi, circularBufferKey, 5, new UUIDSerialHelper(), ttlInSeconds); buffer.clear(); assertTrue(buffer.isEmpty()); final UUID first = UUID.randomUUID(); final UUID second = UUID.randomUUID(); buffer.addAll(ImmutableList.of(first, second)); assertEquals(buffer.size(), 2); assertEquals(buffer.peek(), first); assertTrue(buffer.containsAll(ImmutableList.of(first, second))); Thread.sleep(ttlInSeconds * 1000); assertTrue(buffer.isEmpty()); }

Target:
public void circularBufferTTL() { final int ttlInSeconds = 1; final RedisCircularBuffer<UUID> buffer = new RedisCircularBuffer<>(rdbi, circularBufferKey, 5, new UUIDSerialHelper(), ttlInSeconds); buffer.clear(); assertTrue(buffer.isEmpty()); final UUID first = UUID.randomUUID(); final UUID second = UUID.randomUUID(); buffer.addAll(ImmutableList.of(first, second)); assertEquals(buffer.size(), 2); assertEquals(buffer.peek(), first); assertTrue(buffer.containsAll(ImmutableList.of(first, second))); await().atMost(2, TimeUnit.SECONDS).until(buffer::isEmpty); }
Source:
public void checkCustomizedHttpResponseHeaders(String headerConfig, Map<String, String> expectedHeaders) throws IOException { Map<String, String> workerProps = baseWorkerProps(); workerProps.put("offset.storage.file.filename", "/tmp"); workerProps.put(WorkerConfig.RESPONSE_HTTP_HEADERS_CONFIG, headerConfig); WorkerConfig workerConfig = new StandaloneConfig(workerProps); EasyMock.expect(herder.kafkaClusterId()).andReturn(KAFKA_CLUSTER_ID); EasyMock.expect(herder.plugins()).andStubReturn(plugins); EasyMock.expect(plugins.newPlugins(Collections.emptyList(), workerConfig, ConnectRestExtension.class)).andStubReturn(Collections.emptyList()); EasyMock.expect(herder.connectors()).andReturn(Arrays.asList("a", "b")); PowerMock.replayAll(); server = new RestServer(workerConfig); server.initializeServer(); server.initializeResources(herder); HttpRequest request = new HttpGet("/connectors"); CloseableHttpClient httpClient = HttpClients.createMinimal(); HttpHost httpHost = new HttpHost(server.advertisedUrl().getHost(), server.advertisedUrl().getPort()); CloseableHttpResponse response = httpClient.execute(httpHost, request); Assert.assertEquals(200, response.getStatusLine().getStatusCode()); if (!headerConfig.isEmpty()) { expectedHeaders.forEach((k, v) -> Assert.assertEquals(response.getFirstHeader(k).getValue(), v)); } else { Assert.assertNull(response.getFirstHeader("X-Frame-Options")); } response.close(); server.stop(); }

Target:
private void checkCustomizedHttpResponseHeaders(String headerConfig, Map<String, String> expectedHeaders) throws IOException { Map<String, String> workerProps = baseWorkerProps(); workerProps.put("offset.storage.file.filename", "/tmp"); workerProps.put(WorkerConfig.RESPONSE_HTTP_HEADERS_CONFIG, headerConfig); WorkerConfig workerConfig = new DistributedConfig(workerProps); EasyMock.expect(herder.kafkaClusterId()).andReturn(KAFKA_CLUSTER_ID); EasyMock.expect(herder.plugins()).andStubReturn(plugins); EasyMock.expect(plugins.newPlugins(Collections.emptyList(), workerConfig, ConnectRestExtension.class)).andStubReturn(Collections.emptyList()); EasyMock.expect(herder.connectors()).andReturn(Arrays.asList("a", "b")); PowerMock.replayAll(); server = new RestServer(workerConfig); try { server.initializeServer(); server.initializeResources(herder); HttpRequest request = new HttpGet("/connectors"); try (CloseableHttpClient httpClient = HttpClients.createMinimal()) { HttpHost httpHost = new HttpHost(server.advertisedUrl().getHost(), server.advertisedUrl().getPort()); try (CloseableHttpResponse response = httpClient.execute(httpHost, request)) { Assert.assertEquals(200, response.getStatusLine().getStatusCode()); if (!headerConfig.isEmpty()) { expectedHeaders.forEach((k, v) -> Assert.assertEquals(response.getFirstHeader(k).getValue(), v)); } else { Assert.assertNull(response.getFirstHeader("X-Frame-Options")); } } } } finally { server.stop(); server = null; } }
Source:
public void analyze(UUID userAnonymizedId, NetworkActivityDto networkActivity) { if (networkActivity.getUrl().length() > MAX_SUPPORTED_URL_LENGTH) { throw AnalysisException.urlTooLong(networkActivity.getUrl().length(), MAX_SUPPORTED_URL_LENGTH); } UserAnonymizedDto userAnonymized = userAnonymizedService.getUserAnonymized(userAnonymizedId); Set<ActivityCategoryDto> matchingActivityCategories = activityCategoryFilterService .getMatchingCategoriesForSmoothwallCategories(networkActivity.getCategories()); analyze(ActivityPayload.createInstance(userAnonymized, networkActivity), matchingActivityCategories); }

Target:
public void analyze(UUID userAnonymizedId, NetworkActivityDto networkActivity) { UserAnonymizedDto userAnonymized = userAnonymizedService.getUserAnonymized(userAnonymizedId); Set<ActivityCategoryDto> matchingActivityCategories = activityCategoryFilterService .getMatchingCategoriesForSmoothwallCategories(networkActivity.getCategories()); analyze(ActivityPayload.createInstance(userAnonymized, networkActivity), matchingActivityCategories); }
Source:
private boolean areBricksInTheList(final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { for (GlusterBrickEntity brick : searchBricks) { if (paramBrick.getBrickDirectory().equals(brick.getBrickDirectory()) && paramBrick.getServerId() == brick.getServerId()) { found = true; break; } if (!found) { return found; } } } return found; }

Target:
private boolean areBricksInTheList(final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { for (GlusterBrickEntity brick : searchBricks) { if (paramBrick.getId() == brick.getId() || (paramBrick.getBrickDirectory().equals(brick.getBrickDirectory()) && paramBrick.getServerId() == brick.getServerId())) { found = true; break; } if (!found) { return found; } } } return found; }
Source:
private void ensureRepositoryConfiguration() { if (repository == null) { registerRepository(EventSourcingRepository.builder(aggregateType) .aggregateModel(aggregateModel()) .aggregateFactory(new GenericAggregateFactory<>(aggregateModel())) .eventStore(eventStore) .parameterResolverFactory(getParameterResolverFactory()) .handlerDefinition(getHandlerDefinition()) .repositoryProvider(getRepositoryProvider()) .build()); } }

Target:
private void ensureRepositoryConfiguration() { if (repository == null) { AggregateModel<T> aggregateModel = aggregateModel(); registerRepository(EventSourcingRepository.builder(aggregateType) .aggregateModel(aggregateModel) .aggregateFactory(new GenericAggregateFactory<>(aggregateModel)) .eventStore(eventStore) .parameterResolverFactory(getParameterResolverFactory()) .handlerDefinition(getHandlerDefinition()) .repositoryProvider(getRepositoryProvider()) .build()); } }
Source:
public byte[] serialize() { ByteBuffer buffer = ByteBuffer.allocate(5); buffer.put(TYPE_INTEGER); buffer.putInt(value); return buffer.array(); }

Target:
public byte[] serialize() { ByteBuffer buffer = ByteBuffer.allocate(Byte.BYTES + Integer.BYTES); buffer.put(getType().getByte()); buffer.putInt(value); return buffer.array(); }
Source:
protected Collection<String> defaultSuppressionAnnotations() { Collection<String> ignoredStrings = new ArrayList<>(); ignoredStrings.add("VisibleForTesting"); return ignoredStrings; }

Target:
protected Collection<String> defaultSuppressionAnnotations() { Collection<String> ignoredStrings = new ArrayList<>(); ignoredStrings.add("com.google.common.annotations.VisibleForTesting"); ignoredStrings.add("android.support.annotation.VisibleForTesting"); return ignoredStrings; }
Source:
public List<Class> getSupportedTypes() { return new ArrayList<>(Arrays.asList(Duration.class)); }

Target:
public List<Class> getSupportedTypes() { return Collections.singletonList(Duration.class); }
Source:
public void testSimpleHistograms() { MapType mapType = mapType(VARCHAR, BIGINT); InternalAggregationFunction aggregationFunction = getInternalAggregation(mapType.getTypeSignature(), parseTypeSignature(StandardTypes.VARCHAR)); assertAggregation( aggregationFunction, ImmutableMap.of("a", 1L, "b", 1L, "c", 1L), createStringsBlock("a", "b", "c")); mapType = mapType(BIGINT, BIGINT); aggregationFunction = getMetadata().getFunctionRegistry().getAggregateFunctionImplementation( new Signature(NAME, AGGREGATE, mapType.getTypeSignature(), parseTypeSignature(StandardTypes.BIGINT))); assertAggregation( aggregationFunction, ImmutableMap.of(100L, 1L, 200L, 1L, 300L, 1L), createLongsBlock(100L, 200L, 300L)); mapType = mapType(DOUBLE, BIGINT); aggregationFunction = getMetadata().getFunctionRegistry().getAggregateFunctionImplementation( new Signature(NAME, AGGREGATE, mapType.getTypeSignature(), parseTypeSignature(StandardTypes.DOUBLE))); assertAggregation( aggregationFunction, ImmutableMap.of(0.1, 1L, 0.3, 1L, 0.2, 1L), createDoublesBlock(0.1, 0.3, 0.2)); mapType = mapType(BOOLEAN, BIGINT); aggregationFunction = getMetadata().getFunctionRegistry().getAggregateFunctionImplementation( new Signature(NAME, AGGREGATE, mapType.getTypeSignature(), parseTypeSignature(StandardTypes.BOOLEAN))); assertAggregation( aggregationFunction, ImmutableMap.of(true, 1L, false, 1L), createBooleansBlock(true, false)); }

Target:
public void testSimpleHistograms() { MapType mapType = mapType(VARCHAR, BIGINT); InternalAggregationFunction aggregationFunction = getAggregation(mapType.getTypeSignature(), parseTypeSignature(StandardTypes.VARCHAR)); assertAggregation( aggregationFunction, ImmutableMap.of("a", 1L, "b", 1L, "c", 1L), createStringsBlock("a", "b", "c")); mapType = mapType(BIGINT, BIGINT); aggregationFunction = getMetadata().getFunctionRegistry().getAggregateFunctionImplementation( new Signature(NAME, AGGREGATE, mapType.getTypeSignature(), parseTypeSignature(StandardTypes.BIGINT))); assertAggregation( aggregationFunction, ImmutableMap.of(100L, 1L, 200L, 1L, 300L, 1L), createLongsBlock(100L, 200L, 300L)); mapType = mapType(DOUBLE, BIGINT); aggregationFunction = getMetadata().getFunctionRegistry().getAggregateFunctionImplementation( new Signature(NAME, AGGREGATE, mapType.getTypeSignature(), parseTypeSignature(StandardTypes.DOUBLE))); assertAggregation( aggregationFunction, ImmutableMap.of(0.1, 1L, 0.3, 1L, 0.2, 1L), createDoublesBlock(0.1, 0.3, 0.2)); mapType = mapType(BOOLEAN, BIGINT); aggregationFunction = getMetadata().getFunctionRegistry().getAggregateFunctionImplementation( new Signature(NAME, AGGREGATE, mapType.getTypeSignature(), parseTypeSignature(StandardTypes.BOOLEAN))); assertAggregation( aggregationFunction, ImmutableMap.of(true, 1L, false, 1L), createBooleansBlock(true, false)); }
Source:
public void findsTarget() { final SootMethod sootMethod = prepareTarget("<" + TEST_TARGET_CLASS + ": void test()>", TEST_TARGET_CLASS); Assert.assertNotNull("Could not find target method. System test setup seems to be incorrect.", sootMethod); Assert.assertTrue(sootMethod.isConcrete()); Assert.assertNotNull(sootMethod.retrieveActiveBody()); for (Unit u : sootMethod.getActiveBody().getUnits()) { if (u instanceof AssignStmt) { Value right = ((AssignStmt) u).getRightOp(); if (right instanceof InvokeExpr) { } } } }

Target:
public void findsTarget() { String methodSignature = methodSigFromComponents(TEST_TARGET_CLASS, "void", "test", ""); final SootMethod sootMethod = prepareTarget(methodSignature, TEST_TARGET_CLASS); Assert.assertTrue(sootMethod.isConcrete()); Assert.assertNotNull(sootMethod.retrieveActiveBody()); for (Unit u : sootMethod.getActiveBody().getUnits()) { if (u instanceof AssignStmt) { Value right = ((AssignStmt) u).getRightOp(); if (right instanceof InvokeExpr) { SootMethod m = ((InvokeExpr) right).getMethodRef().resolve(); Assert.assertFalse(m.isPhantom()); Assert.assertTrue(m.isDeclared()); if (m.getName().equals("invoke")) { Assert.assertTrue(m.isNative()); } } } } }
Source:
private Optional<TableToSweep> getTableToSweep() { return txManager.runTaskWithRetry(new TransactionTask<Optional<TableToSweep>, RuntimeException>() { @Override public Optional<TableToSweep> execute(Transaction tx) { Optional<SweepProgress> progress = sweepProgressStore.loadProgress(tx); if (progress.isPresent()) { return Optional.of(new TableToSweep(progress.get().tableRef(), progress.get())); } else { Optional<TableReference> nextTable = nextTableToSweepProvider.chooseNextTableToSweep( tx, sweepRunner.getConservativeSweepTimestamp()); if (nextTable.isPresent()) { log.info("Now starting to sweep {}.", UnsafeArg.of("next table", nextTable)); return Optional.of(new TableToSweep(nextTable.get(), null)); } else { return Optional.empty(); } } } }); }

Target:
private Optional<TableToSweep> getTableToSweep() { return txManager.runTaskWithRetry(new TransactionTask<Optional<TableToSweep>, RuntimeException>() { @Override public Optional<TableToSweep> execute(Transaction tx) { Optional<SweepProgress> progress = sweepProgressStore.loadProgress(tx); if (progress.isPresent()) { return Optional.of(new TableToSweep(progress.get().tableRef(), progress.get())); } else { Optional<TableReference> nextTable = nextTableToSweepProvider.chooseNextTableToSweep( tx, sweepRunner.getConservativeSweepTimestamp()); if (nextTable.isPresent()) { log.debug("Now starting to sweep {}.", UnsafeArg.of("table name", nextTable)); return Optional.of(new TableToSweep(nextTable.get(), null)); } else { return Optional.empty(); } } } }); }
Source:
private static List<String> getInitScriptArguments() { File initScript = getEclipsePluginInitScriptLocation(); try { if (!initScript.exists()) { Files.createParentDirs(initScript); Files.touch(initScript); URL resource = GradleVersion.class.getResource(INITSCRIPT_LOCATION); if (resource == null) { throw new GradlePluginsRuntimeException(String.format("Resource '%s' not found.", INITSCRIPT_LOCATION)); } URLConnection connection = resource.openConnection(); connection.setUseCaches(false); try (InputStream inputStream = connection.getInputStream()) { Files.asByteSink(initScript).writeFrom(inputStream); } } return Arrays.asList("--init-script", initScript.getAbsolutePath()); } catch (IOException e) { throw new GradlePluginsRuntimeException("Failed to create init script", e); } }

Target:
private static List<String> getInitScriptArguments() { File initScript = getEclipsePluginInitScriptLocation(); try { if (!initScript.exists()) { Files.createParentDirs(initScript); Files.touch(initScript); URL resource = GradleVersion.class.getResource(INITSCRIPT_LOCATION); if (resource == null) { throw new GradlePluginsRuntimeException(String.format("Resource '%s' not found.", INITSCRIPT_LOCATION)); } URLConnection connection = resource.openConnection(); try (InputStream inputStream = connection.getInputStream()) { Files.asByteSink(initScript).writeFrom(inputStream); } } return Arrays.asList("--init-script", initScript.getAbsolutePath()); } catch (IOException e) { throw new GradlePluginsRuntimeException("Failed to create init script", e); } }
Source:
private PaxosStateLog<PaxosValue> createFileSystemLog(Client client) { Path dir = useCase.logDirectoryRelativeToDataDirectory(legacyDirectory).resolve(client.value()); String learnerLogDir = Paths.get(dir.toString(), PaxosTimeLockConstants.LEARNER_SUBDIRECTORY_PATH).toString(); return new PaxosStateLogImpl<>(learnerLogDir); }

Target:
private PaxosStateLog<PaxosValue> createFileSystemLog(Client client) { Path dir = useCase.logDirectoryRelativeToDataDirectory(legacyDirectory).resolve(client.value()); String learnerLogDir = dir.resolve(PaxosTimeLockConstants.LEARNER_SUBDIRECTORY_PATH).toString(); return new PaxosStateLogImpl<>(learnerLogDir); }
Source:
public synchronized void stop() { LOG.info("Stopping event hub system producer..."); streamPartitionSenders.values().forEach((streamPartitionSender) -> { List<CompletableFuture<Void>> futures = new ArrayList<>(); streamPartitionSender.forEach((key, value) -> futures.add(value.close())); CompletableFuture<Void> future = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])); try { future.get(config.getShutdownWaitTimeMS(), TimeUnit.MILLISECONDS); } catch (ExecutionException | InterruptedException e) { LOG.warn("Closing the partition sender failed ", e); } catch (TimeoutException e) { LOG.warn("Closing the partition sender timed out ", e); } }); eventHubClients.values().forEach(ehClient -> ehClient.close(config.getShutdownWaitTimeMS())); eventHubClients.clear(); }

Target:
public synchronized void stop() { LOG.debug("Stopping producer.", pendingFutures.size()); streamPartitionSenders.values().forEach((streamPartitionSender) -> { List<CompletableFuture<Void>> futures = new ArrayList<>(); streamPartitionSender.forEach((key, value) -> futures.add(value.close())); CompletableFuture<Void> future = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])); try { future.get(DEFAULT_SHUTDOWN_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (ExecutionException | InterruptedException | TimeoutException e) { LOG.error("Closing the partition sender failed ", e); } }); eventHubClients.values().forEach(ehClient -> ehClient.close(DEFAULT_SHUTDOWN_TIMEOUT_MILLIS)); eventHubClients.clear(); }
Source:
public void testExcessResourcesAreAssignedOnResourceLoss() { JobScopedResourceTracker tracker = new JobScopedResourceTracker(JobID.generate()); tracker.notifyAcquiredResource(ResourceProfile.ANY); tracker.notifyAcquiredResource(ResourceProfile.ANY); tracker.notifyResourceRequirements(Collections.singleton(ResourceRequirement.create(ResourceProfile.UNKNOWN, 1))); tracker.notifyLostResource(ResourceProfile.ANY); assertThat(tracker.getAcquiredResources(), contains(ResourceRequirement.create(ResourceProfile.ANY, 1))); }

Target:
public void testExcessResourcesAreAssignedOnResourceLoss() { JobScopedResourceTracker tracker = new JobScopedResourceTracker(JobID.generate()); tracker.notifyAcquiredResource(ResourceProfile.ANY); tracker.notifyAcquiredResource(ResourceProfile.ANY); tracker.notifyResourceRequirements(Collections.singleton(ResourceRequirement.create(ResourceProfile.UNKNOWN, 1))); tracker.notifyLostResource(ResourceProfile.ANY); assertThat(tracker.getAcquiredResources(), contains(ResourceRequirement.create(ResourceProfile.ANY, 1))); assertThat(tracker.getMissingResources(), empty()); }
Source:
public Object unMarshall(String returnType, InputStream is) { Object unMarshalledObj = null; try { unMarshalledObj = xmlGen.fromXML(returnType, is); } catch (Exception e) { log.error( "Exception Occured while unmarshalling the inputstream to java object of type:" + returnType, e); e.printStackTrace(); } return unMarshalledObj; }

Target:
public Object unMarshall(String returnType, InputStream is) { Object unMarshalledObj = null; try { unMarshalledObj = xmlGen.fromXML(returnType, is); } catch (Exception e) { log.error( "Exception Occured while unmarshalling the inputstream to java object of type:" + returnType, e); } return unMarshalledObj; }
Source:
public void onImageClick(int position) { String baseUrlString = "<LINK_0>"; String barcodePattern = new StringBuilder(product.getCode()) .insert(3, "/") .insert(7, "/") .insert(11, "/") .toString(); String finalUrlString = baseUrlString + barcodePattern + "/" + imageNames.get(position) + ".400" + ".jpg"; openFullScreen(finalUrlString); }

Target:
public void onImageClick(int position) { String baseUrlString = "<LINK_0>"; String barcodePattern = new StringBuilder(product.getCode()) .insert(3, "/") .insert(7, "/") .insert(11, "/") .toString(); String finalUrlString = baseUrlString + barcodePattern + "/" + imageNames.get(position) + ".jpg"; imgMap.put("imgid", imageNames.get(position)); imgMap.put("id", ProductImageField.OTHER.toString() + '_' + product.getLang()); openFullScreen(finalUrlString); }
Source:
public void testInitialSizeIsZero() throws Exception { factory.setUrl("nonsense invalid url"); factory.setInitialSize(0); ManagedDataSource dataSource = factory.build(metricRegistry, "test"); try { dataSource.start(); } catch (Exception e) { fail(); } }

Target:
public void testInitialSizeIsZero() throws Exception { factory.setUrl("nonsense invalid url"); factory.setInitialSize(0); ManagedDataSource dataSource = factory.build(metricRegistry, "test"); dataSource.start(); }
Source:
public void testSetSecuredScalarProperty() { try { DocumentModel doc = new DocumentModelImpl("/", "doc", "Secured"); doc.setProperty(SECURED_SCHEMA, "scalar", "test secure"); fail("A ReadOnlyPropertyException should have been thrown"); } catch (ReadOnlyPropertyException e) { assertEquals("scalar", e.getMessage()); } }

Target:
public void testSetSecuredScalarProperty() { try { DocumentModel doc = new DocumentModelImpl("/", "doc", "Secured"); doc.setProperty(SECURED_SCHEMA, "scalar", "test secure"); fail("A ReadOnlyPropertyException should have been thrown"); } catch (ReadOnlyPropertyException e) { assertEquals("Cannot set the value of property: scalar since it is readonly", e.getMessage()); } }
Source:
public AcknowledgementType logAudit(LogEventSecureRequestType mess, AssertionType assertion) { AcknowledgementType response = new AcknowledgementType(); AuditRepositoryRecord auditRec = new AuditRepositoryRecord(); EventIdentificationType eventIdentification = mess.getAuditMessage().getEventIdentification(); auditRec.setUserId(null); String eventCommunityId = mess.getRemoteHCID(); LOG.info("auditSourceID : " + eventCommunityId); if (NullChecker.isNotNullish(eventCommunityId)) { auditRec.setRemoteHcid(eventCommunityId); } else { auditRec.setRemoteHcid(""); } auditRec.setDirection(mess.getDirection()); auditRec.setMessage(getBlobFromAuditMessage(mess.getAuditMessage())); XMLGregorianCalendar xMLCalDate = eventIdentification.getEventDateTime(); if (xMLCalDate != null) { auditRec.setEventTimeStamp(convertXMLGregorianCalendarToDate(xMLCalDate)); } auditRec.setEventType("servicetype"); auditRec.setOutcome(0); auditRec.setEventId("evenId"); List<AuditRepositoryRecord> auditRecList = new ArrayList<>(); auditRecList.add(auditRec); LOG.trace("AuditRepositoryOrchImpl.logAudit() -- Calling auditLogDao to insert record into database."); boolean result = auditLogDao.insertAuditRepository(auditRecList); LOG.trace("AuditRepositoryOrchImpl.logAudit() -- Done calling auditLogDao to insert record into database."); if (result) { response.setMessage("Created Log Message in Database..."); } else { response.setMessage("Unable to create Log Message in Database..."); } return response; }

Target:
public AcknowledgementType logAudit(LogEventSecureRequestType mess, AssertionType assertion) { AcknowledgementType response = new AcknowledgementType(); AuditRepositoryRecord auditRec = new AuditRepositoryRecord(); EventIdentificationType eventIdentification = mess.getAuditMessage().getEventIdentification(); auditRec.setUserId(null); String eventCommunityId = mess.getRemoteHCID(); LOG.info("auditSourceID : " + eventCommunityId); if (NullChecker.isNotNullish(eventCommunityId)) { auditRec.setRemoteHcid(eventCommunityId); } else { auditRec.setRemoteHcid(""); } auditRec.setDirection(mess.getDirection()); auditRec.setMessage(getBlobFromAuditMessage(mess.getAuditMessage())); XMLGregorianCalendar xMLCalDate = eventIdentification.getEventDateTime(); if (xMLCalDate != null) { auditRec.setEventTimeStamp(convertXMLGregorianCalendarToDate(xMLCalDate)); } auditRec.setEventType("servicetype"); auditRec.setOutcome(0); auditRec.setEventId("EventId"); List<AuditRepositoryRecord> auditRecList = new ArrayList<>(); auditRecList.add(auditRec); LOG.trace("AuditRepositoryOrchImpl.logAudit() -- Calling auditLogDao to insert record into database."); boolean result = auditLogDao.insertAuditRepository(auditRecList); LOG.trace("AuditRepositoryOrchImpl.logAudit() -- Done calling auditLogDao to insert record into database."); if (result) { response.setMessage("Created Log Message in Database..."); } else { response.setMessage("Unable to create Log Message in Database..."); } return response; }
Source:
public int compare(AdminUnitReview o1, AdminUnitReview o2) { List<Comparator<AdminUnitReview>> listComparators = Arrays.asList(expertComparator, gaulCodeComparator, Collections.reverseOrder(dateComparator)); for (Comparator<AdminUnitReview> comparator : listComparators) { int result = comparator.compare(o1, o2); if (result != 0) { return result; } } return 0; }

Target:
public int compare(AdminUnitReview o1, AdminUnitReview o2) { return new CompareToBuilder() .append(o1.getExpert().getId(), o2.getExpert().getId()) .append(o1.getAdminUnitGlobalOrTropicalGaulCode(), o2.getAdminUnitGlobalOrTropicalGaulCode()) .append(o2.getCreatedDate(), o1.getCreatedDate()) .toComparison(); }
Source:
private boolean isQuorumNeeded(Operation op) { if (op instanceof QuorumCheckAwareOperation && !((QuorumCheckAwareOperation) op).shouldCheckQuorum()) { return false; } QuorumType type = config.getType(); switch (type) { case WRITE: return isWriteOperation(op); case READ: return isReadOperation(op); case READ_WRITE: return isReadOperation(op) || isWriteOperation(op); default: throw new IllegalStateException("Unhandled quorum type: " + type); } }

Target:
private boolean isQuorumNeeded(Operation op) { QuorumType type = config.getType(); switch (type) { case WRITE: return isWriteOperation(op) && shouldCheckQuorum(op); case READ: return isReadOperation(op) && shouldCheckQuorum(op); case READ_WRITE: return (isReadOperation(op) || isWriteOperation(op)) && shouldCheckQuorum(op); default: throw new IllegalStateException("Unhandled quorum type: " + type); } }
Source:
public ContainsMatcher(String queryString) { super(null,queryString); }

Target:
public ContainsMatcher(String queryString) { super("Test",queryString); }
Source:
public void initialise() { assert driver == null; executor.execute(() -> { driver = createChromeDriver(); logger.info("Successfully initialised browser component and ChromeDriver"); }); if (!isChromeCustomProfileExist()) { login(); } else { runBrowserOperation(() -> driver.get(GitHubURL.MAIN_PAGE, false)); } }

Target:
public void initialise() { assert driver == null; executor.execute(() -> { driver = createChromeDriver(); logger.info("Successfully initialised browser component and ChromeDriver"); }); if (!isChromeCustomProfilePresent()) { login(); } else { runBrowserOperation(() -> driver.get(GitHubURL.MAIN_PAGE, false)); } }
Source:
public HllSketch combine(final Object objectA, final Object objectB) { final Union union = new Union(lgK); union.update((HllSketch) objectA); union.update((HllSketch) objectA); return union.getResult(tgtHllType); }

Target:
public HllSketch combine(final Object objectA, final Object objectB) { final Union union = new Union(lgK); union.update((HllSketch) objectA); union.update((HllSketch) objectB); return union.getResult(tgtHllType); }
Source:
public void removeObsoleteCcJudgments() throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException { log.debug("Obsolete judgments removing has started"); JobExecution execution = jobExecutor.forceStartNewJob(ccJudgmentRemoveObsoleteJob); log.debug("Obsolete judgments removing has finished, exit status: {}", execution.getStatus()); }

Target:
public void removeObsoleteCcJudgments() throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException { log.debug("Deletion of removed judgments has started"); JobExecution execution = jobExecutor.forceStartNewJob(ccJudgmentDeleteRemovedJob); log.debug("Deletion of removed judgments has finished, exit status: {}", execution.getStatus()); }
Source:
AdaptiveOperationTracker(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, RouterOperation routerOperation, PartitionId partitionId, String originatingDcName, Time time) { super(routerConfig, routerOperation, partitionId, originatingDcName, true); this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.time = time; this.localDcHistogram = getWholeDcTracker(routerOperation, true); this.crossDcHistogram = getWholeDcTracker(routerOperation, false); this.pastDueCounter = getWholeDcPastDueCounter(routerOperation); this.quantile = routerConfig.routerLatencyToleranceQuantile; this.otIterator = new OpTrackerIterator(); if (routerConfig.routerOperationTrackerMetricScope != OperationTrackerScope.Datacenter) { localDcResourceToHistogram = getResourceToLatencyMap(routerOperation, true); crossDcResourceToHistogram = getResourceToLatencyMap(routerOperation, false); } if (parallelism > routerConfig.routerAdaptiveTrackerMaxInflightRequests) { throw new IllegalArgumentException( "Operation tracker parallelism is larger than adaptive tracker max inflight number"); } }

Target:
AdaptiveOperationTracker(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, RouterOperation routerOperation, PartitionId partitionId, String originatingDcName, Time time) { super(routerConfig, routerOperation, partitionId, originatingDcName, true); this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.time = time; this.localDcHistogram = getWholeDcTracker(routerOperation, true); this.crossDcHistogram = getWholeDcTracker(routerOperation, false); this.pastDueCounter = getWholeDcPastDueCounter(routerOperation); this.quantile = routerConfig.routerLatencyToleranceQuantile; this.otIterator = new OpTrackerIterator(); if (routerConfig.routerOperationTrackerMetricScope != OperationTrackerScope.Datacenter) { localDcResourceToHistogram = getResourceToLatencyMap(routerOperation, true); crossDcResourceToHistogram = getResourceToLatencyMap(routerOperation, false); } if (parallelism > routerConfig.routerOperationTrackerMaxInflightRequests) { throw new IllegalArgumentException( "Operation tracker parallelism is larger than adaptive tracker max inflight number"); } }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", Integer.toHexString(System.identityHashCode(this))) .add("class", this.getClass()) .add("uuid", _uuid) .add("Tags", _tags) .add("VersionSet", _versionSet) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", Integer.toHexString(System.identityHashCode(this))) .add("class", this.getClass()) .add("Uuid", _uuid) .add("Tags", _tags) .add("VersionSet", _versionSet) .toString(); }