auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void prepareDataForEpoch() { listOfTrainingDataKeys.clear(); final List<K> keys = new ArrayList<>(memoryStore.getAll().keySet()); final int sizeOfTrainingDataKeys = keys.size() / numMiniBatchesPerEpoch; final int extraDataSize = keys.size() % numMiniBatchesPerEpoch; int consumedDataCount = 0; for (int i = 0; i < numMiniBatchesPerEpoch; i++) { final int miniBatchSize = i < extraDataSize ? sizeOfTrainingDataKeys + 1 : sizeOfTrainingDataKeys; final List<K> trainingData = keys.subList(consumedDataCount, consumedDataCount + miniBatchSize); listOfTrainingDataKeys.add(trainingData); consumedDataCount += miniBatchSize; } trainingDataKeysIterator = listOfTrainingDataKeys.iterator(); }

Target:
void prepareDataForEpoch() { final List<K> keys = new ArrayList<>(memoryStore.getAll().keySet()); final int numMiniBatches = (int) Math.ceil((double) keys.size() / miniBatchSize); final List<List<K>> keysList = new ArrayList<>(numMiniBatches); final int remainderForLastMiniBatch = keys.size() % miniBatchSize; final int numInstancesForLastMiniBatch = remainderForLastMiniBatch == 0 ? miniBatchSize : remainderForLastMiniBatch; int numKeysCounted = 0; int numKeysToCount = miniBatchSize; for (int miniBatchIdx = 0; miniBatchIdx < numMiniBatches; miniBatchIdx++) { if (miniBatchIdx == numMiniBatches - 1) { numKeysToCount = numInstancesForLastMiniBatch; } final List<K> trainingData = keys.subList(numKeysCounted, numKeysCounted + numKeysToCount); numKeysCounted += numKeysToCount; keysList.add(trainingData); } trainingDataKeysIterator = keysList.iterator(); }
Source:
public void visitNode(Tree tree) { if (tree.is(Tree.Kind.METHOD_INVOCATION)) { MethodInvocationTree mit = (MethodInvocationTree) tree; if(EQUALS_MATCHER.matches(mit)) { if(mit.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { ExpressionTree leftOp = ((MemberSelectExpressionTree) mit.methodSelect()).expression(); ExpressionTree rightOp = mit.arguments().get(0); if(SyntacticEquivalence.areEquivalent(leftOp, rightOp)) { reportIssue( rightOp, "Identical sub-expressions on both sides of equals.", ImmutableList.of(new JavaFileScannerContext.Location("", leftOp)), null); } } } else if (DEEP_EQUALS_MATCHER.matches(mit) || OBJECTS_EQUALS_MATCHER.matches(mit)) { ExpressionTree leftOp = mit.arguments().get(0); ExpressionTree rightOp = mit.arguments().get(1); if(SyntacticEquivalence.areEquivalent(leftOp, rightOp)) { reportIssue( rightOp, "Both arguments are identical sub-expressions.", ImmutableList.of(new JavaFileScannerContext.Location("", leftOp)), null); } } return; } BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) tree; ExpressionTree rightOperand = binaryExpressionTree.rightOperand(); ExpressionTree equivalentOperand = equivalentOperand(binaryExpressionTree, rightOperand); if (equivalentOperand != null) { reportIssue( rightOperand, "Correct one of the identical sub-expressions on both sides of operator \"" + binaryExpressionTree.operatorToken().text() + "\"", ImmutableList.of(new JavaFileScannerContext.Location("", equivalentOperand)), null); } }

Target:
public void visitNode(Tree tree) { if (tree.is(Tree.Kind.METHOD_INVOCATION)) { MethodInvocationTree mit = (MethodInvocationTree) tree; checkEqualsMethods(mit); return; } BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) tree; ExpressionTree rightOperand = binaryExpressionTree.rightOperand(); ExpressionTree equivalentOperand = equivalentOperand(binaryExpressionTree, rightOperand); if (equivalentOperand != null) { reportIssue( rightOperand, "Correct one of the identical sub-expressions on both sides of operator \"" + binaryExpressionTree.operatorToken().text() + "\"", ImmutableList.of(new JavaFileScannerContext.Location("", equivalentOperand)), null); } }
Source:
public void addString(String string, float x, float y, Font font) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); x = DPIUtil.autoScaleUp(x); y = DPIUtil.autoScaleUp(y); FontData fd = font.getFontData()[0]; Font scaledFont = new Font(font.getDevice(), fd.getName(), DPIUtil.autoScaleUp(fd.getHeight()), fd.getStyle()); addStringInPixels(string, x, y, scaledFont); scaledFont.dispose(); }

Target:
public void addString(String string, float x, float y, Font font) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); x = DPIUtil.autoScaleUp(x); y = DPIUtil.autoScaleUp(y); FontData fd = font.getFontData()[0]; fd.setHeight(DPIUtil.autoScaleUp(fd.getHeight())); Font scaledFont = new Font(font.getDevice(), fd); addStringInPixels(string, x, y, scaledFont); scaledFont.dispose(); }
Source:
public static synchronized void removeFromCache(String key){ if (key != null){ attestationValues.remove(key); } }

Target:
public void removeFromCache(String key) { if (key != null) { attestationValues.remove(key); } }
Source:
protected CompletableFuture<List<SimpleEntry<String, String>>> processInternal() { CPSubsystemManagementService cpService = nodeEngine.getHazelcastInstance().getCPSubsystem().getCPSubsystemManagementService(); return cpService.getCPMembers().toCompletableFuture() .thenApply(cpMembers -> { List<SimpleEntry<String, String>> result = new ArrayList<>(); for (CPMember cpMember : cpMembers) { String address = "[" + cpMember.getAddress().getHost() + "]:" + cpMember.getAddress().getPort(); result.add(new SimpleEntry<>(cpMember.getUuid().toString(), address)); } return result; }); }

Target:
protected CompletableFuture<List<SimpleEntry<UUID, Address>>> processInternal() { CPSubsystemManagementService cpService = nodeEngine.getHazelcastInstance().getCPSubsystem().getCPSubsystemManagementService(); return cpService.getCPMembers().toCompletableFuture() .thenApply(cpMembers -> { List<SimpleEntry<UUID, Address>> result = new ArrayList<>(cpMembers.size()); for (CPMember cpMember : cpMembers) { result.add(new SimpleEntry<>(cpMember.getUuid(), cpMember.getAddress())); } return result; }); }
Source:
private boolean allBranchOperationsSucceeded( final @NonNull Map<Repository, CheckoutResult> results) { return results.entrySet().stream() .map(Map.Entry::getValue) .allMatch(r -> r.getStatus() == CheckoutResult.Status.OK); }

Target:
private boolean allBranchOperationsSucceeded( final @NonNull Map<Repository, CheckoutResult> results) { return results.values().stream() .allMatch(r -> r.getStatus() == CheckoutResult.Status.OK); }
Source:
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingMetadata.TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of()); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(JoinNode.DistributionType.PARTITIONED)), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol))); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of()); }

Target:
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of()); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(JoinNode.DistributionType.PARTITIONED)), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol))); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of()); }
Source:
public synchronized void start(StartContext context) throws StartException { final String deploymentName = deploymentUnit.getParent() == null ? deploymentUnit.getName() : deploymentUnit.getParent().getName() + "." + deploymentUnit.getName(); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ClassLoader classLoader = module.getClassLoader(); ApplicationSecurityDomain applicationSecurityDomain = this.applicationSecurityDomain.getOptionalValue(); if (applicationSecurityDomain != null) { BiFunction<String, ClassLoader, Registration> securityFunction = applicationSecurityDomain != null ? applicationSecurityDomain.getSecurityFunction() : null; if (securityFunction != null) { Registration registration = securityFunction.apply(deploymentName, classLoader); cleanUpTask = registration::cancel; } } else { final SecurityDomain securityDomain = this.securityDomain.getValue(); if (isChecking()) { doPrivileged((PrivilegedAction<Void>) () -> { securityDomain.registerWithClassLoader(classLoader); return null; }); } else { securityDomain.registerWithClassLoader(classLoader); } cleanUpTask = new Runnable() { @Override public void run() { if (WildFlySecurityManager.isChecking()) { doPrivileged((PrivilegedAction<Void>) () -> { unregisterClassLoader(classLoader); return null; }); } else { unregisterClassLoader(classLoader); } } }; } }

Target:
public synchronized void start(StartContext context) throws StartException { final String deploymentName = deploymentUnit.getParent() == null ? deploymentUnit.getName() : deploymentUnit.getParent().getName() + "." + deploymentUnit.getName(); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ClassLoader classLoader = module.getClassLoader(); ApplicationSecurityDomain applicationSecurityDomain = this.applicationSecurityDomain.getOptionalValue(); if (applicationSecurityDomain != null) { BiFunction<String, ClassLoader, Registration> securityFunction = applicationSecurityDomain.getSecurityFunction(); if (securityFunction != null) { Registration registration = securityFunction.apply(deploymentName, classLoader); cleanUpTask = registration::cancel; } } else { final SecurityDomain securityDomain = this.securityDomain.getValue(); if (isChecking()) { doPrivileged((PrivilegedAction<Void>) () -> { securityDomain.registerWithClassLoader(classLoader); return null; }); } else { securityDomain.registerWithClassLoader(classLoader); } cleanUpTask = new Runnable() { @Override public void run() { if (WildFlySecurityManager.isChecking()) { doPrivileged((PrivilegedAction<Void>) () -> { unregisterClassLoader(classLoader); return null; }); } else { unregisterClassLoader(classLoader); } } }; } }
Source:
public void testListStatusIteratorFile() throws Throwable { describe("test the listStatusIterator(path) on a file"); Path f = touchf("listStItrFile"); List<FileStatus> statusList = (List<FileStatus>) iteratorToList( getFileSystem().listStatusIterator(f)); assertEquals("size of file list returned", 1, statusList.size()); assertIsNamedFile(f, statusList.get(0)); List<FileStatus> statusList2 = (List<FileStatus>) iteratorToListThroughNextCallsAlone( getFileSystem().listStatusIterator(f)); assertEquals("size of file list returned through next() calls", 1, statusList2.size()); assertIsNamedFile(f, statusList2.get(0)); }

Target:
public void testListStatusIteratorFile() throws Throwable { describe("test the listStatusIterator(path) on a file"); Path f = touchf("listStItrFile"); List<FileStatus> statusList = (List<FileStatus>) iteratorToList( getFileSystem().listStatusIterator(f)); validateListingForFile(f, statusList, false); List<FileStatus> statusList2 = (List<FileStatus>) iteratorToListThroughNextCallsAlone( getFileSystem().listStatusIterator(f)); validateListingForFile(f, statusList2, true); }
Source:
public void fetchThumbnailForEntityId(String entityId, int position) { compositeDisposable.add(depictsClient.getP18ForItem(entityId) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) .subscribe(response -> { Timber.e("line67" + response); view.onImageUrlFetched(response,position); })); }

Target:
public void fetchThumbnailForEntityId(String entityId, int position) { compositeDisposable.add(depictsClient.getP18ForItem(entityId) .subscribeOn(ioScheduler) .observeOn(mainThreadScheduler) .timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) .subscribe(response -> { view.onImageUrlFetched(response,position); })); }
Source:
public List<IAnalysisModule> getAnalysisModules() { List<IAnalysisModule> modules = new ArrayList<IAnalysisModule>(); for (String key : fAnalysisTypeAttributes.keySet()) { IConfigurationElement ce = fAnalysisTypeAttributes.get(key); IAnalysisModule module; try { module = (IAnalysisModule) ce.createExecutableExtension(ANALYSIS_MODULE_ATTR); module.setName(ce.getAttribute(NAME_ATTR)); module.setId(ce.getAttribute(ID_ATTR)); module.setAutomatic(Boolean.valueOf(ce.getAttribute(AUTOMATIC_ATTR))); module.setIcon(ce.getAttribute(ICON_ATTR)); final IConfigurationElement[] parametersCE = ce.getChildren(PARAMETER_ELEM); for (IConfigurationElement element : parametersCE) { module.addParameter(element.getAttribute(NAME_ATTR)); String defaultValue = element.getAttribute(DEFAULT_VALUE_ATTR); if (defaultValue != null) { module.setParameter(element.getAttribute(NAME_ATTR), defaultValue); } } modules.add(module); } catch (CoreException e) { } } return modules; }

Target:
public List<IAnalysisModule> getAnalysisModules() { List<IAnalysisModule> modules = new ArrayList<IAnalysisModule>(); for (Map.Entry<String, IConfigurationElement> entry : fAnalysisTypeAttributes.entrySet()) { IConfigurationElement ce = entry.getValue(); IAnalysisModule module; try { module = (IAnalysisModule) ce.createExecutableExtension(ANALYSIS_MODULE_ATTR); module.setName(ce.getAttribute(NAME_ATTR)); module.setId(ce.getAttribute(ID_ATTR)); module.setAutomatic(Boolean.valueOf(ce.getAttribute(AUTOMATIC_ATTR))); module.setIcon(ce.getAttribute(ICON_ATTR)); final IConfigurationElement[] parametersCE = ce.getChildren(PARAMETER_ELEM); for (IConfigurationElement element : parametersCE) { module.addParameter(element.getAttribute(NAME_ATTR)); String defaultValue = element.getAttribute(DEFAULT_VALUE_ATTR); if (defaultValue != null) { module.setParameter(element.getAttribute(NAME_ATTR), defaultValue); } } modules.add(module); } catch (CoreException e) { Activator.logError("Error getting analysis modules from configuration files", e); } } return modules; }
Source:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); ObservableList<ItemViewModel> items = new ObservableArrayList<>(); items.add(new HeaderItemViewModel("我是header")); for (int i = 0; i < 3; i++) { items.add(new NormalItemViewModel(i, true)); } viewModel = new ViewModel(true, items); }

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); ObservableList<ItemViewModel> items = new ObservableArrayList<>(); items.add(new HeaderItemViewModel(getString(R.string.header))); for (int i = 0; i < 3; i++) { items.add(new NormalItemViewModel(i, true)); } viewModel = new ViewModel(true, items); }
Source:
public long onInvalidTimestamp(final ConsumerRecord<Object, Object> record, final long recordTimestamp, final long partitionTime) throws StreamsException { if (partitionTime < 0) { throw new StreamsException("Could not infer new timestamp for input record " + record + " because latest extracted valid timestamp is unknown."); } return partitionTime; }

Target:
public long onInvalidTimestamp(final ConsumerRecord<Object, Object> record, final long recordTimestamp, final long partitionTime) throws StreamsException { if (partitionTime < 0) { throw new StreamsException("Could not infer new timestamp for input record " + record + " because partition time is unknown."); } return partitionTime; }
Source:
public Project(Project.NameKey nameKey) { name = nameKey; submitType = defaultSubmitType; }

Target:
public Project(Project.NameKey nameKey) { name = nameKey; submitType = defaultSubmitType; state = State.ACTIVE; }
Source:
private boolean zipParentFolder(File toBeZippedDirectory, String zipFilePath) throws IOException { Log.d(TAG, "Zipping directory" + toBeZippedDirectory.toString() + " to path " + zipFilePath); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFilePath))); try { if (!toBeZippedDirectory.isDirectory()) { throw new RuntimeException("toBeZippedDirecory was not a directory. Bad."); } File[] formInstanceFolders = toBeZippedDirectory.listFiles(); for (File formInstanceFolder : formInstanceFolders) { File[] subFileArray = formInstanceFolder.listFiles(); zipInstanceFolder(subFileArray, zipFilePath, out); } } finally { out.close(); } return false; }

Target:
private static boolean zipParentFolder(File toBeZippedDirectory, String zipFilePath) throws IOException { Log.d(TAG, "Zipping directory" + toBeZippedDirectory.toString() + " to path " + zipFilePath); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFilePath))); try { if (!toBeZippedDirectory.isDirectory()) { throw new RuntimeException("toBeZippedDirecory was not a directory. Bad."); } File[] formInstanceFolders = toBeZippedDirectory.listFiles(); for (File formInstanceFolder : formInstanceFolders) { File[] subFileArray = formInstanceFolder.listFiles(); Log.d(TAG, "Zipping instance folder with files: " + Arrays.toString(subFileArray) + ", zipFilePath: " + zipFilePath); zipInstanceFolder(subFileArray, out); } out.finish(); } finally { out.close(); } return false; }
Source:
public Resource minify(Resource originalResource) { if (!getEnabled()) { LOG.trace(MINIFICATION_IS_DISABLED_RETURNING_ORIGINAL_RESOURCE); return originalResource; } if (originalResource.getFilename() == null) { LOG.warn("Attempted to modify resource without a filename, returning non-minified resource"); return originalResource; } Integer filenameLength = originalResource.getFilename().length(); if (filenameLength >= JS_MIN.length()) { String lastSevenCharacters = originalResource.getFilename().substring(filenameLength-JS_MIN.length()); if (lastSevenCharacters.equals(JS_MIN)) { LOG.info("Minification already have done for this resource: " + originalResource.getFilename()); return originalResource; } } return minify(originalResource, originalResource.getFilename()); }

Target:
public Resource minify(Resource originalResource) { if (!getEnabled()) { LOG.trace(MINIFICATION_IS_DISABLED_RETURNING_ORIGINAL_RESOURCE); return originalResource; } if (originalResource.getFilename() == null) { LOG.warn("Attempted to modify resource without a filename, returning non-minified resource"); return originalResource; } return minify(originalResource, originalResource.getFilename()); }
Source:
public void equals_hashCodeTest() { AirConditionerActions action = new AirConditionerActions(true, null); AliasAction<AirConditionerActions> aliasAction = new AliasAction<>("alias", action); Object[] sameObjects = { aliasAction, new AliasAction<>("alias", action)}; for(int i=0; i<sameObjects.length; i++) { Assert.assertEquals( "failed to test equals for ["+i+"]", aliasAction, sameObjects[i]); Assert.assertEquals( "failed to test hashCode for ["+i+"]", aliasAction, sameObjects[i]); } Object[] diffObjects = { null, new AliasAction<>("another alias", action), new AliasAction<>("humidity", new HumidityActions(45)), new AliasAction<>("alias", new HumidityActions(45)), 23 }; for (int i=0; i < diffObjects.length; i++) { Assert.assertFalse( "failed to test equals for ["+i+"]", aliasAction.equals(diffObjects[i])); if (diffObjects[i] != null) { Assert.assertFalse( "failed to test hashCode for [" + i + "]", aliasAction.hashCode() == diffObjects[i].hashCode()); } } }

Target:
public void equals_hashCodeTest() { AirConditionerActions action = new AirConditionerActions(true, null); AliasAction<AirConditionerActions> aliasAction = new AliasAction<>("alias", action); Object[] sameObjects = { aliasAction, new AliasAction<>("alias", action)}; for(int i=0; i<sameObjects.length; i++) { Assert.assertEquals( "failed to test equals for ["+i+"]", aliasAction, sameObjects[i]); Assert.assertEquals( "failed to test hashCode for ["+i+"]", aliasAction.hashCode(), sameObjects[i].hashCode()); } Object[] diffObjects = { null, new AliasAction<>("another alias", action), new AliasAction<>("humidity", new HumidityActions(45)), new AliasAction<>("alias", new HumidityActions(45)), 23 }; for (int i=0; i < diffObjects.length; i++) { Assert.assertFalse( "failed to test equals for ["+i+"]", aliasAction.equals(diffObjects[i])); if (diffObjects[i] != null) { Assert.assertFalse( "failed to test hashCode for [" + i + "]", aliasAction.hashCode() == diffObjects[i].hashCode()); } } }
Source:
private IWorkingSetUpdater2 getUpdater() { WorkingSetDescriptor descriptor = getDescriptor(); WorkingSetManager manager = getWorkingSetManager(); if (manager != null && descriptor != null) { IWorkingSetUpdater updater = manager.getUpdater(descriptor); if (updater instanceof IWorkingSetUpdater2) { return (IWorkingSetUpdater2) updater; } } return null; }

Target:
private IWorkingSetUpdater2 getUpdater() { WorkingSetManager manager = getWorkingSetManager(); if (manager != null) { WorkingSetDescriptor descriptor = getDescriptor(); if (descriptor != null) { IWorkingSetUpdater updater = manager.getUpdater(descriptor); if (updater instanceof IWorkingSetUpdater2) { return (IWorkingSetUpdater2) updater; } } } return null; }
Source:
public BloomFilter readBloomFilter(ColumnChunkMetaData meta) { if (cache.containsKey(meta.getPath())) { return cache.get(meta.getPath()); } try { synchronized (cache) { if (!cache.containsKey(meta.getPath())) { BloomFilter bloomFilter = reader.readBloomFilter(meta); if (bloomFilter == null) return null; cache.put(meta.getPath(), bloomFilter); } } return cache.get(meta.getPath()); } catch (IOException e) { throw new RuntimeException( "Failed to read Bloom filter data", e); } }

Target:
public BloomFilter readBloomFilter(ColumnChunkMetaData meta) { if (cache.containsKey(meta.getPath())) { return cache.get(meta.getPath()); } try { if (!cache.containsKey(meta.getPath())) { BloomFilter bloomFilter = reader.readBloomFilter(meta); if (bloomFilter == null) { return null; } cache.put(meta.getPath(), bloomFilter); } return cache.get(meta.getPath()); } catch (IOException e) { logger.error("Failed to read Bloom filter data", e); } return null; }
Source:
private MappedRoleMapper(Map<String, Set<String>> roleMap) { this.reverseRoleMap = new LinkedHashMap<>(); Set<Map.Entry<String, Set<String>>> entrySet = roleMap.entrySet(); for (Map.Entry<String, Set<String>> entry : entrySet) { for (String mappedRole : entry.getValue()) { Set<String> rolesToMappedRole = reverseRoleMap.get(mappedRole); if (rolesToMappedRole == null) { rolesToMappedRole = new LinkedHashSet<>(); reverseRoleMap.put(mappedRole, rolesToMappedRole); } rolesToMappedRole.add(entry.getKey()); } } }

Target:
private MappedRoleMapper(Map<String, Set<String>> roleMap) { Set<Map.Entry<String, Set<String>>> entrySet = roleMap.entrySet(); for (Map.Entry<String, Set<String>> entry : entrySet) { for (String mappedRole : entry.getValue()) { Set<String> rolesToMappedRole = reverseRoleMap.get(mappedRole); if (rolesToMappedRole == null) { rolesToMappedRole = new LinkedHashSet<>(); reverseRoleMap.put(mappedRole, rolesToMappedRole); } rolesToMappedRole.add(entry.getKey()); } } initialized = true; }
Source:
private boolean validationNecessaryForInvolvedTables() { return !Sets.filter(involvedTables, tableRef -> isValidationNecessary(tableRef)).isEmpty(); }

Target:
private boolean validationNecessaryForInvolvedTables() { return involvedTables.stream().anyMatch(this::isValidationNecessary); }
Source:
private HealthStatus pointEstimateTimeLockHealth() { Collection<ServiceHealthTracker.Service> services = FeedbackReportsSink.getTrackedServices(); int targetHealthyServices = services.size() * 2 / 3; services = services.stream().filter( service -> !service.nodes().isEmpty()).collect(Collectors.toList()); return services .stream() .filter(service -> ServiceHealthTracker.getHealthStatus(service) == HealthStatus.HEALTHY).count() >= targetHealthyServices ? HealthStatus.HEALTHY : HealthStatus.UNHEALTHY; }

Target:
public HealthStatus pointEstimateTimeLockHealth() { Collection<ServiceHealthTracker.Service> services = FeedbackReportsSink.getTrackedServices(); int targetUnhealthyServices = services.size() / 3; return services .stream() .filter(service -> ServiceHealthTracker.getHealthStatus(service) == HealthStatus.UNHEALTHY).count() >= targetUnhealthyServices ? HealthStatus.UNHEALTHY : HealthStatus.HEALTHY; }
Source:
public String getUsage() { StringWriter wrt = new StringWriter(); String indent = " "; try (PrintWriter out = new PrintWriter(wrt)) { out.println(getPrologue()); for (Object o : usageSummary) { if (o instanceof String) { out.println((String)o); } else { out.println(indent + ((Option)o).getUsage()); } } if (epilogue != null) { out.println(epilogue); } out.flush(); } return wrt.toString(); }

Target:
public String getUsage() { return getUsage(" "); }
Source:
public void setCommandExecuted() { Transaction transaction = TransactionSupport.suspend(); try { TaskManagerUtil.updateCommandExecuted(getCommandId()); } finally { TransactionSupport.resume(transaction); } }

Target:
public void setCommandExecuted() { Transaction transaction = TransactionSupport.suspend(); try { TaskManagerUtil.updateCommandExecuted(getCommandId()); } finally { if (transaction != null) { TransactionSupport.resume(transaction); } } }
Source:
public TestResultSummary(TestResult result) { result.tally(); failCount = result.getFailCount(); passCount = result.getPassCount(); skipCount = result.getSkipCount(); totalCount = result.getTotalCount(); }

Target:
public TestResultSummary(TestResult result) { failCount = result.getFailCount(); passCount = result.getPassCount(); skipCount = result.getSkipCount(); totalCount = result.getTotalCount(); }
Source:
public DataTransactionResult offerToStore(ValueContainer<?> container, Optional<UUID> value) { final ImmutableSpongeOptionalValue<UUID> proposedValue = new ImmutableSpongeOptionalValue<UUID>(Keys.TAMED_OWNER, value); if(container instanceof EntityTameable) { final DataTransactionBuilder builder = DataTransactionBuilder.builder(); final Optional<UUID> tamer = TameableDataProcessor.getTamer((EntityTameable) container); final ImmutableValue<Optional<UUID>> oldTamer = this.getApiValueFromContainer(container).get().asImmutable(); final ImmutableOptionalValue<UUID> newTamer = new ImmutableSpongeOptionalValue<UUID>(Keys.TAMED_OWNER, value); try { ((EntityTameable) container).setOwnerId(TameableDataProcessor.asString(value)); } catch (Exception e) { return DataTransactionBuilder.errorResult(newTamer); } return builder.success(newTamer).replace(oldTamer).result(DataTransactionResult.Type.SUCCESS).build(); } return DataTransactionBuilder.failResult(proposedValue); }

Target:
public DataTransactionResult offerToStore(ValueContainer<?> container, Optional<UUID> value) { final ImmutableSpongeOptionalValue<UUID> proposedValue = ImmutableSpongeTameableData.createValue(value); if(container instanceof EntityTameable) { final DataTransactionBuilder builder = DataTransactionBuilder.builder(); final Optional<UUID> tamer = TameableDataProcessor.getTamer((EntityTameable) container); final ImmutableValue<Optional<UUID>> oldTamer = this.getApiValueFromContainer(container).get().asImmutable(); final ImmutableOptionalValue<UUID> newTamer = ImmutableSpongeTameableData.createValue(value); try { ((EntityTameable) container).setOwnerId(TameableDataProcessor.asString(value)); return builder.success(newTamer).replace(oldTamer).result(DataTransactionResult.Type.SUCCESS).build(); } catch (Exception e) { return DataTransactionBuilder.errorResult(newTamer); } } return DataTransactionBuilder.failResult(proposedValue); }
Source:
private void handleResult(Document runInfo, RunId runId) { Elements result = runInfo.select("td#Result"); switch (result.text()) { case "N/A": this.result = Result.NA; break; case "NOT_AVAILABLE": this.result = Result.NOT_AVAILABLE; break; case "UNKNOWN": this.result = Result.UNKNOWN; break; default: throw new IllegalRunStatusException( "RunId " + runId + "returned illegal run info result " + result.text()); } }

Target:
private void handleResult(Document runInfo, RunId runId) { Elements result = runInfo.select("td#Result"); switch (result.text()) { case "PASSED": this.result = Result.PASSED; break; case "FAILED": this.result = Result.FAILED; break; case "N/A": this.result = Result.NA; break; case "NOT_AVAILABLE": this.result = Result.NOT_AVAILABLE; break; case "UNKNOWN": this.result = Result.UNKNOWN; break; default: throw new IllegalRunStatusException( "RunId " + runId + "returned illegal run info result " + result.text()); } }
Source:
private static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur: inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } }

Target:
static void checkAllInserted(int[] inserts, int size) throws IOException { int sum = 0; for (int cur: inserts) { if (cur == PreparedStatement.SUCCESS_NO_INFO) { return; } else if (cur == PreparedStatement.EXECUTE_FAILED) { throw new IOException("Failed to insert some features"); } sum += cur; } if (sum != size) { throw new IOException("Failed to insert some features"); } }
Source:
public List<VdsmVm> perform( List<Pair<VmDynamic, VdsmVm>> monitoredVms, long fetchTime, VdsManager vdsManager, boolean updateStatistics) { if (monitoredVms.isEmpty()) { return Collections.emptyList(); } List<VmAnalyzer> vmAnalyzers = Collections.emptyList(); List<VdsmVm> dbVms = Collections.emptyList(); try { vmAnalyzers = analyzeVms(monitoredVms, fetchTime, vdsManager, updateStatistics); addUnmanagedVms(vmAnalyzers, vdsManager.getVdsId()); flush(vmAnalyzers); postFlush(vmAnalyzers, vdsManager); vdsManager.vmsMonitoringInitFinished(); dbVms = monitoredVms.stream(). filter(monitoredVm -> monitoredVm.getFirst() != null). map(Pair::getSecond).collect(Collectors.toList()); } catch (RuntimeException ex) { log.error("Failed during vms monitoring on host error is: {}", vdsManager.getVdsName(), ex); log.error("Exception:", ex); } finally { unlockVms(vmAnalyzers); } return dbVms; }

Target:
public void perform( List<Pair<VmDynamic, VdsmVm>> monitoredVms, long fetchTime, VdsManager vdsManager, boolean updateStatistics) { if (monitoredVms.isEmpty()) { return; } List<VmAnalyzer> vmAnalyzers = Collections.emptyList(); try { vmAnalyzers = analyzeVms(monitoredVms, fetchTime, vdsManager, updateStatistics); addUnmanagedVms(vmAnalyzers, vdsManager.getVdsId()); flush(vmAnalyzers); postFlush(vmAnalyzers, vdsManager); vdsManager.vmsMonitoringInitFinished(); } catch (RuntimeException ex) { log.error("Failed during vms monitoring on host error is: {}", vdsManager.getVdsName(), ex); log.error("Exception:", ex); } finally { unlockVms(vmAnalyzers); } }
Source:
public void testHardAffinityAssignment() { NodeTaskMap nodeTaskMap = new NodeTaskMap(finalizerService); TestingTransactionHandle transactionHandle = TestingTransactionHandle.create(); NodeSchedulerConfig nodeSchedulerConfig = new NodeSchedulerConfig() .setMaxSplitsPerNode(20) .setIncludeCoordinator(false) .setMaxPendingSplitsPerTask(10); NodeScheduler nodeScheduler = new NodeScheduler(new LegacyNetworkTopology(), nodeManager, nodeSchedulerConfig, nodeTaskMap); NodeSelector nodeSelector = nodeScheduler.createNodeSelector(CONNECTOR_ID, 3); Set<Split> splits = new HashSet<>(); splits.add(new Split(CONNECTOR_ID, transactionHandle, new TestHardAffinitySplitRemote())); splits.add(new Split(CONNECTOR_ID, transactionHandle, new TestHardAffinitySplitRemote())); splits.add(new Split(CONNECTOR_ID, transactionHandle, new TestHardAffinitySplitRemote())); SplitPlacementResult splitPlacementResult = nodeSelector.computeAssignments(splits, ImmutableList.of()); for (Split split : splitPlacementResult.getAssignments().values()) { assertEquals(split.getSplitContext().isCacheable(), true); } }

Target:
public void testHardAffinityAssignment() { NodeTaskMap nodeTaskMap = new NodeTaskMap(finalizerService); TestingTransactionHandle transactionHandle = TestingTransactionHandle.create(); NodeSchedulerConfig nodeSchedulerConfig = new NodeSchedulerConfig() .setMaxSplitsPerNode(20) .setIncludeCoordinator(false) .setMaxPendingSplitsPerTask(10); NodeScheduler nodeScheduler = new NodeScheduler(new LegacyNetworkTopology(), nodeManager, nodeSchedulerConfig, nodeTaskMap); NodeSelector nodeSelector = nodeScheduler.createNodeSelector(CONNECTOR_ID, 3); Set<Split> splits = new HashSet<>(); splits.add(new Split(CONNECTOR_ID, transactionHandle, new TestHardAffinitySplitRemote())); splits.add(new Split(CONNECTOR_ID, transactionHandle, new TestHardAffinitySplitRemote())); splits.add(new Split(CONNECTOR_ID, transactionHandle, new TestHardAffinitySplitRemote())); SplitPlacementResult splitPlacementResult = nodeSelector.computeAssignments(splits, ImmutableList.of()); for (Split split : splitPlacementResult.getAssignments().values()) { assertTrue(split.getSplitContext().isCacheable()); } }
Source:
public void add(String label, String[] values) throws ParseException, InvalidParametersException { if ("after".equals(label)) { isFromDateInQuery = true; LocalDateTime localDateTime = TimeHelper.parseLocalDateTime(values[0] + " 00:00", "dd/MM/yyyy HH:mm"); fromDateValue = TimeHelper.convertLocalDateTimeToInstant( localDateTime, Const.SystemParams.ADMIN_TIME_ZONE_ID).toEpochMilli(); } else if ("before".equals(label)) { isToDateInQuery = true; LocalDateTime localDateTime = TimeHelper.parseLocalDateTime(values[0] + " 23:59", "dd/MM/yyyy HH:mm"); toDateValue = TimeHelper.convertLocalDateTimeToInstant( localDateTime, Const.SystemParams.ADMIN_TIME_ZONE_ID).toEpochMilli(); } else if ("receiver".equals(label)) { isReceiverInQuery = true; receiverValues = values; } else if ("subject".equals(label)) { isSubjectInQuery = true; subjectValues = values; } else if ("info".equals(label)) { isInfoInQuery = true; infoValues = values; } else { throw new InvalidParametersException("Invalid label"); } }

Target:
public void add(String label, String[] values) throws ParseException, InvalidParametersException { if ("after".equals(label)) { isFromDateInQuery = true; LocalDateTime localDateTime = TimeHelper.parseLocalDate(values[0], "dd/MM/yyyy").atStartOfDay(); fromDateValue = TimeHelper.convertLocalDateTimeToInstant( localDateTime, Const.SystemParams.ADMIN_TIME_ZONE).toEpochMilli(); return; } if ("before".equals(label)) { isToDateInQuery = true; LocalDateTime localDateTime = TimeHelper.parseLocalDate(values[0], "dd/MM/yyyy").atTime(LocalTime.MAX); toDateValue = TimeHelper.convertLocalDateTimeToInstant( localDateTime, Const.SystemParams.ADMIN_TIME_ZONE).toEpochMilli(); return; } if ("receiver".equals(label)) { isReceiverInQuery = true; receiverValues = values; return; } if ("subject".equals(label)) { isSubjectInQuery = true; subjectValues = values; return; } if ("info".equals(label)) { isInfoInQuery = true; infoValues = values; return; } throw new InvalidParametersException("Invalid label"); }
Source:
private static void addInputPath(Job job, Iterable<String> pathStrings, Class<? extends InputFormat> inputFormatClass) { Configuration conf = job.getConfiguration(); StringBuilder inputFormats = new StringBuilder(Strings.nullToEmpty(conf.get(MultipleInputs.DIR_FORMATS))); for (String pathString : pathStrings) { if (inputFormats.length() > 0) { inputFormats.append(','); } inputFormats.append(pathString).append(';').append(inputFormatClass.getName()); } conf.set(MultipleInputs.DIR_FORMATS, inputFormats.toString()); job.setInputFormatClass(DelegatingInputFormat.class); }

Target:
private static void addInputPath(Job job, Iterable<String> pathStrings, Class<? extends InputFormat> inputFormatClass) { Configuration conf = job.getConfiguration(); StringBuilder inputFormats = new StringBuilder(Strings.nullToEmpty(conf.get(MultipleInputs.DIR_FORMATS))); String[] paths = Iterables.toArray(pathStrings, String.class); for (int i = 0; i < paths.length - 1; i++) { if (inputFormats.length() > 0) { inputFormats.append(','); } inputFormats.append(paths[i]).append(';').append(inputFormatClass.getName()); } if (inputFormats.length() > 0) { conf.set(MultipleInputs.DIR_FORMATS, inputFormats.toString()); } MultipleInputs.addInputPath(job, new Path(paths[paths.length - 1]), inputFormatClass); }
Source:
public void testEnumDepth1() { test(" var a = {b: 0, c: 1};", "var a$b = 0; var a$c = 1;"); test(" var a = { b: 0, c: 1};", "var a$c = 1; var a = {b: 0};"); }

Target:
public void testEnumDepth1() { test(" var a = {b: 0, c: 1};", "var a$b = 0; var a$c = 1;"); test(" var a = { b: 0, c: 1};", "var a$b = 0; var a$c = 1;", null, CollapseProperties.INVALID_NOCOLLAPSE); }
Source:
public ModelAndView getCommentFeed(@SiteParam Site site, @PathVariable String feedType) throws IOException { String requestAddress = String.format("/journals/%s?comments&limit=%d", site.getJournalKey(), 30); List comments = soaService.requestObject(requestAddress, List.class); ModelAndView mav = new ModelAndView(); FeedMetadataField.SITE.putInto(mav, site); FeedMetadataField.TITLE.putInto(mav, "Comments"); FeedMetadataField.FEED_INPUT.putInto(mav, comments); mav.setView(FeedType.getView(commentFeedView, feedType)); return mav; }

Target:
public ModelAndView getCommentFeed(@SiteParam Site site, @PathVariable String feedType) throws IOException { String requestAddress = String.format("/journals/%s?comments&limit=%d", site.getJournalKey(), getFeedLength(site)); List comments = soaService.requestObject(requestAddress, List.class); ModelAndView mav = new ModelAndView(); FeedMetadataField.SITE.putInto(mav, site); FeedMetadataField.TITLE.putInto(mav, "Comments"); FeedMetadataField.FEED_INPUT.putInto(mav, comments); mav.setView(FeedType.getView(commentFeedView, feedType)); return mav; }
Source:
private static void logEntry(Connection connection, DataSource dataSource, ProceedingJoinPoint joinPoint, HttpServletRequest request, boolean mustCheck, String formattedOrgIds) { StringBuilder sb = new StringBuilder(); if (DataSourceUtils.isConnectionTransactional(connection, dataSource)) { sb.append("-----------\n"); sb.append("connection is transactional\n"); sb.append("URL IS ").append(request.getRequestURI()).append("\n"); sb.append(request.getRequestURL()).append("\n"); sb.append(joinPoint).append("\n"); sb.append("public url: ").append(isCurrentlyInAPublicUrlRequest()).append("\n"); if (SecurityContextHolder.getContext() != null && SecurityContextHolder.getContext().getAuthentication() != null) { sb.append("auth is ").append(SecurityContextHolder.getContext().getAuthentication().getName()).append("\n"); } else { sb.append("no user\n"); } sb.append("must check row access: ").append(mustCheck).append("\n"); if(mustCheck) { sb.append("org ids are: ").append(formattedOrgIds).append("\n"); } sb.append("-----------\n"); } else { sb.append("-----------\n"); sb.append("connection is NOT transactional so the check will not be done!\n"); sb.append("URL IS ").append(request.getRequestURI()).append("\n"); sb.append(joinPoint).append("\n"); sb.append("-----------\n"); } log.debug(sb.toString()); }

Target:
private static void logEntry(Connection connection, DataSource dataSource, ProceedingJoinPoint joinPoint, HttpServletRequest request, boolean mustCheck, String formattedOrgIds) { StringBuilder sb = new StringBuilder(); if (DataSourceUtils.isConnectionTransactional(connection, dataSource)) { sb.append("-----------\n"); sb.append("connection is transactional\n"); sb.append("URL IS ").append(request.getRequestURI()).append("\n"); sb.append(request.getRequestURL()).append("\n"); sb.append(joinPoint).append("\n"); sb.append("public url: ").append(isCurrentlyInAPublicUrlRequest()).append("\n"); if (SecurityContextHolder.getContext() != null && SecurityContextHolder.getContext().getAuthentication() != null) { sb.append("auth is ").append(SecurityContextHolder.getContext().getAuthentication().getName()).append("\n"); } else { sb.append("no user\n"); } sb.append("must check row access: ").append(mustCheck).append("\n"); if(mustCheck) { sb.append("org ids are: ").append(formattedOrgIds).append("\n"); } sb.append("-----------\n"); } else { sb.append("-----------\n"); sb.append("connection is NOT transactional so the check will not be done!\n"); sb.append("URL IS ").append(request.getRequestURI()).append("\n"); sb.append(joinPoint).append("\n"); sb.append("-----------\n"); } log.trace(sb.toString()); }
Source:
private Map<String, Pair<Class, Object>> getOverriddenReturnTypes(){ Map<String, Pair<Class, Object>> map = new HashMap<>(); return map; }

Target:
private Map<String, Pair<Class, Object>> getOverriddenReturnTypes(){ return new HashMap<>(); }
Source:
public CmdLineParser(Object bean, ParserProperties parserProperties) { if (bean==null) return; new ClassParser().parse(bean,this); if (parserProperties.shouldSortOptions()) { Collections.sort(options, new Comparator<OptionHandler>() { public int compare(OptionHandler o1, OptionHandler o2) { return o1.option.toString().compareTo(o2.option.toString()); } }); } setUsageWidth(parserProperties.getUsageWidth()); }

Target:
public CmdLineParser(Object bean, ParserProperties parserProperties) { this.parserProperties = parserProperties; if (bean==null) return; new ClassParser().parse(bean,this); if (parserProperties.shouldSortOptions()) { Collections.sort(options, new Comparator<OptionHandler>() { public int compare(OptionHandler o1, OptionHandler o2) { return o1.option.toString().compareTo(o2.option.toString()); } }); } }
Source:
public void addMacroAdditionFiles(HashMap<String, String> map, String macroName, Vector<String> filenames) { StringBuffer buffer = new StringBuffer(); buffer.append(map.get(macroName)); for (int i=0; i<filenames.size(); i++) { String filename = filenames.get(i); if (filename.length() > 0) { buffer.append(escapeWhitespaces(filename) + WHITESPACE + LINEBREAK); } } map.put(macroName, buffer.toString()); }

Target:
public void addMacroAdditionFiles(HashMap<String, String> map, String macroName, Vector<String> filenames) { StringBuffer buffer = new StringBuffer(); buffer.append(map.get(macroName)); for (int i=0; i<filenames.size(); i++) { String filename = filenames.get(i); if (filename.length() > 0) { filename = ensurePathIsGNUMakeTargetRuleCompatibleSyntax(filename); buffer.append(filename + WHITESPACE + LINEBREAK); } } map.put(macroName, buffer.toString()); }
Source:
public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); initializeDialogUnits(parent); PlatformUI.getWorkbench().getHelpSystem() .setHelp(container, IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE); container.setLayout(new GridLayout(2,false)); container.setLayoutData(new GridData(GridData.FILL_BOTH)); new Label(container,SWT.NONE).setText("Select one of these Emf Parsley templates"); new Label(container,SWT.NONE).setText(""); SashForm sashForm = new SashForm(container, SWT.HORIZONTAL); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 300; sashForm.setLayoutData(gd); templateSelectionViewer = new TableViewer(sashForm, SWT.BORDER); templateSelectionViewer.setContentProvider(new ArrayContentProvider()); templateSelectionViewer.setLabelProvider(new LabelProvider(){ @Override public String getText(Object element) { return ((TemplateWizardConfiguration)element).getLabel(); } }); createDescriptionIn(sashForm); templateSelectionViewer.setInput( new TemplateWizardConfigurationsFactory(). createTemplateWizardConfigurations()); templateSelectionViewer.addSelectionChangedListener(this); Dialog.applyDialogFont(container); setPageComplete(false); setControl(container); new Label(container, SWT.NONE); btnRapOption = new Button(container, SWT.CHECK); btnRapOption.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); btnRapOption.setText("Create for Remote Application Platform (RAP)"); }

Target:
public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); initializeDialogUnits(parent); PlatformUI.getWorkbench().getHelpSystem() .setHelp(container, IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE); container.setLayout(new GridLayout(2,false)); container.setLayoutData(new GridData(GridData.FILL_BOTH)); new Label(container,SWT.NONE).setText("Select one of these Emf Parsley templates"); new Label(container,SWT.NONE).setText(""); SashForm sashForm = new SashForm(container, SWT.HORIZONTAL); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 300; sashForm.setLayoutData(gd); templateSelectionViewer = new TableViewer(sashForm, SWT.BORDER); templateSelectionViewer.setContentProvider(new ArrayContentProvider()); templateSelectionViewer.setLabelProvider(new LabelProvider(){ @Override public String getText(Object element) { return ((TemplateWizardConfiguration)element).getLabel(); } }); createDescriptionIn(sashForm); templateSelectionViewer.setInput( new TemplateWizardConfigurationsFactory(). createTemplateWizardConfigurations()); templateSelectionViewer.addSelectionChangedListener(this); Dialog.applyDialogFont(container); setPageComplete(false); setControl(container); new Label(container, SWT.NONE).setText(""); btnRapOption = new Button(container, SWT.CHECK); btnRapOption.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); btnRapOption.setText("Prepare for Remote Application Platform (RAP)"); }
Source:
public void stop(Future<Void> stopFuture) throws Exception { super.stop(stopFuture); logger.info("Stopped listening on port: " + PORT); }

Target:
public void stop(Future<Void> stopFuture) throws Exception { logger.info("Stopped listening on port: " + PORT); stopFuture.complete(); }
Source:
protected void endWithFailure() { restoreCommandState(); if (getCommandCoordinatorUtil().getCommandExecutionStatus(getParameters().getCommandId()) == CommandExecutionStatus.EXECUTED) { if (getVmTemplate() != null) { vmTemplateDao.remove(getVmTemplateId()); removeNetwork(); } } if (!getVmId().equals(Guid.Empty) && getVm() != null) { vmHandler.unLockVm(getVm()); } setSucceeded(true); }

Target:
protected void endWithFailure() { restoreCommandState(); if (commandCoordinatorUtil.getCommandExecutionStatus(getParameters().getCommandId()) == CommandExecutionStatus.EXECUTED) { if (getVmTemplate() != null) { vmTemplateDao.remove(getVmTemplateId()); removeNetwork(); } } if (!getVmId().equals(Guid.Empty) && getVm() != null) { vmHandler.unLockVm(getVm()); } setSucceeded(true); }