auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void extractRemovedNetworks() { for (VdsNetworkInterface iface : getExistingIfaces().values()) { String networkName = iface.getNetworkName(); if (StringUtils.isNotBlank(networkName) && !attachedNetworksNames.contains(networkName)) { removedNetworks.add(networkName); final List<String> vmNames = getVmInterfaceManager().findActiveVmsUsingNetworks( params.getVdsId(), Collections.singleton(networkName)); if (vmNames.size() == 1) { addViolation(EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_SINGLE_VM, vmNames.get(0)); } else { for (String vmName : vmNames) { addViolation(EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS, vmName); } } } } }

Target:
private void extractRemovedNetworks() { for (VdsNetworkInterface iface : getExistingIfaces().values()) { String networkName = iface.getNetworkName(); if (StringUtils.isNotBlank(networkName) && !attachedNetworksNames.contains(networkName)) { removedNetworks.add(networkName); final List<String> vmNames = getVmInterfaceManager().findActiveVmsUsingNetworks( params.getVdsId(), Collections.singleton(networkName)); for (String vmName : vmNames) { addDetailedViolation( EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS, vmName, Collections.singletonMap("networkNames", networkName)); } } } }
Source:
public final void cleanExpiredUsersSessions() { Long key = new Date().getTime() / 60000; List<String> sessionsList = validToSessionsMap.get(key); if (sessionsList != null) { for (String session : sessionsList) { removeSession(session); } validToSessionsMap.remove(key); } if (intervalsCounter.incrementAndGet() == Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)) { deleteOldGeneration(); intervalsCounter.set(0); } }

Target:
public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<SessionInfo> iterator = sessionInfoList.iterator(); while (iterator.hasNext()) { ConcurrentMap<String, Object> sessionMap = iterator.next().sessionMap; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if (hardLimit != null) { if (hardLimit.before(now)) { iterator.remove(); } } else if (softLimit != null) { if (softLimit.before(now)) { iterator.remove(); } } } }
Source:
public RealmAwareZkClient buildZkClient( RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig, RealmAwareZkClient.RealmAwareZkClientConfig clientConfig) { return null; }

Target:
public RealmAwareZkClient buildZkClient( RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig, RealmAwareZkClient.RealmAwareZkClientConfig clientConfig) throws IOException, InvalidRoutingDataException { return new SharedZkClient(connectionConfig, clientConfig); }
Source:
public boolean performOk() { Set<IItemDescriptor<Descriptor>> postProcessorDescriptors = Sets.newHashSet(EMFCompareRCPPlugin .getDefault().getPostProcessorDescriptorRegistry().getItemDescriptors()); SetView<IItemDescriptor<Descriptor>> postProcessorToDisable = Sets.difference( postProcessorDescriptors, dataHolder.getData()); setEnginePreferences(EMFComparePreferences.DISABLED_POST_PROCESSOR, postProcessorToDisable); if (TracingConstant.CONFIGURATION_TRACING_ACTIVATED) { StringBuilder traceMessage = new StringBuilder("Post processor preference serialization:\n"); String prefDelimiter = " :\n"; String new_line = "\n"; traceMessage.append(EMFComparePreferences.DISABLED_POST_PROCESSOR).append(prefDelimiter).append( getPreferenceStore().getString(EMFComparePreferences.DISABLED_POST_PROCESSOR)).append( new_line); EMFCompareRCPPlugin.getDefault().log(IStatus.INFO, traceMessage.toString()); } return super.performOk(); }

Target:
public boolean performOk() { Set<IItemDescriptor<Descriptor>> postProcessorDescriptors = Sets.newLinkedHashSet(EMFCompareRCPPlugin .getDefault().getPostProcessorDescriptorRegistry().getItemDescriptors()); SetView<IItemDescriptor<Descriptor>> postProcessorToDisable = Sets.difference( postProcessorDescriptors, dataHolder.getData()); setEnginePreferences(EMFComparePreferences.DISABLED_POST_PROCESSOR, postProcessorToDisable); if (TracingConstant.CONFIGURATION_TRACING_ACTIVATED) { StringBuilder traceMessage = new StringBuilder("Post processor preference serialization:\n"); String prefDelimiter = " :\n"; String new_line = "\n"; traceMessage.append(EMFComparePreferences.DISABLED_POST_PROCESSOR).append(prefDelimiter).append( getPreferenceStore().getString(EMFComparePreferences.DISABLED_POST_PROCESSOR)).append( new_line); EMFCompareRCPPlugin.getDefault().log(IStatus.INFO, traceMessage.toString()); } return super.performOk(); }
Source:
public static void copyRecursive(Path source, Path target) throws IOException { if (Files.exists(target)) { throw new FileAlreadyExistsException(target.toString()); } if (!Files.exists(target.getParent())) { throw new NoSuchFileException(target.toString()); } if (target.startsWith(source)) { throw new FileSystemException( source.toString(), target.toString(), "cannot copy a path into itself"); } FileSystemProvider sourceProvider = source.getFileSystem().provider(); FileSystemProvider targetProvider = target.getFileSystem().provider(); if (sourceProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) sourceProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } if (targetProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) targetProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } Files.walkFileTree(source, new CopyVisitor(source, target)); }

Target:
public static void copyRecursive(Path source, Path target) throws IOException { if (Files.exists(target)) { throw new FileAlreadyExistsException(target.toString()); } if (!Files.exists(target.getParent())) { throw new NoSuchFileException(target.toString()); } Path normalizedSource = source.normalize().toAbsolutePath(); Path normalizedTarget = target.normalize().toAbsolutePath(); if (normalizedTarget.startsWith(normalizedSource)) { throw new FileSystemException( normalizedSource.toString(), normalizedTarget.toString(), "cannot copy a path into itself"); } FileSystemProvider sourceProvider = source.getFileSystem().provider(); FileSystemProvider targetProvider = target.getFileSystem().provider(); if (sourceProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) sourceProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } if (targetProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) targetProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } Files.walkFileTree(source, new CopyVisitor(source, target)); }
Source:
public void executeMojo() throws MojoExecutionException, MojoFailureException { final File originalClassesDir = new File(getProject().getBuild() .getDirectory(), "generated-classes/jacoco"); final File classesDir = new File(getProject().getBuild() .getOutputDirectory()); final List<String> fileNames; try { final FileFilter fileFilter = new FileFilter(this.getIncludes(), this.getExcludes()); fileNames = FileUtils.getFileNames(classesDir, fileFilter.getIncludes(), fileFilter.getExcludes(), false); } catch (final IOException e1) { throw new MojoExecutionException( "Unable to get list of files to instrument.", e1); } final Instrumenter instrumenter = new Instrumenter( new OfflineInstrumentationAccessGenerator()); for (final String fileName : fileNames) { if (fileName.endsWith(".class")) { final File source = new File(classesDir, fileName); final File backup = new File(originalClassesDir, fileName); InputStream input = null; OutputStream output = null; try { FileUtils.copyFile(source, backup); input = new FileInputStream(backup); output = new FileOutputStream(source); instrumenter.instrument(input, output); } catch (final IOException e2) { throw new MojoExecutionException( "Unable to instrument file.", e2); } finally { IOUtil.close(input); IOUtil.close(output); } } } }

Target:
public void executeMojo() throws MojoExecutionException, MojoFailureException { final File originalClassesDir = new File(getProject().getBuild() .getDirectory(), "generated-classes/jacoco"); originalClassesDir.mkdirs(); final File classesDir = new File(getProject().getBuild() .getOutputDirectory()); if (!classesDir.isDirectory()) { getLog().info("skip non existing outputDirectory " + classesDir); return; } final List<String> fileNames; try { fileNames = new FileFilter(this.getIncludes(), this.getExcludes()).getFileNames(classesDir); } catch (final IOException e1) { throw new MojoExecutionException( "Unable to get list of files to instrument.", e1); } final Instrumenter instrumenter = new Instrumenter( new OfflineInstrumentationAccessGenerator()); for (final String fileName : fileNames) { if (fileName.endsWith(".class")) { final File source = new File(classesDir, fileName); final File backup = new File(originalClassesDir, fileName); InputStream input = null; OutputStream output = null; try { FileUtils.copyFile(source, backup); input = new FileInputStream(backup); output = new FileOutputStream(source); instrumenter.instrument(input, output); } catch (final IOException e2) { throw new MojoExecutionException( "Unable to instrument file.", e2); } finally { IOUtil.close(input); IOUtil.close(output); } } } }
Source:
public CompletionStage<Path> getServerReport() { return CompletableFuture.supplyAsync(() -> { Path home = serverHome.toPath(); ProcessBuilder builder = new ProcessBuilder("sh", "-c", home.resolve("bin/report.sh").toString(), home.toString()); try { Process process = builder.start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); Path path = Paths.get(reader.readLine()); process.waitFor(1, TimeUnit.MINUTES); return path; } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }, ForkJoinPool.commonPool()); }

Target:
public CompletionStage<Path> getServerReport() { OS os = OS.getCurrentOs(); if (os != OS.LINUX) { return CompletableFutures.completedExceptionFuture(log.serverReportUnavailable(os)); } long pid = ProcessInfo.getInstance().getPid(); Path home = serverHome.toPath(); Path root = serverRoot.toPath(); ProcessBuilder builder = new ProcessBuilder(); builder.command("sh", "-c", home.resolve("bin/report.sh").toString(), Long.toString(pid), root.toString()); return blockingManager.supplyBlocking(() -> { try { Process process = builder.start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); Path path = Paths.get(reader.readLine()); process.waitFor(1, TimeUnit.MINUTES); return path; } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }, "report"); }
Source:
public FilterEntry(String eventName, boolean exclude, String transport, String name) { this.eventName = eventName; this.exclude = exclude; if (transport != null){ recipient = new Recipient(transport, name); } else { recipient = null; } }

Target:
public FilterEntry(String eventName, boolean exclude, String transport, String name) { this.eventName = eventName; this.exclude = exclude; this.recipient = new Recipient(transport, name); }
Source:
public void checkpointState( CheckpointMetaData metadata, CheckpointOptions options, CheckpointMetrics metrics, OperatorChain<?, ?> operatorChain, Supplier<Boolean> isCanceled) throws Exception { checkNotNull(options); checkNotNull(metrics); if (lastCheckpointId >= metadata.getCheckpointId()) { LOG.info("Out of order checkpoint barrier (aborted previously?): >= {}", lastCheckpointId, metadata.getCheckpointId()); channelStateWriter.abort(metadata.getCheckpointId(), new CancellationException(), true); checkAndClearAbortedStatus(metadata.getCheckpointId()); return; } lastCheckpointId = metadata.getCheckpointId(); if (checkAndClearAbortedStatus(metadata.getCheckpointId())) { LOG.info("Checkpoint has been notified as aborted, would not trigger any checkpoint.", metadata.getCheckpointId()); return; } operatorChain.prepareSnapshotPreBarrier(metadata.getCheckpointId()); operatorChain.broadcastEvent( new CheckpointBarrier(metadata.getCheckpointId(), metadata.getTimestamp(), options), options.isUnalignedCheckpoint()); if (includeChannelState(options)) { prepareInflightDataSnapshot(metadata.getCheckpointId()); } Map<OperatorID, OperatorSnapshotFutures> snapshotFutures = new HashMap<>(operatorChain.getNumberOfOperators()); try { if (takeSnapshotSync(snapshotFutures, metadata, metrics, options, operatorChain, isCanceled)) { finishAndReportAsync(snapshotFutures, metadata, metrics, options); } else { cleanup(snapshotFutures, metadata, metrics, new Exception("Checkpoint declined")); } } catch (Exception ex) { cleanup(snapshotFutures, metadata, metrics, ex); throw ex; } }

Target:
public void checkpointState( CheckpointMetaData metadata, CheckpointOptions options, CheckpointMetrics metrics, OperatorChain<?, ?> operatorChain, Supplier<Boolean> isCanceled) throws Exception { checkNotNull(options); checkNotNull(metrics); if (lastCheckpointId >= metadata.getCheckpointId()) { LOG.info("Out of order checkpoint barrier (aborted previously?): >= {}", lastCheckpointId, metadata.getCheckpointId()); channelStateWriter.abort(metadata.getCheckpointId(), new CancellationException(), true); checkAndClearAbortedStatus(metadata.getCheckpointId()); return; } lastCheckpointId = metadata.getCheckpointId(); if (checkAndClearAbortedStatus(metadata.getCheckpointId())) { LOG.info("Checkpoint has been notified as aborted, would not trigger any checkpoint.", metadata.getCheckpointId()); return; } operatorChain.prepareSnapshotPreBarrier(metadata.getCheckpointId()); operatorChain.broadcastEvent( new CheckpointBarrier(metadata.getCheckpointId(), metadata.getTimestamp(), options), options.isUnalignedCheckpoint()); if (options.isUnalignedCheckpoint()) { prepareInflightDataSnapshot(metadata.getCheckpointId()); } Map<OperatorID, OperatorSnapshotFutures> snapshotFutures = new HashMap<>(operatorChain.getNumberOfOperators()); try { if (takeSnapshotSync(snapshotFutures, metadata, metrics, options, operatorChain, isCanceled)) { finishAndReportAsync(snapshotFutures, metadata, metrics, options); } else { cleanup(snapshotFutures, metadata, metrics, new Exception("Checkpoint declined")); } } catch (Exception ex) { cleanup(snapshotFutures, metadata, metrics, ex); throw ex; } }
Source:
public void write(NutchDocument doc) throws IOException { String id = (String) doc.getFieldValue("id"); String type = doc.getDocumentMeta().get("type"); if (type == null) { type = defaultType; } Map<String, Object> source = new HashMap<String, Object>(); for (String fieldName : doc.getFieldNames()) { Set<String> allFieldValues = new HashSet<String>(); for (Object value : doc.getField(fieldName).getValues()) { allFieldValues.add(value.toString()); } String[] fieldValues = allFieldValues.toArray(new String[allFieldValues.size()]); if (fieldValues.length > 1) { for (String value : fieldValues) { bulkLength += value.length(); } source.put(fieldName, fieldValues); } else if(fieldValues.length == 1) { source.put(fieldName, fieldValues[0]); bulkLength += fieldValues[0].length(); } } String index; if (languages != null && languages.length > 0) { String language = (String) doc.getFieldValue("lang"); boolean exists = false; for (String lang : languages) { if (lang.equals(language)) { exists = true; break; } } if (exists) { index = defaultIndex + "_" + language; } else { index = defaultIndex + "_others"; } } else { index = defaultIndex; } Index indexRequest = new Index.Builder(source).index(index) .type(type).id(id).build(); bulkBuilder.addAction(indexRequest); indexedDocs++; bulkDocs++; if (bulkDocs >= maxBulkDocs || bulkLength >= maxBulkLength) { LOG.info( "Processing bulk request [docs = {}, length = {}, total docs = {}, last doc in bulk = '{}']", bulkDocs, bulkLength, indexedDocs, id); createNewBulk = true; commit(); } }

Target:
public void write(NutchDocument doc) throws IOException { String id = (String) doc.getFieldValue("id"); String type = doc.getDocumentMeta().get("type"); if (type == null) { type = defaultType; } Map<String, Object> source = new HashMap<String, Object>(); for (String fieldName : doc.getFieldNames()) { Set<String> allFieldValues = new HashSet<String>(); for (Object value : doc.getField(fieldName).getValues()) { allFieldValues.add(value.toString()); } String[] fieldValues = allFieldValues.toArray(new String[allFieldValues.size()]); if (fieldValues.length > 1) { for (String value : fieldValues) { bulkLength += value.length(); } source.put(fieldName, fieldValues); } else if(fieldValues.length == 1) { source.put(fieldName, fieldValues[0]); bulkLength += fieldValues[0].length(); } } String index; if (languages != null && languages.length > 0) { String language = (String) doc.getFieldValue("lang"); boolean exists = false; for (String lang : languages) { if (lang.equals(language)) { exists = true; break; } } if (exists) { index = getLanguageIndexName(language); } else { index = getSinkIndexName(); } } else { index = defaultIndex; } Index indexRequest = new Index.Builder(source).index(index) .type(type).id(id).build(); bulkBuilder.addAction(indexRequest); indexedDocs++; bulkDocs++; if (bulkDocs >= maxBulkDocs || bulkLength >= maxBulkLength) { LOG.info( "Processing bulk request [docs = {}, length = {}, total docs = {}, last doc in bulk = '{}']", bulkDocs, bulkLength, indexedDocs, id); createNewBulk = true; commit(); } }
Source:
public static OGCGeometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); List<OGCGeometry> geometries = new ArrayList<>(); if (input.available() > 0) { byte code = input.readByte(); while (input.available() > 0) { OGCGeometry geometry = extractGeometry(code, input); geometries.add(geometry); } } if (geometries.isEmpty()) { return new OGCConcreteGeometryCollection(emptyList(), null); } else if (geometries.size() == 1) { return geometries.get(0); } return new OGCConcreteGeometryCollection(geometries, null); }

Target:
public static OGCGeometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); List<OGCGeometry> geometries = new ArrayList<>(); if (input.available() > 0) { byte code = input.readByte(); boolean isGeometryCollection = (code == GeometryTypeName.GEOMETRY_COLLECTION.code()); while (input.available() > 0) { geometries.add(readGeometry(isGeometryCollection, input)); } } if (geometries.isEmpty()) { return new OGCConcreteGeometryCollection(emptyList(), null); } else if (geometries.size() == 1) { return geometries.get(0); } return new OGCConcreteGeometryCollection(geometries, null); }
Source:
public void testBug542084_error() { int enumsCount = 4500; StringBuilder lotOfEnums = new StringBuilder(enumsCount * 3); for (int i = 0; i < enumsCount; i++) { lotOfEnums.append("A").append(i).append(", "); } runNegativeTest( new String[] { "X.java", "public class X {\n" + " enum Y {\n" + lotOfEnums.toString() + " }\n" + " public static void main(String[] args) {\n" + " X.Y y = X.Y.A0;\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + " public void z2(Y y) {\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 6)\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The code of method $SWITCH_TABLE$X$Y() is exceeding the 65535 bytes limit\n" + "----------\n"); }

Target:
public void testBug542084_error() { int enumsCount = getEnumsCountForError(); StringBuilder lotOfEnums = new StringBuilder(enumsCount * 3); for (int i = 0; i < enumsCount; i++) { lotOfEnums.append("A").append(i).append(", "); } runNegativeTest( new String[] { "X.java", "public class X {\n" + " enum Y {\n" + lotOfEnums.toString() + " }\n" + " public static void main(String[] args) {\n" + " X.Y y = X.Y.A0;\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + " public void z2(Y y) {\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 6)\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The code of method $SWITCH_TABLE$X$Y() is exceeding the 65535 bytes limit\n" + "----------\n"); }
Source:
public static TreeView getDependencyTree(TextAnnotation input, String parseViewName, String dependencyViewName) { CollinsHeadDependencyParser depParser = new CollinsHeadDependencyParser(false); TreeView parseTreeView = (TreeView) input.getView(parseViewName); TreeView depTreeView = new TreeView(dependencyViewName, viewGenerator, input, 1d); int size = 0; for (int i = 0; i < input.getNumberOfSentences(); i++) { if (parseTreeView.getTree(i) != null) { Constituent parseTreeRoot = parseTreeView.getRootConstituent(i); Tree<Pair<String, Integer>> labeledDependencyTree = depParser.getLabeledDependencyTree(parseTreeRoot); try { depTreeView.setDependencyTree(i, labeledDependencyTree); } catch (IllegalStateException e) { logger.info(parseTreeView.toString()); logger.info("Unlabeled dependency tree (for debugging): "); logger.info(depParser.getDependencyTree(parseTreeRoot).toString()); throw e; } size += input.getSentence(i).size(); int nConstituents = depTreeView.getNumberOfConstituents(); if (nConstituents != size) { logger.error("{} nodes in dependency tree, " + "{} tokens in text so far", nConstituents, size); Set<Integer> set = new LinkedHashSet<>(); for (int tokenId = 0; tokenId < size; tokenId++) { set.add(tokenId); } for (Constituent c : depTreeView.getConstituents()) { set.remove(c.getStartSpan()); } StringBuilder sb = new StringBuilder(); for (int tokenId : set) { sb.append(input.getToken(tokenId)).append(" "); } logger.error("Dependency tree does not cover tokens: {}", sb.toString()); } } } return depTreeView; }

Target:
public static TreeView getDependencyTree(TextAnnotation input, String parseViewName, String dependencyViewName) { CollinsHeadDependencyParser depParser = new CollinsHeadDependencyParser(false); TreeView parseTreeView = (TreeView) input.getView(parseViewName); TreeView depTreeView = new TreeView(dependencyViewName, viewGenerator, input, 1d); int size = 0; for (int i = 0; i < input.getNumberOfSentences(); i++) { if (parseTreeView.getTree(i) != null) { Constituent parseTreeRoot = parseTreeView.getRootConstituent(i); Tree<Pair<String, Integer>> labeledDependencyTree = depParser.getLabeledDependencyTree(parseTreeRoot); try { depTreeView.setDependencyTree(i, labeledDependencyTree); } catch (IllegalStateException e) { System.err.println(parseTreeView); System.err.println("Unlabeled dependency tree (for debugging): "); System.err.println(depParser.getDependencyTree(parseTreeRoot)); throw e; } size += input.getSentence(i).size(); int nConstituents = depTreeView.getNumberOfConstituents(); if (nConstituents != size) { logger.error("{} nodes in dependency tree, " + "{} tokens in text so far", nConstituents, size); Set<Integer> set = new LinkedHashSet<>(); for (int tokenId = 0; tokenId < size; tokenId++) { set.add(tokenId); } for (Constituent c : depTreeView.getConstituents()) { set.remove(c.getStartSpan()); } StringBuilder sb = new StringBuilder(); for (int tokenId : set) { sb.append(input.getToken(tokenId)).append(" "); } logger.error("Dependency tree does not cover tokens: {}", sb.toString()); } } } return depTreeView; }
Source:
public void connectionChanged(IConnection connection, String property, Object oldValue, Object newValue) { if(connection.equals(ConnectionPropertySource.this.connection) && "extendedProperties".equals(property)) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { PropertySheet sh = null; try { sh = (PropertySheet)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.ui.views.PropertySheet"); } catch (NullPointerException exc) { } if(sh == null) return; IPage page = sh.getCurrentPage(); if(page instanceof TabbedPropertySheetPage) { TabbedPropertySheetPage p = (TabbedPropertySheetPage)page; if(p == null || p.getControl() == null || p.getControl().isDisposed()) return; p.refresh(); } else if(page instanceof PropertySheetPage) { PropertySheetPage p = (PropertySheetPage)page; if(p == null || p.getControl() == null || p.getControl().isDisposed()) return; p.refresh(); } } }); } }

Target:
public void connectionChanged(IConnection connection, String property, Object oldValue, Object newValue) { if(connection.equals(ConnectionPropertySource.this.connection) && IOpenShiftConnection.PROPERTY_EXTENDED_PROPERTIES.equals(property)) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { PropertySheet sh = OpenShiftUIUtils.getPropertySheet(); if(sh != null) { OpenShiftUIUtils.refreshPropertySheetPage(sh); } } }); } }
Source:
private void checkIfPatientWasCreatedProperly() { Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, String.format("%staskCreated", MOTECH_ID)); assertEquals(createdPatient.getUuid(), patient.getPerson().getPreferredAddress().getAddress2()); assertEquals(createdPatient.getPerson().getBirthdate().toString(), patient.getPerson().getPreferredAddress().getAddress1()); assertEquals(String.format("%staskCreated", MOTECH_ID), patient.getMotechId()); assertEquals(createdPatient.getPerson().getGender(), patient.getPerson().getGender()); }

Target:
private void checkIfPatientWasCreatedProperly() { Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, String.format("%staskCreated", MOTECH_ID)); assertEquals(createdPatient.getUuid(), patient.getPerson().getPreferredAddress().getAddress2()); assertEquals(createdPatient.getPerson().getBirthdate().toString(), patient.getPerson().getPreferredAddress().getAddress1()); assertEquals(String.format("%staskCreated", MOTECH_ID), patient.getMotechId()); assertEquals(createdPatient.getPerson().getGender(), patient.getPerson().getGender()); Person.Name actualName = patient.getPerson().getPreferredName(); assertEquals(createdPatient.getPerson().getDisplay(), actualName.getFamilyName()); assertEquals(createdPatient.getPerson().getDisplay(), actualName.getGivenName()); }
Source:
private String getXMI_ID(final EObject eobject) { if (eobject.eResource() instanceof XMIResource) { return ((XMIResource) eobject.eResource()).getID(eobject); } ; return null; }

Target:
private String getXMI_ID(final EObject eobject) { if (eobject.eResource() instanceof XMIResource) { return ((XMIResource) eobject.eResource()).getID(eobject); } return null; }
Source:
public List<GenericArtifact> parseArtifacts(String messagePayload) { if (!StringUtils.isNotBlank(messagePayload)) { log.warn("Attempted to parse artifacts from empty message."); return Collections.emptyList(); } ObjectMapper mapper = new ObjectMapper(); return readArtifactList(mapper, jinjaTransform(mapper, messagePayload)); }

Target:
public List<GenericArtifact> parseArtifacts(String messagePayload) { if (!StringUtils.isNotBlank(messagePayload)) { return Collections.emptyList(); } ObjectMapper mapper = new ObjectMapper(); return readArtifactList(mapper, jinjaTransform(mapper, messagePayload)); }
Source:
protected void addInPeriodListeners() { addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.TRUE, periodStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", false, jamEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.TRUE, jamStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.TRUE, timeoutStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, timeoutEndListener)); }

Target:
protected void addInPeriodListeners() { addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.TRUE, periodStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_PERIOD, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.FALSE, jamEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_JAM, "Running", Boolean.TRUE, jamStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, periodEndListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.TRUE, timeoutStartListener)); addScoreBoardListener(new ConditionalScoreBoardListener(Clock.class, Clock.ID_TIMEOUT, "Running", Boolean.FALSE, timeoutEndListener)); }
Source:
public ClipboardAction(final String name, final Transferable contents) { super(name, ImageProvider.get("copy", ImageSizes.SMALLICON)); this.contents = contents; popup = new JPopupMenu(); JLabel label = new JLabel(I18n.tr("Copied to clipboard…")); label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); popup.add(label); popup.setBackground(new Color(0f, 0f, 0f, .5f)); label.setForeground(Color.BLACK); }

Target:
public ClipboardAction(final String name, final Transferable contents) { super(name, ImageProvider.get("copy", ImageSizes.SMALLICON)); this.contents = contents; popup = new JPopupMenu(); JLabel label = new JLabel(I18n.tr("Copied to clipboard …")); label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); popup.add(label); popup.setBackground(new Color(0f, 0f, 0f, .5f)); label.setForeground(Color.WHITE); }
Source:
public void waitForFinish(Duration timeout) { throw new UnsupportedOperationException(getClass().getName() + " does not support waitForFinish."); }

Target:
public boolean waitForFinish(Duration timeout) { throw new UnsupportedOperationException(getClass().getName() + " does not support timed waitForFinish."); }
Source:
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next ) { return next.startCall(new ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) { @Override public void request(final int numMessages) { log.info("gRPC call: {}", call.getMethodDescriptor().getFullMethodName()); super.request(numMessages); } @Override public void close(final Status status, final Metadata trailers) { if (!status.isOk()) { log.error( "gRPC error: -> {}: {}", call.getMethodDescriptor().getFullMethodName(), String.valueOf(status.getCode().value()), (status.getCause() != null ? status.getCause().getMessage() : "?"), status.getCause() ); } super.close(status, trailers); } }, headers); }

Target:
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next ) { return next.startCall(new ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) { @Override public void request(final int numMessages) { log.info("gRPC call: {}", call.getMethodDescriptor().getFullMethodName()); super.request(numMessages); } @Override public void close(final Status status, final Metadata trailers) { if (!status.isOk()) { log.error( "gRPC error: -> {}: {}", call.getMethodDescriptor().getFullMethodName(), String.valueOf(status.getCode().value()), (status.getCause() != null ? status.getCause().getMessage() : NO_CAUSE), status.getCause() ); } super.close(status, trailers); } }, headers); }
Source:
public JGitTransportConfigCallback( GitScmProviderRepository repo, ScmLogger logger ) { if ( repo.getFetchInfo().getProtocol().equals( "ssh" ) ) { if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() == null ) { logger.debug( "using private key with passphrase: " + repo.getPrivateKey() ); sshSessionFactory = new UnprotectedPrivateKeySessionFactory( repo ); } else if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() != null ) { logger.debug( "using private key: " + repo.getPrivateKey() ); sshSessionFactory = new ProtectedPrivateKeyFileSessionFactory( repo ); } else { sshSessionFactory = new SimpleSessionFactory(); } } }

Target:
public JGitTransportConfigCallback( GitScmProviderRepository repo, ScmLogger logger ) { if ( repo.getFetchInfo().getProtocol().equals( "ssh" ) ) { if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() == null ) { logger.debug( "using private key: " + repo.getPrivateKey() ); sshSessionFactory = new UnprotectedPrivateKeySessionFactory( repo ); } else if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() != null ) { logger.debug( "using private key with passphrase: " + repo.getPrivateKey() ); sshSessionFactory = new ProtectedPrivateKeyFileSessionFactory( repo ); } else { sshSessionFactory = new SimpleSessionFactory(); } } }
Source:
public double protectionLeg( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { ArgChecker.notNull(cds, "cds"); ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(refData, "refData"); if (!cds.getProtectionEndDate().isAfter(ratesProvider.getValuationDate())) { return 0d; } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.getEffectiveStartDate(stepinDate); double recoveryRate = recoveryRate(cds, ratesProvider); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); return protectionLeg(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate); }

Target:
public double protectionLeg( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { if (isExpired(cds, ratesProvider)) { return 0d; } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); double recoveryRate = recoveryRate(cds, ratesProvider); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); return protectionLeg(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate); }
Source:
private void updatePosixProperties(IStorageModel storageModel) { PosixStorageModel posixModel = (PosixStorageModel) storageModel; connection.setVfsType(posixModel.getVfsType().getEntity().toString()); if (posixModel.getMountOptions().getEntity() != null) { connection.setMountOptions(posixModel.getMountOptions().getEntity()); } }

Target:
private void updatePosixProperties(IStorageModel storageModel) { PosixStorageModel posixModel = (PosixStorageModel) storageModel; connection.setVfsType(posixModel.getVfsType().getEntity().toString()); if (posixModel.getMountOptions().getEntity() != null) { connection.setMountOptions(posixModel.getMountOptions().getEntity().toString()); } }
Source:
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) { final View firstVisibleChild = recyclerView.getChildAt(0); final int itemHeight = firstVisibleChild.getHeight(); final int currentPosition = recyclerView.getChildLayoutPosition(firstVisibleChild); int distanceInPixels = Math.abs((currentPosition - position) * itemHeight); if (distanceInPixels == 0) { distanceInPixels = (int) Math.abs(firstVisibleChild.getY()); } final SmoothScroller smoothScroller = new SmoothScroller(recyclerView.getContext(), distanceInPixels, mDuration); smoothScroller.setTargetPosition(position); startSmoothScroll(smoothScroller); }

Target:
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) { final View firstVisibleChild = recyclerView.getChildAt(0); final int itemHeight = firstVisibleChild.getHeight(); final int currentPosition = recyclerView.getChildAdapterPosition(firstVisibleChild); int distanceInPixels = Math.abs((currentPosition - position) * itemHeight); if (distanceInPixels == 0) { distanceInPixels = (int) Math.abs(firstVisibleChild.getY()); } final SmoothScroller smoothScroller = new SmoothScroller(recyclerView.getContext(), distanceInPixels, mDuration); smoothScroller.setTargetPosition(position); startSmoothScroll(smoothScroller); }
Source:
private void performCleanupCacheStorage(DataObject destOnStore) { destOnStore.processEvent(Event.DestroyRequested); DeleteCommand deleteCommand = new DeleteCommand(destOnStore.getTO()); EndPoint ep = selector.select(destOnStore); try { if (ep == null) { LOGGER.warn("Unable to cleanup staging NFS because no endpoint was found " + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } else { Answer deleteAnswer = ep.sendMessage(deleteCommand); if (deleteAnswer != null && deleteAnswer.getResult()) { LOGGER.warn("Unable to cleanup staging NFS " + deleteAnswer.getDetails() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } } destOnStore.processEvent(Event.OperationSuccessed); } catch (Exception e) { LOGGER.warn("Unable to clean up staging cache Exception " + e.getMessage() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); } }

Target:
private void performCleanupCacheStorage(DataObject destOnStore) { destOnStore.processEvent(Event.DestroyRequested); DeleteCommand deleteCommand = new DeleteCommand(destOnStore.getTO()); EndPoint ep = selector.select(destOnStore); try { if (ep == null) { LOGGER.warn("Unable to cleanup staging NFS because no endpoint was found " + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } else { Answer deleteAnswer = ep.sendMessage(deleteCommand); if (deleteAnswer != null && deleteAnswer.getResult()) { LOGGER.warn("Unable to cleanup staging NFS " + deleteAnswer.getDetails() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); destOnStore.processEvent(Event.OperationFailed); } } destOnStore.processEvent(Event.OperationSuccessed); } catch (Exception e) { destOnStore.processEvent(Event.OperationFailed); LOGGER.warn("Unable to clean up staging cache Exception " + e.getMessage() + "Object: " + destOnStore.getType() + " ID: " + destOnStore.getId()); } }
Source:
public void removeTables(Set<TableReference> tableRefs) { if (kv.getAllTableNames().contains(AtlasDbConstants.NAMESPACE_TABLE)) { Multimap<Cell, Long> deletionMap = tableRefs.stream() .map(tableRef -> Cell.create(getBytesForTableRef(tableRef), AtlasDbConstants.NAMESPACE_SHORT_COLUMN_BYTES)) .collect(Multimaps.toMultimap( key -> key, unused -> AtlasDbConstants.TRANSACTION_TS, MultimapBuilder.hashKeys().arrayListValues()::build)); kv.delete(AtlasDbConstants.NAMESPACE_TABLE, deletionMap); } while (true) { BiMap<TableReference, TableReference> existingMap = tableMap.get(); BiMap<TableReference, TableReference> newMap = HashBiMap.create(existingMap); tableRefs.forEach(newMap::remove); if (tableMap.compareAndSet(existingMap, newMap)) { return; } } }

Target:
public void removeTables(Set<TableReference> tableRefs) { if (kvs.getAllTableNames().contains(AtlasDbConstants.NAMESPACE_TABLE)) { Multimap<Cell, Long> deletionMap = tableRefs.stream() .map(KvTableMappingService::getKeyCellForTable) .collect(Multimaps.toMultimap( key -> key, unused -> AtlasDbConstants.TRANSACTION_TS, MultimapBuilder.hashKeys().arrayListValues()::build)); kvs.delete(AtlasDbConstants.NAMESPACE_TABLE, deletionMap); } tableMap.updateAndGet(oldTableMap -> invalidateTables(oldTableMap, tableRefs)); }
Source:
public void dispose() { for (IUndoableOperation element : children) { (element).dispose(); } if (triggeringOperation != null) { triggeringOperation.dispose(); } }

Target:
public void dispose() { for (IUndoableOperation operation : children) { operation.dispose(); } if (triggeringOperation != null) { triggeringOperation.dispose(); } }
Source:
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); ReadableConfig config = env.getTaskManagerInfo().getConfiguration(); int fsReadBufferSize = config.get(CheckpointingOptions.FS_READ_BUFFER_SIZE); return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), fsReadBufferSize, ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), taskStateManager.createLocalRecoveryConfig(), priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }

Target:
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), taskStateManager.createLocalRecoveryConfig(), priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }
Source:
private void resize() { final int[] oldKeys = keys; final int oldsize = oldKeys.length; final AdvancedExternalizer[] oldValues = values; if (oldsize >= 0x40000000) { throw new IllegalStateException("Table full"); } final int newsize = oldsize << 1; final int mask = newsize - 1; final int[] newKeys = new int[newsize]; final AdvancedExternalizer[] newValues = new AdvancedExternalizer[newsize]; keys = newKeys; values = newValues; if ((resizeCount <<= 1) == 0) { resizeCount = Integer.MAX_VALUE; } for (int oi = 0; oi < oldsize; oi ++) { final int key = oldKeys[oi]; if (oldValues[oi] != null) { int ni = key & mask; for (;;) { final int k = newKeys[ni]; if (newValues[ni] == null) { newKeys[ni] = key; newValues[ni] = oldValues[oi]; break; } ni = (ni + 1) & mask; } } } }

Target:
private void resize() { final int[] oldKeys = keys; final int oldsize = oldKeys.length; final AdvancedExternalizer[] oldValues = values; if (oldsize >= 0x40000000) { throw new IllegalStateException("Table full"); } final int newsize = oldsize << 1; final int mask = newsize - 1; final int[] newKeys = new int[newsize]; final AdvancedExternalizer[] newValues = new AdvancedExternalizer[newsize]; keys = newKeys; values = newValues; if ((resizeCount <<= 1) == 0) { resizeCount = Integer.MAX_VALUE; } for (int oi = 0; oi < oldsize; oi ++) { final int key = oldKeys[oi]; if (oldValues[oi] != null) { int ni = key & mask; for (;;) { if (newValues[ni] == null) { newKeys[ni] = key; newValues[ni] = oldValues[oi]; break; } ni = (ni + 1) & mask; } } } }
Source:
public boolean isDateType(IAttributeType attributeType) { return asdf; }

Target:
public boolean isDateType(IAttributeType attributeType) { return atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().isDateType(attributeType); }
Source:
private static String loadClientHzConfig() { File file = new File("client-hazelcast.xml"); LOGGER.info("Loading Hazelcast client configuration: " + file.getAbsolutePath()); return fileAsText(file); }

Target:
private static String loadClientHzConfig() { File file = new File(getDefaultConfigurationFile("client-hazelcast.xml")); LOGGER.info("Loading Hazelcast client configuration: " + file.getAbsolutePath()); return fileAsText(file); }
Source:
public Response add(DataCenter dataCenter) { validateParameters(dataCenter, "name"); validateEnums(DataCenter.class, dataCenter); if (dataCenter.isSetStorageType()) { validateEnum(StorageType.class, dataCenter.getStorageType().toUpperCase()); } else if(!dataCenter.isSetLocal()) { validateParameters(dataCenter, "local"); } StoragePool entity = map(dataCenter); if (entity.getcompatibility_version().isNotValid()) { entity.setcompatibility_version(Version.getLast()); } return performCreate(VdcActionType.AddEmptyStoragePool, new StoragePoolManagementParameter(entity), new QueryIdResolver<Guid>(VdcQueryType.GetStoragePoolById, IdQueryParameters.class)); }

Target:
public Response add(DataCenter dataCenter) { validateParameters(dataCenter, "name"); validateEnums(DataCenter.class, dataCenter); if (dataCenter.isSetStorageType()) { validateEnum(StorageType.class, dataCenter.getStorageType().toUpperCase()); } else if(!dataCenter.isSetLocal()) { validateParameters(dataCenter, "local"); } StoragePool entity = map(dataCenter); return performCreate(VdcActionType.AddEmptyStoragePool, new StoragePoolManagementParameter(entity), new QueryIdResolver<Guid>(VdcQueryType.GetStoragePoolById, IdQueryParameters.class)); }
Source:
protected boolean canDoAction() { if(!super.canDoAction()) { return false; } return true; }

Target:
protected boolean canDoAction() { if(!super.canDoAction()) { return false; } GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!glusterVolume.isOnline()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } return true; }