auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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; } } } <START> if (result == null && validNetworkInterfaces.size() > 0) { <END> result = validNetworkInterfaces.get(0); } return result; }</code><technical_language>is !validNetworkInterfaces.isEmpty() instead of validNetworkInterfaces.size() > 0</technical_language>

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:
<code>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) { <START> checkState(left.totalLifespans == right.totalLifespans); <END> 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()); } }</code><technical_language>nit: Add a message in case fails (e.g.: including left right actual lifespans)</technical_language>

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:
<code>public String toString() { <START> final StringBuffer sb = new StringBuffer("FileTailerState{"); <END> 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(); }</code><technical_language>StringBuilder ToStringHelper</technical_language>

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:
<code>private String getInternalIpAddress() { <START> 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!"); <END> }</code><technical_language>suggestion return getContainerInfo().getNetworkSettings().getNetworks().values().stream() .map(ContainerNetwork::getIpAddress) .findFirst() .orElseThrow(() -> new IllegalStateException("No network extract internal IP from!")); if better, reading, I stumbled for-loop for element</technical_language>

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:
<code>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; <START> List<Throwable> throwables = multiCacheException.getThrowables(); <END> ListIterator<Throwable> listIterator = throwables.listIterator(throwables.size()); while (listIterator.hasPrevious()) { throwables.add(0, listIterator.previous()); } } throwables.add(0, t); return this; }</code><technical_language>hiding instance variable here... means of code right thing... right</technical_language>

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:
<code>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); <START> List<Map.Entry<K, V>> erroneousElements = actual.entrySet().stream() <END> .map(entry -> failsRestrictions(entry, entryRequirements)) .filter(Optional::isPresent) .map(Optional::get) .collect(toList()); if (erroneousElements.size() > 0) throw failures.failure(info, noElementsShouldSatisfy(actual, erroneousElements)); }</code><technical_language>rename erroneousEntries ;-)</technical_language>

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:
<code>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()) { <START> throw new WrongAttributeValueException(attribute, resource.getName() + " has attribute whose value is not valid"); <END> } } }</code><technical_language>Add example of valid res:RESOURCE[:CHILD-RESOURCE1][:CHILD-RESOURCE2]...[:act:ACTION[,ACTION]...]</technical_language>

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:
<code>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); <START> keyAsyncClient.importKey(importKeyOptions).subscribe(keyResponse -> <END> 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 }</code><technical_language>importKeyWithResponse here</technical_language>

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:
<code>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()); <START> sb.append(hotspotSummary.substring(1)); <END> return sb.toString(); }</code><technical_language>StringUtils.uncapitalize("Your words")</technical_language>

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:
<code>public void impl(@Nonnull CorfuRuntime runtime) throws OutrankedException, ExecutionException, InterruptedException { Layout layout; do { <START> runtime.invalidateLayout(); <END> 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); }</code><technical_language>is this line for</technical_language>

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:
<code>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()); } } } <START> } <END></code><technical_language>I noticed this method is called of UI classes, I class controlling behavior of another class, asking for some service, I tend if implementation details leaked API. HashDbManager refresh view of CR hash sets is queried for hash sets? error-prone for clients of HashDbManager (they need remember call this method) reduce scope of class API (always shooting for minimal sufficient). Thoughts</technical_language>

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:
<code>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()); } <START> return Plan.createPlan(root, symbolAllocator.getTypes(), statsCalculator, costCalculator, session); <END> }</code><technical_language>Inline createPlan, move here</technical_language>

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:
<code>public void testGetOrCreateWorkingDir() { File dir = HazelcastStarter.getOrCreateVersionDirectory("3.10-EE"); <START> assertTrue(dir.exists()); <END> HazelcastStarter.getOrCreateVersionDirectory("3.10-EE"); }</code><technical_language>assertTrue() assertion message (otherwise failures hard read)</technical_language>

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:
<code>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(); <START> for (String platform : PlatformConstants.SUPPORTED_PLATFORMS) { <END> 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]; }</code><technical_language>Supported platforms is pluggable. _org.eclipse.thym.core.HybridCore.getPlatformSupports()_ discover supported platforms moment</technical_language>

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:
<code>protected SerializableTransactionManager() { <START> this(null, null, null, null, null, null, null, null, null, 1, AtlasDbConstants.DEFAULT_TIMESTAMP_CACHE_SIZE); <END> }</code><technical_language>reason maintain a large cache for dummy transaction manager. do this(null, null, null, null, null, null, null, null, null, 1, 1);</technical_language>

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

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:
<code><START> public static boolean hasLogMessage(ManagementClient managementClient, String handlerName, String logMessage, Predicate<String>... filters) throws Exception { <END> Path logPath = LoggingUtil.getLogPath(managementClient, "file-handler", handlerName); return isMessageInLogFile(logPath, logMessage); }</code><technical_language>filters method argument passed isMessageInLogFile argument</technical_language>

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:
<code>private MojoParameter getPredefined() { <START> return PREDEF.get(NLS.bind("{0}:{1}:{2}", <END> new String[] {plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion()})); }</code><technical_language>of NLS.bind is here. String.format if prefer printf-like syntax concatenate strings + operator</technical_language>

Target:
private MojoParameter getPredefined() { return PREDEF.get(plugin.getGroupId() + ":" + plugin.getArtifactId() + ":" + plugin.getVersion()); }
Source:
<code>protected void convertOrder( SqlSelect select, Blackboard bb, RelCollation collation, List<SqlNode> orderExprList, SqlNode offset, SqlNode fetch) { boolean keepSort = config.isKeepSortInSubQuery() || bb.top; <START> if (!keepSort <END> || 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); } }</code><technical_language>abstract common logic config.isKeepSortInSubQuery() || bb.top a method ? java /** * Returns sort for subsequent query conversion. * * @param topQuery query is in top level. */ boolean keepSortInSubQuery(boolean topQuery) { return config.isKeepSortInSubQuery() || topQuery; }</technical_language>

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:
<code>public void output(LocalDocument doc) { final Action action = doc.getAction(); try { if (action == Action.ADD) { add(doc); } else if (action == Action.DELETE) { delete(doc); <START> } else if (action == Action.UPDATE) { <END> 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); } }</code><technical_language>I for Solr Action.UPDATE Action.ADD same. In fact, if Solr, UpdateRequestHandler, AddRequestHandler, Action.UPDATE supported operation, if ;)</technical_language>

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:
<code>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) { <START> nodeState.connectionSetupTimeoutMs = connectionSetupTimeout.term(nodeState.failedAttempts); <END> connectingNodes.remove(id); } else { nodeState.connectionSetupTimeoutMs = connectionSetupTimeout.term(0); } nodeState.state = ConnectionState.DISCONNECTED; }</code><technical_language>failedAttempts number of failed connections, setting timeout to</technical_language>

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:
<code>public CborObject toCbor() { return new CborObject.CborList( Arrays.asList( <START> new CborObject.CborLong(version), <END> parent2meta.toCbor(), parent2data.toCbor(), new CborObject.CborByteArray(properties), retriever == null ? new CborObject.CborNull() : retriever.toCbor(), parentLink == null ? new CborObject.CborNull() : parentLink.toCbor() )); }</code><technical_language>I a CborLong is 32-bits long</technical_language>

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:
<code>public void destroy() { <START> destroyed = true; <END> setChanged(); notifyObservers(); }</code><technical_language>return if destroyed</technical_language>

Target:
public void destroy() { if(destroyed) { return; } destroyed = true; setChanged(); notifyObservers(); }
Source:
<code>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")); <START> assertThat(refunds.get(1).getStatus(), is("success")); <END> 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")); }</code><technical_language>good unsuccessful well</technical_language>

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:
<code><START> public UserPlugin(IUserDecoder decoder) { <END> this.decoder = decoder; }</code><technical_language>protected? package private for tests only</technical_language>

Target:
protected UserPlugin(IUserDecoder decoder) { this.decoder = decoder; }
Source:
<code>public void save(Session session) throws IOException { log.debug("Persisting session: " + session.getId()); <START> ByteArrayOutputStream bos = new ByteArrayOutputStream(); <END> 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); }</code><technical_language>Do need close streams done them? I this a potential memory leak</technical_language>

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:
<code>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()){ <START> try { <END> 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); }</code><technical_language>Logic detect error conditions (e.g. Unpublished) throw correct exception. here, simply catch exception set status message. need duplicate check here</technical_language>

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:
<code>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(); <START> while (System.currentTimeMillis() - start < 5) { <END> try { response = CANJNI.FRCNetCommCANSessionMuxReceiveMessage(idBuffer, 0x0fffffff, timestamp); break; } catch (CANMessageNotFoundException e) } return response; }</code><technical_language>this a constant field instead of a magic number</technical_language>

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:
<code>public Object[] toArray() { Object[] array = new Object[totalCount()]; int i = 0; for (List<TileEntity> values : content.values()) { <START> for (int j = 0; j < values.size(); j++) { <END> array[i] = values.get(j); i++; } } return array; }</code><technical_language>java for (TileEntity te : values) array[i++] = te;</technical_language>

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:
<code>public void testMultimapContainerSize() { assertSize(0); multiMap.put(key, "value1"); sleepMillis(10); assertSize(1); multiMap.put(key, "value2"); multiMap.put(key, "value3"); <START> sleepMillis(10); <END> 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); }</code><technical_language>is added of sleep? put completes, size set correctly</technical_language>

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:
<code>protected String getFingerprint(String hostName) { try { <START> connect(hostName); <END> return getFingerprint(); } finally { disconnect(); } }</code><technical_language>connect a server change state of this object. change state of this object is unexpected, authenticate approval of user do so. I unsure of method of wrap object method method, code more complex produce some unexpected results</technical_language>

Target:
protected String getFingerprint(String hostName) { SSHClient client = null; try { client = connect(hostName); return getFingerprint(client); } finally { if(client != null) { client.disconnect(); } } }
Source:
<code>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) == '-' && <START> (m.getByte(5) == 'I' || m.getByte(5) == 'd') && <END> (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; }</code><technical_language>'i'</technical_language>

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:
<code>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()); <START> wc.setAttribute(ENVIRONMENT_VARS_KEY, environment); <END> wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); } catch (CoreException e1) { Activator.log(e1); } }</code><technical_language>I 'ILaunchManager.ATTR_ENVIRONMENT_VARIABLES' is API in this case</technical_language>

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:
<code>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; } } <START> if (!hasRX && !isDuplex) addArg(getArgumentName() + "=" + getTagValue()); <END> super.runTest(); }</code><technical_language>add braces</technical_language>

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:
<code>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); <START> <END> }</code><technical_language>I added a gauge ConsumerProcessSupervisor</technical_language>

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:
<code>private void createEmptyDecisionTable( final Path contextPath, <START> final String baseFileName) { <END> 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, "" ); }</code><technical_language>minor formatting issue</technical_language>

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, "" ); }