auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSerialization() throws IOException, ClassNotFoundException { BinaryAnnotation binaryAnnotation = new BinaryAnnotation(); binaryAnnotation.setKey("http.method"); binaryAnnotation.setValue("GET"); binaryAnnotation.setEndpoint(createEndpoint("bonjour", "127.0.0.2", 8090)); binaryAnnotation.setType(AnnotationType.STRING); Span span = new Span(Arrays.asList(binaryAnnotation)); span.setAnnotations(serverAnnotations()); Span deserializedSPan = (Span)deserialize(serialize(span)); Assert.assertEquals(span.binaryAnnotationMapping(), deserializedSPan.binaryAnnotationMapping()); Assert.assertEquals(span.getBinaryAnnotations(), deserializedSPan.getBinaryAnnotations()); Assert.assertEquals(span.getAnnotations(), deserializedSPan.getAnnotations()); }

Target:
public void testSerialization() throws IOException, ClassNotFoundException { BinaryAnnotationMappingDeriver.clearStorage(); String testResourcesPath = getClass().getClassLoader().getResource(".").getPath(); BinaryAnnotationMappingDeriver mappingDeriver = BinaryAnnotationMappingDeriver.getInstance(testResourcesPath + "test-binary-annotations-mapping.json"); BinaryAnnotation stringAnnotation = new BinaryAnnotation(); stringAnnotation.setKey("http.method"); stringAnnotation.setValue("GET"); stringAnnotation.setEndpoint(createEndpoint("bonjour", "127.0.0.2", 8090)); stringAnnotation.setType(AnnotationType.STRING); BinaryAnnotation binaryAnnotationWithMapping = new BinaryAnnotation(); binaryAnnotationWithMapping.setKey("foo"); binaryAnnotationWithMapping.setValue("value"); binaryAnnotationWithMapping.setEndpoint(createEndpoint("bonjour2", "127.0.1.2", 8090)); binaryAnnotationWithMapping.setType(AnnotationType.DOUBLE); Span span = new Span(Arrays.asList(stringAnnotation, binaryAnnotationWithMapping)); span.setAnnotations(serverAnnotations()); Span deserializedSpan = (Span)deserialize(serialize(span)); Assert.assertEquals(span, deserializedSpan); Assert.assertEquals(new HashSet<>(Arrays.asList( new AbstractMap.SimpleEntry<>("http.method", "GET"), new AbstractMap.SimpleEntry<>("foo.detail", "value"))), deserializedSpan.binaryAnnotationMapping().getNodeDetails().entrySet()); Assert.assertEquals(new HashSet<>(Arrays.asList( new Property("foo.prop", "value", PropertyType.Number))), new HashSet<>(deserializedSpan.binaryAnnotationMapping().getProperties())); Assert.assertEquals("foo.modified", deserializedSpan.binaryAnnotationMapping().getComponentType()); Assert.assertEquals("foo.endpoint", deserializedSpan.binaryAnnotationMapping().getEndpointType()); }
Source:
private static NetworkInterface getFirstNetworkInterface(final List<NetworkInterface> validNetworkInterfaces) { NetworkInterface result = null; for (NetworkInterface item : validNetworkInterfaces) { Enumeration<InetAddress> addresses = item.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress inetAddress = addresses.nextElement(); if (isValidAddress(inetAddress)) { result = item; break; } } } if (result == null && validNetworkInterfaces.size() > 0) { result = validNetworkInterfaces.get(0); } return result; }

Target:
private static NetworkInterface getFirstNetworkInterface(final List<NetworkInterface> validNetworkInterfaces) { NetworkInterface result = null; for (NetworkInterface each : validNetworkInterfaces) { Enumeration<InetAddress> addresses = each.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress inetAddress = addresses.nextElement(); if (isValidAddress(inetAddress)) { result = each; break; } } } if (null == result && !validNetworkInterfaces.isEmpty()) { result = validNetworkInterfaces.get(0); } return result; }
Source:
public GroupedExecutionProperties visitJoin(JoinNode node, Void context) { GroupedExecutionProperties left = node.getLeft().accept(this, null); GroupedExecutionProperties right = node.getRight().accept(this, null); if (!node.getDistributionType().isPresent()) { return GroupedExecutionProperties.notCapable(); } if ((node.getType() == JoinNode.Type.RIGHT || node.getType() == JoinNode.Type.FULL) && !right.currentNodeCapable) { return GroupedExecutionProperties.notCapable(); } switch (node.getDistributionType().get()) { case REPLICATED: checkState(!right.currentNodeCapable); return left; case PARTITIONED: if (left.currentNodeCapable && right.currentNodeCapable) { checkState(left.totalLifespans == right.totalLifespans); return new GroupedExecutionProperties( true, true, ImmutableList.<PlanNodeId>builder() .addAll(left.capableTableScanNodes) .addAll(right.capableTableScanNodes) .build(), left.totalLifespans); } return left; default: throw new UnsupportedOperationException("Unknown distribution type: " + node.getDistributionType()); } }

Target:
public GroupedExecutionProperties visitJoin(JoinNode node, Void context) { GroupedExecutionProperties left = node.getLeft().accept(this, null); GroupedExecutionProperties right = node.getRight().accept(this, null); if (!node.getDistributionType().isPresent()) { return GroupedExecutionProperties.notCapable(); } if ((node.getType() == JoinNode.Type.RIGHT || node.getType() == JoinNode.Type.FULL) && !right.currentNodeCapable) { return GroupedExecutionProperties.notCapable(); } switch (node.getDistributionType().get()) { case REPLICATED: checkState(!right.currentNodeCapable); return left; case PARTITIONED: if (left.currentNodeCapable && right.currentNodeCapable) { checkState(left.totalLifespans == right.totalLifespans, format("Mismatched number of lifespans on left(%s) and right(%s) side of join", left.totalLifespans, right.totalLifespans)); return new GroupedExecutionProperties( true, true, ImmutableList.<PlanNodeId>builder() .addAll(left.capableTableScanNodes) .addAll(right.capableTableScanNodes) .build(), left.totalLifespans); } return left; default: throw new UnsupportedOperationException("Unknown distribution type: " + node.getDistributionType()); } }
Source:
public String toString() { final StringBuffer sb = new StringBuffer("FileTailerState{"); sb.append("fileName='").append(fileName).append('\''); sb.append(", position=").append(position); sb.append(", hash='").append(hash).append('\''); sb.append(", lastModifyTime=").append(lastModifyTime); sb.append('}'); return sb.toString(); }

Target:
public String toString() { return new StringBuffer("FileTailerState{") .append("fileName='").append(fileName).append('\'') .append(", position=").append(position) .append(", hash='").append(hash).append('\'') .append(", lastModifyTime=").append(lastModifyTime) .append('}').toString(); }
Source:
private String getInternalIpAddress() { final Map<String, ContainerNetwork> networks = getContainerInfo().getNetworkSettings().getNetworks(); for (ContainerNetwork network : networks.values()) { return network.getIpAddress(); } throw new IllegalStateException("No network available to extract the internal IP from!"); }

Target:
private String getInternalIpAddress() { return getContainerInfo().getNetworkSettings().getNetworks().values().stream() .findFirst() .map(ContainerNetwork::getIpAddress) .orElseThrow(() -> new IllegalStateException("No network available to extract the internal IP from!")); }
Source:
MultiCacheException addFirstThrowable(Throwable t) { if (t == null) { throw new NullPointerException(); } if (t == this) { throw new IllegalArgumentException("cannot add to self"); } if (t instanceof MultiCacheException) { MultiCacheException multiCacheException = (MultiCacheException) t; List<Throwable> throwables = multiCacheException.getThrowables(); ListIterator<Throwable> listIterator = throwables.listIterator(throwables.size()); while (listIterator.hasPrevious()) { throwables.add(0, listIterator.previous()); } } throwables.add(0, t); return this; }

Target:
MultiCacheException addFirstThrowable(Throwable t) { if (t == null) { throw new NullPointerException(); } if (t == this) { throw new IllegalArgumentException("cannot add to self"); } if (t instanceof MultiCacheException) { MultiCacheException mce = (MultiCacheException) t; throwables.addAll(0, mce.getThrowables()); } throwables.add(0, t); return this; }
Source:
public <K, V> void assertNoneSatisfy(AssertionInfo info, Map<K, V> actual, BiConsumer<? super K,? super V> entryRequirements) { checkNotNull(entryRequirements, "The BiConsumer<K, V> expressing the assertions requirements must not be null"); assertNotNull(info, actual); List<Map.Entry<K, V>> erroneousElements = actual.entrySet().stream() .map(entry -> failsRestrictions(entry, entryRequirements)) .filter(Optional::isPresent) .map(Optional::get) .collect(toList()); if (erroneousElements.size() > 0) throw failures.failure(info, noElementsShouldSatisfy(actual, erroneousElements)); }

Target:
public <K, V> void assertNoneSatisfy(AssertionInfo info, Map<K, V> actual, BiConsumer<? super K,? super V> entryRequirements) { checkNotNull(entryRequirements, "The BiConsumer<K, V> expressing the assertions requirements must not be null"); assertNotNull(info, actual); List<Map.Entry<K, V>> erroneousEntries = actual.entrySet().stream() .map(entry -> failsRestrictions(entry, entryRequirements)) .filter(Optional::isPresent) .map(Optional::get) .collect(toList()); if (erroneousEntries.size() > 0) throw failures.failure(info, noElementsShouldSatisfy(actual, erroneousEntries)); }
Source:
public void checkAttributeSyntax(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException { if (attribute.getValue() == null) return; List<String> values = attribute.valueAsList(); for (String value : values) { if (!pattern.matcher(value).matches()) { throw new WrongAttributeValueException(attribute, resource.getName() + " has attribute whose value is not valid"); } } }

Target:
public void checkAttributeSyntax(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException { if (attribute.getValue() == null) return; List<String> values = attribute.valueAsList(); for (String value : values) { if (!PATTERN.matcher(value).matches()) { throw new WrongAttributeValueException(attribute, resource.getName() + " has attribute whose value is not valid. Example of valid value: res:RESOURCE[:CHILD-RESOURCE1][:CHILD-RESOURCE2]...[:act:ACTION[,ACTION]...]"); } } }
Source:
public void importKeySnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); JsonWebKey jsonWebKeyToImport = new JsonWebKey(); keyAsyncClient.importKey("keyName", jsonWebKeyToImport).subscribe(keyResponse -> System.out.printf("Key is imported with name %s and id %s \n", keyResponse.getName(), keyResponse.getId())); END: com.azure.security.keyvault.keys.keyasyncclient.importKey#string-jsonwebkey ImportKeyOptions options = new ImportKeyOptions("keyName", jsonWebKeyToImport) .setHardwareProtected(false); keyAsyncClient.importKey(options).subscribe(keyResponse -> System.out.printf("Key is imported with name %s and id %s \n", keyResponse.getName(), keyResponse.getId())); END: com.azure.security.keyvault.keys.keyasyncclient.importKey#options ImportKeyOptions importKeyOptions = new ImportKeyOptions("keyName", jsonWebKeyToImport) .setHardwareProtected(false); keyAsyncClient.importKey(importKeyOptions).subscribe(keyResponse -> System.out.printf("Key is imported with name %s and id %s \n", keyResponse.getName(), keyResponse.getId())); END: com.azure.security.keyvault.keys.keyasyncclient.importKeyWithResponse#options-response }

Target:
public void importKeySnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); JsonWebKey jsonWebKeyToImport = new JsonWebKey(); keyAsyncClient.importKey("keyName", jsonWebKeyToImport).subscribe(keyResponse -> System.out.printf("Key is imported with name %s and id %s \n", keyResponse.getName(), keyResponse.getId())); END: com.azure.security.keyvault.keys.keyasyncclient.importKey#string-jsonwebkey ImportKeyOptions options = new ImportKeyOptions("keyName", jsonWebKeyToImport) .setHardwareProtected(false); keyAsyncClient.importKey(options).subscribe(keyResponse -> System.out.printf("Key is imported with name %s and id %s \n", keyResponse.getName(), keyResponse.getId())); END: com.azure.security.keyvault.keys.keyasyncclient.importKey#options ImportKeyOptions importKeyOptions = new ImportKeyOptions("keyName", jsonWebKeyToImport) .setHardwareProtected(false); keyAsyncClient.importKeyWithResponse(importKeyOptions).subscribe(keyResponse -> System.out.printf("Key is imported with name %s and id %s \n", keyResponse.getValue().getName(), keyResponse.getValue().getId())); END: com.azure.security.keyvault.keys.keyasyncclient.importKeyWithResponse#options-response }
Source:
public static String inconclusiveHotSpotSummary(Alteration alteration, Query query) { StringBuilder sb = new StringBuilder(); sb.append(inconclusiveSummary(alteration.getGene(), query.getAlteration())); sb.append(" However, "); String hotspotSummary = hotspotSummary(alteration, query, true); sb.append(hotspotSummary.substring(0, 1).toLowerCase()); sb.append(hotspotSummary.substring(1)); return sb.toString(); }

Target:
public static String inconclusiveHotSpotSummary(Alteration alteration, Query query) { StringBuilder sb = new StringBuilder(); sb.append(inconclusiveSummary(alteration.getGene(), query.getAlteration())); sb.append(" However, "); String hotspotSummary = hotspotSummary(alteration, query, true); sb.append(StringUtils.uncapitalize(hotspotSummary)); return sb.toString(); }
Source:
public void impl(@Nonnull CorfuRuntime runtime) throws OutrankedException, ExecutionException, InterruptedException { Layout layout; do { runtime.invalidateLayout(); layout = runtime.getLayoutView().getLayout(); Set<String> lowRedundancyServers = Sets.difference( layout.getSegments().get(1).getAllLogServers(), layout.getSegments().get(0).getAllLogServers()); StateTransfer.transfer(layout, lowRedundancyServers, runtime, layout.getSegments().get(0)); runtime.getLayoutManagementView().mergeSegments(new Layout(layout)); } while (layout.getSegments().size() > 1); }

Target:
public void impl(@Nonnull CorfuRuntime runtime) throws OutrankedException, ExecutionException, InterruptedException { runtime.invalidateLayout(); Layout layout = runtime.getLayoutView().getLayout(); final int layoutSegmentToMergeTo = 0; while (layout.getSegments().size() > 1) { Set<String> lowRedundancyServers = getNodesWithReducedRedundancy(layout, layoutSegmentToMergeTo); StateTransfer.transfer(layout, lowRedundancyServers, runtime, layout.getFirstSegment()); runtime.getLayoutManagementView().mergeSegments(new Layout(layout)); runtime.invalidateLayout(); layout = runtime.getLayoutView().getLayout(); } }
Source:
void updateHashSetsFromCentralRepository() throws TskCoreException { if(EamDb.isEnabled()){ List<HashDbInfo> crHashDbInfoList = getCentralRepoHashSetsFromDatabase(); for(HashDbInfo hashDbInfo : crHashDbInfoList) { if(hashDbInfoIsNew(hashDbInfo)){ addExistingCentralRepoHashSet(hashDbInfo.getHashSetName(), hashDbInfo.getVersion(), hashDbInfo.getReferenceSetID(), hashDbInfo.getSearchDuringIngest(), hashDbInfo.getSendIngestMessages(), hashDbInfo.getKnownFilesType(), hashDbInfo.isReadOnly()); } } } }

Target:
private void updateHashSetsFromCentralRepository() throws TskCoreException { if(EamDb.isEnabled()){ List<HashDbInfo> crHashDbInfoList = getCentralRepoHashSetsFromDatabase(); for(HashDbInfo hashDbInfo : crHashDbInfoList) { if(hashDbInfoIsNew(hashDbInfo)){ addExistingCentralRepoHashSet(hashDbInfo.getHashSetName(), hashDbInfo.getVersion(), hashDbInfo.getReferenceSetID(), hashDbInfo.getSearchDuringIngest(), hashDbInfo.getSendIngestMessages(), hashDbInfo.getKnownFilesType(), hashDbInfo.isReadOnly()); } } } }
Source:
public Plan plan(Analysis analysis, Stage stage) { PlanNode root = planStatement(analysis, analysis.getStatement()); planSanityChecker.validateIntermediatePlan(root, session, metadata, sqlParser, symbolAllocator.getTypes()); if (stage.ordinal() >= Stage.OPTIMIZED.ordinal()) { for (PlanOptimizer optimizer : planOptimizers) { root = optimizer.optimize(root, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator); requireNonNull(root, format("%s returned a null plan", optimizer.getClass().getName())); } } if (stage.ordinal() >= Stage.OPTIMIZED_AND_VALIDATED.ordinal()) { planSanityChecker.validateFinalPlan(root, session, metadata, sqlParser, symbolAllocator.getTypes()); } return Plan.createPlan(root, symbolAllocator.getTypes(), statsCalculator, costCalculator, session); }

Target:
public Plan plan(Analysis analysis, Stage stage) { PlanNode root = planStatement(analysis, analysis.getStatement()); planSanityChecker.validateIntermediatePlan(root, session, metadata, sqlParser, symbolAllocator.getTypes()); if (stage.ordinal() >= Stage.OPTIMIZED.ordinal()) { for (PlanOptimizer optimizer : planOptimizers) { root = optimizer.optimize(root, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator); requireNonNull(root, format("%s returned a null plan", optimizer.getClass().getName())); } } if (stage.ordinal() >= Stage.OPTIMIZED_AND_VALIDATED.ordinal()) { planSanityChecker.validateFinalPlan(root, session, metadata, sqlParser, symbolAllocator.getTypes()); } TypeProvider types = symbolAllocator.getTypes(); StatsProvider statsProvider = new CachingStatsProvider(statsCalculator, session, types); CostProvider costProvider = new CachingCostProvider(costCalculator, statsProvider, Optional.empty(), session, types); return new Plan(root, types, StatsAndCosts.create(root, statsProvider, costProvider)); }
Source:
public void testGetOrCreateWorkingDir() { File dir = HazelcastStarter.getOrCreateVersionDirectory("3.10-EE"); assertTrue(dir.exists()); HazelcastStarter.getOrCreateVersionDirectory("3.10-EE"); }

Target:
public void testGetOrCreateWorkingDir() { String versionSpec = "3.10-EE-test"; File dir = HazelcastStarter.getOrCreateVersionDirectory(versionSpec); assertTrue("Temporary directory should have been created", dir.exists()); String path = dir.getAbsolutePath(); dir = HazelcastStarter.getOrCreateVersionDirectory(versionSpec); assertEquals(path, dir.getAbsolutePath()); }
Source:
public HybridMobileEngine[] getActiveEnginesFromPlatformsJson(){ try { IFile file = project.getPlatformsJSONFile(); if (file == null) { return new HybridMobileEngine[0]; } List<HybridMobileEngine> activeEngines = new ArrayList<HybridMobileEngine>(); JsonParser parser = new JsonParser(); JsonObject root = parser.parse(new InputStreamReader(file.getContents())).getAsJsonObject(); for (String platform : PlatformConstants.SUPPORTED_PLATFORMS) { if (root.has(platform)) { HybridMobileEngine engine = getHybridMobileEngine(platform, root.get(platform).getAsString()); if (engine != null) { activeEngines.add(engine); } } } return activeEngines.toArray(new HybridMobileEngine[activeEngines.size()]); } catch (JsonIOException e) { HybridCore.log(IStatus.WARNING, "Error reading input stream from platforms.json", e); } catch (JsonSyntaxException e) { HybridCore.log(IStatus.WARNING, "platforms.json has errors", e); } catch (CoreException e) { HybridCore.log(IStatus.WARNING, "Error while opening platforms.json", e); } return new HybridMobileEngine[0]; }

Target:
public HybridMobileEngine[] getActiveEnginesFromPlatformsJson(){ try { IFile file = project.getProject().getFile(PlatformConstants.PLATFORMS_JSON_PATH); if (!file.exists()) { return new HybridMobileEngine[0]; } List<HybridMobileEngine> activeEngines = new ArrayList<HybridMobileEngine>(); JsonParser parser = new JsonParser(); JsonObject root = parser.parse(new InputStreamReader(file.getContents())).getAsJsonObject(); for (PlatformSupport support : HybridCore.getPlatformSupports()) { String platform = support.getPlatformId(); if (root.has(platform)) { HybridMobileEngine engine = getHybridMobileEngine(platform, root.get(platform).getAsString()); if (engine != null) { activeEngines.add(engine); } } } return activeEngines.toArray(new HybridMobileEngine[activeEngines.size()]); } catch (JsonIOException e) { HybridCore.log(IStatus.WARNING, "Error reading input stream from platforms.json", e); } catch (JsonSyntaxException e) { HybridCore.log(IStatus.WARNING, "platforms.json has errors", e); } catch (CoreException e) { HybridCore.log(IStatus.WARNING, "Error while opening platforms.json", e); } return new HybridMobileEngine[0]; }
Source:
protected SerializableTransactionManager() { this(null, null, null, null, null, null, null, null, null, 1, AtlasDbConstants.DEFAULT_TIMESTAMP_CACHE_SIZE); }

Target:
protected SerializableTransactionManager() { this(null, null, null, null, null, null, null, null, null, 1, 1, 1); }
Source:
private void removeMemoryVolumes(String memoryVolume, Guid vmId) { VdcReturnValueBase retVal = getBackend().runInternalAction( VdcActionType.RemoveMemoryVolumes, new RemoveMemoryVolumesParameters(memoryVolume, vmId), ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!retVal.getSucceeded()) { log.errorFormat("Failed to remove memory volumes: {0}", memoryVolume); } }

Target:
private void removeMemoryVolumes(String memoryVolume, Guid vmId) { VdcReturnValueBase retVal = getBackend().runInternalAction( VdcActionType.RemoveMemoryVolumes, new RemoveMemoryVolumesParameters(memoryVolume, vmId)); if (!retVal.getSucceeded()) { log.errorFormat("Failed to remove memory volumes: {0}", memoryVolume); } }
Source:
public static boolean hasLogMessage(ManagementClient managementClient, String handlerName, String logMessage, Predicate<String>... filters) throws Exception { Path logPath = LoggingUtil.getLogPath(managementClient, "file-handler", handlerName); return isMessageInLogFile(logPath, logMessage); }

Target:
public static boolean hasLogMessage(ManagementClient managementClient, String handlerName, String logMessage, Predicate<String>... filters) throws Exception { Path logPath = LoggingUtil.getLogPath(managementClient, "file-handler", handlerName); return isMessageInLogFile(logPath, logMessage, filters); }
Source:
private MojoParameter getPredefined() { return PREDEF.get(NLS.bind("{0}:{1}:{2}", new String[] {plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion()})); }

Target:
private MojoParameter getPredefined() { return PREDEF.get(plugin.getGroupId() + ":" + plugin.getArtifactId() + ":" + plugin.getVersion()); }
Source:
protected void convertOrder( SqlSelect select, Blackboard bb, RelCollation collation, List<SqlNode> orderExprList, SqlNode offset, SqlNode fetch) { boolean keepSort = config.isKeepSortInSubQuery() || bb.top; if (!keepSort || select.getOrderList() == null || select.getOrderList().getList().isEmpty()) { assert !keepSort || collation.getFieldCollations().isEmpty(); if ((offset == null || (offset instanceof SqlLiteral && ((SqlLiteral) offset).bigDecimalValue().equals(BigDecimal.ZERO))) && fetch == null) { return; } } bb.setRoot( LogicalSort.create(bb.root, collation, offset == null ? null : convertExpression(offset), fetch == null ? null : convertExpression(fetch)), false); if (orderExprList.size() > 0 && !bb.top) { final List<RexNode> exprs = new ArrayList<>(); final RelDataType rowType = bb.root.getRowType(); final int fieldCount = rowType.getFieldCount() - orderExprList.size(); for (int i = 0; i < fieldCount; i++) { exprs.add(rexBuilder.makeInputRef(bb.root, i)); } bb.setRoot( LogicalProject.create(bb.root, ImmutableList.of(), exprs, rowType.getFieldNames().subList(0, fieldCount)), false); } }

Target:
protected void convertOrder( SqlSelect select, Blackboard bb, RelCollation collation, List<SqlNode> orderExprList, SqlNode offset, SqlNode fetch) { if (removeSortInSubquery(bb.top) || select.getOrderList() == null || select.getOrderList().getList().isEmpty()) { assert removeSortInSubquery(bb.top) || collation.getFieldCollations().isEmpty(); if ((offset == null || (offset instanceof SqlLiteral && ((SqlLiteral) offset).bigDecimalValue().equals(BigDecimal.ZERO))) && fetch == null) { return; } } bb.setRoot( LogicalSort.create(bb.root, collation, offset == null ? null : convertExpression(offset), fetch == null ? null : convertExpression(fetch)), false); if (orderExprList.size() > 0 && !bb.top) { final List<RexNode> exprs = new ArrayList<>(); final RelDataType rowType = bb.root.getRowType(); final int fieldCount = rowType.getFieldCount() - orderExprList.size(); for (int i = 0; i < fieldCount; i++) { exprs.add(rexBuilder.makeInputRef(bb.root, i)); } bb.setRoot( LogicalProject.create(bb.root, ImmutableList.of(), exprs, rowType.getFieldNames().subList(0, fieldCount)), false); } }
Source:
public void output(LocalDocument doc) { final Action action = doc.getAction(); try { if (action == Action.ADD) { add(doc); } else if (action == Action.DELETE) { delete(doc); } else if (action == Action.UPDATE) { failDocument(doc, new RequiredArgumentMissingException("action UPDATE is not supported. Failing document")); } else{ failDocument(doc, new RequiredArgumentMissingException("action not set in document. This document would never be sent to solr")); } } catch (SolrServerException e) { failDocument(doc, e); } catch (IOException e) { failDocument(doc, e); } catch (RequiredArgumentMissingException e) { failDocument(doc, e); } }

Target:
public void output(LocalDocument doc) { final Action action = doc.getAction(); try { if (action == Action.ADD || action == Action.UPDATE) { add(doc); } else if (action == Action.DELETE) { delete(doc); } else{ failDocument(doc, new RequiredArgumentMissingException("action not set in document. This document would never be sent to solr")); } } catch (SolrServerException e) { failDocument(doc, e); } catch (IOException e) { failDocument(doc, e); } catch (RequiredArgumentMissingException e) { failDocument(doc, e); } }
Source:
public void disconnected(String id, long now) { NodeConnectionState nodeState = nodeState(id); nodeState.lastConnectAttemptMs = now; nodeState.failedAttempts++; nodeState.reconnectBackoffMs = reconnectBackoff.term(nodeState.failedAttempts - 1); if (nodeState.state == ConnectionState.CONNECTING) { nodeState.connectionSetupTimeoutMs = connectionSetupTimeout.term(nodeState.failedAttempts); connectingNodes.remove(id); } else { nodeState.connectionSetupTimeoutMs = connectionSetupTimeout.term(0); } nodeState.state = ConnectionState.DISCONNECTED; }

Target:
public void disconnected(String id, long now) { NodeConnectionState nodeState = nodeState(id); incrementReconnectBackoff(nodeState, now); if (nodeState.state == ConnectionState.CONNECTING) { incrementConnectionSetupTimeout(nodeState); connectingNodes.remove(id); } else { resetConnectionSetupTimeout(nodeState); } nodeState.state = ConnectionState.DISCONNECTED; }
Source:
public CborObject toCbor() { return new CborObject.CborList( Arrays.asList( new CborObject.CborLong(version), parent2meta.toCbor(), parent2data.toCbor(), new CborObject.CborByteArray(properties), retriever == null ? new CborObject.CborNull() : retriever.toCbor(), parentLink == null ? new CborObject.CborNull() : parentLink.toCbor() )); }

Target:
public CborObject toCbor() { return new CborObject.CborList( Arrays.asList( new CborObject.CborLong(getVersionAndType()), parent2meta.toCbor(), parent2data.toCbor(), parentLink == null ? new CborObject.CborNull() : parentLink.toCbor(), new CborObject.CborByteArray(properties), retriever == null ? new CborObject.CborNull() : retriever.toCbor() )); }
Source:
public void destroy() { destroyed = true; setChanged(); notifyObservers(); }

Target:
public void destroy() { if(destroyed) { return; } destroyed = true; setChanged(); notifyObservers(); }
Source:
public void shouldReturnRefundsForPaymentCorrectlyFromLedger() { Account account = new Account(ACCOUNT_ID, TokenPaymentType.CARD); RefundsResponse response = getPaymentRefundsService.getLedgerTransactionTransactions(account, "ch_123abc456xyz"); assertThat(response.getPaymentId(), is("ch_123abc456xyz")); assertThat(response.getLinks().getSelf().getHref(), is("<LINK_0>/refunds")); assertThat(response.getLinks().getPayment().getHref(), is("<LINK_0>")); List<RefundResponse> refunds = response.getEmbedded().getRefunds(); assertThat(refunds.size(), is(2)); assertThat(refunds.get(0).getRefundId(), is("refund-transaction-id1")); assertThat(refunds.get(0).getStatus(), is("success")); assertThat(refunds.get(0).getAmount(), is(1000L)); assertThat(refunds.get(0).getCreatedDate(), is("2018-09-22T10:14:16.067Z")); assertThat(refunds.get(0).getLinks().getPayment().getHref(), is("<LINK_0>")); assertThat(refunds.get(0).getLinks().getSelf().getHref(), is("<LINK_0>/refunds/refund-transaction-id1")); assertThat(refunds.get(1).getRefundId(), is("refund-transaction-id2")); assertThat(refunds.get(1).getStatus(), is("success")); assertThat(refunds.get(1).getAmount(), is(1000L)); assertThat(refunds.get(1).getCreatedDate(), is("2018-09-22T10:16:16.067Z")); assertThat(refunds.get(1).getLinks().getPayment().getHref(), is("<LINK_0>")); assertThat(refunds.get(1).getLinks().getSelf().getHref(), is("<LINK_0>/refunds/refund-transaction-id2")); }

Target:
public void shouldReturnRefundsForPaymentCorrectlyFromLedger() { Account account = new Account(ACCOUNT_ID, TokenPaymentType.CARD); RefundsResponse response = getPaymentRefundsService.getLedgerTransactionTransactions(account, "ch_123abc456xyz"); assertThat(response.getPaymentId(), is("ch_123abc456xyz")); assertThat(response.getLinks().getSelf().getHref(), is("<LINK_0>/refunds")); assertThat(response.getLinks().getPayment().getHref(), is("<LINK_0>")); List<RefundResponse> refunds = response.getEmbedded().getRefunds(); assertThat(refunds.size(), is(2)); assertThat(refunds.get(0).getRefundId(), is("refund-transaction-id1")); assertThat(refunds.get(0).getStatus(), is("submitted")); assertThat(refunds.get(0).getAmount(), is(100L)); assertThat(refunds.get(0).getCreatedDate(), is("2018-09-22T10:14:16.067Z")); assertThat(refunds.get(0).getLinks().getPayment().getHref(), is("<LINK_0>")); assertThat(refunds.get(0).getLinks().getSelf().getHref(), is("<LINK_0>/refunds/refund-transaction-id1")); assertThat(refunds.get(1).getRefundId(), is("refund-transaction-id2")); assertThat(refunds.get(1).getStatus(), is("error")); assertThat(refunds.get(1).getAmount(), is(200L)); assertThat(refunds.get(1).getCreatedDate(), is("2018-09-22T10:16:16.067Z")); assertThat(refunds.get(1).getLinks().getPayment().getHref(), is("<LINK_0>")); assertThat(refunds.get(1).getLinks().getSelf().getHref(), is("<LINK_0>/refunds/refund-transaction-id2")); }
Source:
public UserPlugin(IUserDecoder decoder) { this.decoder = decoder; }

Target:
protected UserPlugin(IUserDecoder decoder) { this.decoder = decoder; }
Source:
public void save(Session session) throws IOException { log.debug("Persisting session: " + session.getId()); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); if (!(session instanceof StandardSession)) { throw new IOException("The session must be an instance of StandardSession to be serialized"); } ((StandardSession)session).writeObjectData(oos); oos.flush(); Entity sessionEntity = Entity.newBuilder(keyFactory.newKey(session.getId())) .set("content", Blob.copyFrom(bos.toByteArray())) .build(); datastore.put(sessionEntity); }

Target:
public void save(Session session) throws IOException { log.debug("Persisting session: " + session.getId()); ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(bos)) { if (!(session instanceof StandardSession)) { throw new IOException( "The session must be an instance of StandardSession to be serialized"); } ((StandardSession) session).writeObjectData(oos); } Entity sessionEntity = Entity.newBuilder(keyFactory.newKey(session.getId())) .set("content", Blob.copyFrom(bos.toByteArray())) .set("lastAccess", session.getLastAccessedTime()) .build(); datastore.put(sessionEntity); }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); boolean isCreatorOnly = true; new GateKeeper().verifyAccessible( instructor, session, isCreatorOnly); if(session.isPublished()){ try { logic.unpublishFeedbackSession(feedbackSessionName, courseId); } catch (InvalidParametersException e) { Assumption.fail("InvalidParametersException not expected at this point"); } statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED); statusToAdmin = "Evaluation <span class=\"bold\">(" + feedbackSessionName + ")</span> " + "for Course <span class=\"bold\">[" + courseId + "]</span> unpublished."; } else { isError = true; statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED_ALREADY); statusToAdmin = "Evaluation <span class=\"bold\">(" + feedbackSessionName + ")</span> " + "for Course <span class=\"bold\">[" + courseId + "]</span> unpublished for more than one time."; } return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertNotNull(Const.StatusCodes.NULL_PARAMETER, courseId); Assumption.assertNotNull(Const.StatusCodes.NULL_PARAMETER, feedbackSessionName); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); boolean isCreatorOnly = true; new GateKeeper().verifyAccessible( instructor, session, isCreatorOnly); try { logic.unpublishFeedbackSession(feedbackSessionName, courseId); statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED); statusToAdmin = "Feedback Session <span class=\"bold\">(" + feedbackSessionName + ")</span> " + "for Course <span class=\"bold\">[" + courseId + "]</span> unpublished."; } catch (InvalidParametersException e) { setStatusForException(e); } return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE); }
Source:
protected ByteBuffer readBuffer() { IntBuffer idBuffer = ByteBuffer.allocateDirect(4).asIntBuffer(); idBuffer.clear(); idBuffer.put(0, Integer.reverseBytes(messageID)); ByteBuffer timestamp = ByteBuffer.allocate(4); ByteBuffer response = null; long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < 5) { try { response = CANJNI.FRCNetCommCANSessionMuxReceiveMessage(idBuffer, 0x0fffffff, timestamp); break; } catch (CANMessageNotFoundException e) } return response; }

Target:
protected ByteBuffer readBuffer() { IntBuffer idBuffer = ByteBuffer.allocateDirect(4).asIntBuffer(); idBuffer.clear(); idBuffer.put(0, Integer.reverseBytes(messageID)); ByteBuffer timestamp = ByteBuffer.allocate(4); ByteBuffer response = null; long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < CustomCAN.CAN_MAX_READ_WAIT) { try { response = CANJNI.FRCNetCommCANSessionMuxReceiveMessage(idBuffer, 0x1fffffff, timestamp); break; } catch (CANMessageNotFoundException e) } return response; }
Source:
public Object[] toArray() { Object[] array = new Object[totalCount()]; int i = 0; for (List<TileEntity> values : content.values()) { for (int j = 0; j < values.size(); j++) { array[i] = values.get(j); i++; } } return array; }

Target:
public Object[] toArray() { Object[] array = new Object[totalCount]; int i = 0; for (List<TileEntity> values : content.values()) { for (int j = 0; j < values.size(); j++) { array[i] = values.get(j); i++; } } return array; }
Source:
public void testMultimapContainerSize() { assertSize(0); multiMap.put(key, "value1"); sleepMillis(10); assertSize(1); multiMap.put(key, "value2"); multiMap.put(key, "value3"); sleepMillis(10); assertSize(3); multiMap.remove(key, "value1"); sleepMillis(10); assertSize(2); multiMap.remove(key, "invalid_value"); sleepMillis(10); assertSize(2); multiMap.lock(key); multiMap.clear(); sleepMillis(10); assertSize(2); multiMap.unlock(key); multiMap.clear(); sleepMillis(10); assertSize(0); }

Target:
public void testMultimapContainerSize() { assertSize(0); multiMap.put(key, "value1"); assertSize(1); multiMap.put(key, "value2"); multiMap.put(key, "value3"); assertSize(3); multiMap.remove(key, "value1"); assertSize(2); multiMap.remove(key, "invalid_value"); assertSize(2); multiMap.lock(key); multiMap.clear(); assertSize(2); multiMap.unlock(key); multiMap.clear(); assertSize(0); }
Source:
public void testGetValidityInfoForSizeCappedNonEmptyString() { String typicalFieldName = "my field"; int typicalLength = 25; try { validator.getValidityInfoForSizeCappedNonEmptyString(typicalFieldName, typicalLength, null); signalFailureToDetectException("not expected to be null"); } catch (AssertionError e) { ignoreExpectedException(); } int maxLength = 50; assertEquals("valid: typical value", "", validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, "Dr. Amy-B s/o O'br, & 2nd \t \n (alias 'JB')")); assertEquals("valid: max length", "", validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, StringHelper.generateStringOfLength(maxLength))); String tooLongName = StringHelper.generateStringOfLength(maxLength+1); assertEquals("invalid: too long", String.format( SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, tooLongName, typicalFieldName, REASON_TOO_LONG, typicalFieldName, maxLength), validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, tooLongName)); String emptyValue = ""; assertEquals("invalid: empty", String.format( SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, emptyValue, typicalFieldName, REASON_EMPTY, typicalFieldName, maxLength), validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, emptyValue)); String untrimmedValue = " abc "; assertEquals("invalid: untrimmed","", validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, untrimmedValue)); }

Target:
public void testGetValidityInfoForSizeCappedNonEmptyString() { String typicalFieldName = "my field"; int typicalLength = 25; try { validator.getValidityInfoForSizeCappedNonEmptyString(typicalFieldName, typicalLength, null); signalFailureToDetectException("not expected to be null"); } catch (AssertionError e) { ignoreExpectedException(); } int maxLength = 50; assertEquals("valid: typical value", "", validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, "Dr. Amy-B s/o O'br, & 2nd \t \n (alias 'JB')")); assertEquals("valid: max length", "", validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, StringHelper.generateStringOfLength(maxLength))); String tooLongName = StringHelper.generateStringOfLength(maxLength+1); assertEquals("invalid: too long", String.format( SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, tooLongName, typicalFieldName, REASON_TOO_LONG, typicalFieldName, maxLength), validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, tooLongName)); String emptyValue = ""; assertEquals("invalid: empty", String.format( SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, emptyValue, typicalFieldName, REASON_EMPTY, typicalFieldName, maxLength), validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, emptyValue)); String untrimmedValue = " abc "; assertEquals("invalid: untrimmed", String.format(WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE, typicalFieldName), validator.getValidityInfoForSizeCappedNonEmptyString( typicalFieldName, maxLength, untrimmedValue)); }
Source:
protected String getFingerprint(String hostName) { try { connect(hostName); return getFingerprint(); } finally { disconnect(); } }

Target:
protected String getFingerprint(String hostName) { SSHClient client = null; try { client = connect(hostName); return getFingerprint(client); } finally { if(client != null) { client.disconnect(); } } }
Source:
default boolean isCallIdHeader() { final Buffer m = getName(); try { if (m.getReadableBytes() == 7) { return (m.getByte(0) == 'C' || m.getByte(0) == 'c') && (m.getByte(1) == 'A' || m.getByte(1) == 'a') && (m.getByte(2) == 'L' || m.getByte(2) == 'l') && (m.getByte(3) == 'L' || m.getByte(3) == 'l') && m.getByte(4) == '-' && (m.getByte(5) == 'I' || m.getByte(5) == 'd') && (m.getByte(6) == 'D' || m.getByte(6) == 'd'); } else if (m.getReadableBytes() == 1) { return (m.getByte(0) == 'I' || m.getByte(0) == 'i'); } } catch (final IOException e) { throw new SipParseException(0, UNABLE_TO_PARSE_OUT_THE_HEADER_NAME_DUE_TO_UNDERLYING_IO_EXCEPTION, e); } return false; }

Target:
default boolean isCallIdHeader() { final Buffer m = getName(); try { if (m.getReadableBytes() == 7) { return (m.getByte(0) == 'C' || m.getByte(0) == 'c') && (m.getByte(1) == 'A' || m.getByte(1) == 'a') && (m.getByte(2) == 'L' || m.getByte(2) == 'l') && (m.getByte(3) == 'L' || m.getByte(3) == 'l') && m.getByte(4) == '-' && (m.getByte(5) == 'I' || m.getByte(5) == 'i') && (m.getByte(6) == 'D' || m.getByte(6) == 'd'); } else if (m.getReadableBytes() == 1) { return (m.getByte(0) == 'I' || m.getByte(0) == 'i'); } } catch (final IOException e) { throw new SipParseException(0, UNABLE_TO_PARSE_OUT_THE_HEADER_NAME_DUE_TO_UNDERLYING_IO_EXCEPTION, e); } return false; }
Source:
private void rtCall(String[] args, File vagrantDir, Map<String, String> environment) { final String EXTERNAL_TOOLS = "org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"; final String UI_PLUGIN_ID = "org.eclipse.ui.externaltools"; final String ATTR_LOCATION = UI_PLUGIN_ID + ".ATTR_LOCATION"; final String ATTR_TOOL_ARGUMENTS = UI_PLUGIN_ID + ".ATTR_TOOL_ARGUMENTS"; final String ATTR_WORKING_DIRECTORY = UI_PLUGIN_ID + ".ATTR_WORKING_DIRECTORY"; final String ENVIRONMENT_VARS_KEY = "org.eclipse.debug.core.environmentVariables"; String arguments = Arrays.asList(args).stream().map(u -> u.toString()) .collect(Collectors.joining(" ")); ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType type = manager.getLaunchConfigurationType(EXTERNAL_TOOLS); try { String vagrantPath = findVagrantPath(); ILaunchConfigurationWorkingCopy wc = type.newInstance(null, VG); wc.setAttribute(ATTR_LOCATION, vagrantPath); wc.setAttribute(ATTR_TOOL_ARGUMENTS, arguments); wc.setAttribute(ATTR_WORKING_DIRECTORY, vagrantDir.getAbsolutePath()); wc.setAttribute(ENVIRONMENT_VARS_KEY, environment); wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); } catch (CoreException e1) { Activator.log(e1); } }

Target:
private void rtCall(String[] args, File vagrantDir, Map<String, String> environment) { final String EXTERNAL_TOOLS = "org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"; final String UI_PLUGIN_ID = "org.eclipse.ui.externaltools"; final String ATTR_LOCATION = UI_PLUGIN_ID + ".ATTR_LOCATION"; final String ATTR_TOOL_ARGUMENTS = UI_PLUGIN_ID + ".ATTR_TOOL_ARGUMENTS"; final String ATTR_WORKING_DIRECTORY = UI_PLUGIN_ID + ".ATTR_WORKING_DIRECTORY"; String arguments = Arrays.asList(args).stream().map(u -> u.toString()) .collect(Collectors.joining(" ")); ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType type = manager.getLaunchConfigurationType(EXTERNAL_TOOLS); try { String vagrantPath = findVagrantPath(); ILaunchConfigurationWorkingCopy wc = type.newInstance(null, VG); wc.setAttribute(ATTR_LOCATION, vagrantPath); wc.setAttribute(ATTR_TOOL_ARGUMENTS, arguments); wc.setAttribute(ATTR_WORKING_DIRECTORY, vagrantDir.getAbsolutePath()); wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, environment); wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); } catch (CoreException e1) { Activator.log(e1); } }
Source:
public void runTest() { boolean hasRX = false; boolean isDuplex = false; for (final String argument : this.getArgs()) { if (argument.startsWith(getArgumentName())) { hasRX = true; break; } if (argument.startsWith("DUPLEX_UMI")) { isDuplex = true; break; } } if (!hasRX && !isDuplex) addArg(getArgumentName() + "=" + getTagValue()); super.runTest(); }

Target:
public void runTest() { boolean hasRX = false; boolean isDuplex = false; for (final String argument : this.getArgs()) { if (argument.startsWith(getArgumentName())) { hasRX = true; break; } if (argument.startsWith("DUPLEX_UMI")) { isDuplex = true; break; } } if (!hasRX && !isDuplex) { addArg(getArgumentName() + "=" + getTagValue()); } super.runTest(); }
Source:
public NonblockingConsumersSupervisor(ConfigFactory configFactory, ConsumersExecutorService executor, ConsumerFactory consumerFactory, OffsetQueue offsetQueue, Retransmitter retransmitter, UndeliveredMessageLogPersister undeliveredMessageLogPersister, SubscriptionRepository subscriptionRepository, HermesMetrics metrics, ConsumerMonitor monitor, Clock clock) { this.undeliveredMessageLogPersister = undeliveredMessageLogPersister; this.subscriptionRepository = subscriptionRepository; this.configs = configFactory; this.backgroundProcess = new ConsumerProcessSupervisor(executor, retransmitter, clock, metrics, configFactory, consumerFactory); this.scheduledExecutor = createExecutorForSupervision(); this.offsetCommitter = new OffsetCommitter( offsetQueue, (offsets) -> offsets.subscriptionNames().forEach(subscription -> backgroundProcess.accept(Signal.of(COMMIT, subscription, offsets.batchFor(subscription))) ), configFactory.getIntProperty(Configs.CONSUMER_COMMIT_OFFSET_PERIOD), metrics ); monitor.register(SUBSCRIPTIONS, backgroundProcess::runningSubscriptionsStatus); monitor.register(SUBSCRIPTIONS_COUNT, backgroundProcess::countRunningProcesses); }

Target:
public NonblockingConsumersSupervisor(ConfigFactory configFactory, ConsumersExecutorService executor, ConsumerFactory consumerFactory, OffsetQueue offsetQueue, Retransmitter retransmitter, UndeliveredMessageLogPersister undeliveredMessageLogPersister, SubscriptionRepository subscriptionRepository, HermesMetrics metrics, ConsumerMonitor monitor, Clock clock) { this.undeliveredMessageLogPersister = undeliveredMessageLogPersister; this.subscriptionRepository = subscriptionRepository; this.configs = configFactory; this.backgroundProcess = new ConsumerProcessSupervisor(executor, clock, metrics, configFactory, new ConsumerProcessFactory(retransmitter, consumerFactory, configs, clock)); this.scheduledExecutor = createExecutorForSupervision(); this.offsetCommitter = new OffsetCommitter( offsetQueue, (offsets) -> offsets.subscriptionNames().forEach(subscription -> backgroundProcess.accept(Signal.of(COMMIT, subscription, offsets.batchFor(subscription))) ), configFactory.getIntProperty(Configs.CONSUMER_COMMIT_OFFSET_PERIOD), metrics ); monitor.register(SUBSCRIPTIONS, backgroundProcess::runningSubscriptionsStatus); monitor.register(SUBSCRIPTIONS_COUNT, backgroundProcess::countRunningProcesses); }
Source:
private void createEmptyDecisionTable( final Path contextPath, final String baseFileName) { final GuidedDecisionTable52 model = new GuidedDecisionTable52(); model.setTableFormat( options.getTableFormat() ); model.setHitPolicy( options.getHitPolicy() ); model.setTableName( baseFileName ); final RemoteCallback<Path> onSaveSuccessCallback = getSuccessCallback( newResourcePresenter ); busyIndicatorView.showBusyIndicator( CommonConstants.INSTANCE.Saving() ); service.call( ( Path path ) -> { busyIndicatorView.hideBusyIndicator(); onSaveSuccessCallback.callback( path ); }, new HasBusyIndicatorDefaultErrorCallback( busyIndicatorView ) ).create( contextPath, buildFileName( baseFileName, resourceType ), model, "" ); }

Target:
private void createEmptyDecisionTable( final Path contextPath, final String baseFileName ) { final GuidedDecisionTable52 model = new GuidedDecisionTable52(); model.setTableFormat( options.getTableFormat() ); model.setHitPolicy( options.getHitPolicy() ); if(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT.equals( options.getHitPolicy() )) { final MetadataCol52 metadataCol52 = new MetadataCol52(); metadataCol52.setMetadata( GuidedDecisionTable52.HitPolicy.RESOLVED_HIT_METADATA_NAME ); model.getMetadataCols().add( metadataCol52 ); } model.setTableName( baseFileName ); final RemoteCallback<Path> onSaveSuccessCallback = getSuccessCallback( newResourcePresenter ); busyIndicatorView.showBusyIndicator( CommonConstants.INSTANCE.Saving() ); service.call( ( Path path ) -> { busyIndicatorView.hideBusyIndicator(); onSaveSuccessCallback.callback( path ); }, new HasBusyIndicatorDefaultErrorCallback( busyIndicatorView ) ).create( contextPath, buildFileName( baseFileName, resourceType ), model, "" ); }