auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public IStyledString.IComposedStyledString getStyledText(Object object) { final AttributeChange attChange = (AttributeChange)object; final String valueText = getValueText(attChange); final String attributeText = getAttributeText(attChange); ComposedStyledString ret = new ComposedStyledString(); final Object attChangeValue = attChange.getValue(); if (attChangeValue instanceof EObject && ((EObject)attChangeValue).eIsProxy()) { StyleBuilder sb = new StyleBuilder(); sb.setFont(IItemFontProvider.ITALIC_FONT); ret.append(valueText, sb.build()); } else { ret.append(valueText); } ret.append(" [" + attributeText, Style.DECORATIONS_STYLER); switch (attChange.getKind()) { case ADD: ret.append(" add", Style.DECORATIONS_STYLER); break; case DELETE: ret.append(" delete", Style.DECORATIONS_STYLER); break; case CHANGE: ret.append( " " + ReferenceChangeItemProviderSpec.changeText(attChange, attChange.getAttribute()), Style.DECORATIONS_STYLER); break; case MOVE: ret.append(" move", Style.DECORATIONS_STYLER); break; default: throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() + " value: " + attChange.getKind()); } ret.append("]", Style.DECORATIONS_STYLER); return ret; }

Target:
public IStyledString.IComposedStyledString getStyledText(Object object) { final AttributeChange attChange = (AttributeChange)object; final String valueText = getValueText(attChange); final String attributeText = getAttributeText(attChange); ComposedStyledString ret = new ComposedStyledString(); final Object attChangeValue = attChange.getValue(); if (attChangeValue instanceof EObject && ((EObject)attChangeValue).eIsProxy()) { Style italic = Style.builder().setFont(IItemFontProvider.ITALIC_FONT).build(); ret.append(valueText, italic); } else { ret.append(valueText); } ret.append(" [" + attributeText, Style.DECORATIONS_STYLER); switch (attChange.getKind()) { case ADD: ret.append(" add", Style.DECORATIONS_STYLER); break; case DELETE: ret.append(" delete", Style.DECORATIONS_STYLER); break; case CHANGE: ret.append( " " + ReferenceChangeItemProviderSpec.changeText(attChange, attChange.getAttribute()), Style.DECORATIONS_STYLER); break; case MOVE: ret.append(" move", Style.DECORATIONS_STYLER); break; default: throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() + " value: " + attChange.getKind()); } ret.append("]", Style.DECORATIONS_STYLER); return ret; }
Source:
private boolean isThreadLocalRequired(InvocationContext context) { return context.getClassLoader() != null && context.getClassLoader() != Configurations.getClassLoader(configuration, globalConfiguration); }

Target:
private boolean isThreadLocalRequired(InvocationContext context) { return context.getClassLoader() != null && context.getClassLoader() != configuredClassLoader; }
Source:
private int createHashCode() { int result = System.identityHashCode( scriptEvaluatorFactory ); result = 31 * result + System.identityHashCode( clockProvider ); result = 31 * result + ( temporalValidationTolerance != null ? temporalValidationTolerance.hashCode() : 0 ); result = 31 * result + System.identityHashCode( constraintValidatorPayload ); return result; }

Target:
private int createHashCode() { int result = System.identityHashCode( scriptEvaluatorFactory ); result = 31 * result + System.identityHashCode( clockProvider ); result = 31 * result + temporalValidationTolerance.hashCode(); result = 31 * result + System.identityHashCode( constraintValidatorPayload ); return result; }
Source:
protected R replace(R restModel, Operation operation) throws UnprocessableEntityException, PatchBadRequestException { throw new UnprocessableEntityException( "The remove operation is not supported." ); }

Target:
protected R replace(R restModel, Operation operation) throws UnprocessableEntityException, PatchBadRequestException { throw new UnprocessableEntityException( "The replace operation is not supported." ); }
Source:
private ModelEntity cloneEntityExcludingEditorComponents(ModelEntity source) { ModelEntity clone = new ModelEntity(); for (Field field : ClassReflection.getDeclaredFields(source.getClass())) { field.setAccessible(true); if (field.getName().equals("components")) { clone.setComponents(new ArrayList<ModelComponent>()); for (ModelComponent sourceComponent : source.getComponents()) { if (!sourceComponent.getClass().getCanonicalName() .contains("es.eucm.ead.schema.editor.components")) { clone.getComponents().add(sourceComponent); } } } else if (field.getName().equals("children")) { clone.setChildren(new ArrayList<ModelEntity>()); for (ModelEntity child : source.getChildren()) { clone.getChildren().add( cloneEntityExcludingEditorComponents(child)); } } else { try { field.set(clone, field.get(source)); } catch (ReflectionException e) { Gdx.app.debug( "Exporter.cloneEntityExcludingEditorComponents", "Error while removing editor components from ModelEntitye " + source, e); } } } return clone; }

Target:
private ModelEntity cloneEntityExcludingEditorComponents(ModelEntity source) { ModelEntity clone = new ModelEntity(); for (Field field : ClassReflection.getDeclaredFields(source.getClass())) { field.setAccessible(true); if (field.getName().equals(FieldNames.COMPONENTS.toString())) { for (ModelComponent sourceComponent : source.getComponents()) { if (!sourceComponent.getClass().getCanonicalName() .contains(EDITOR_COMPONENTS_PACKAGE)) { clone.getComponents().add(sourceComponent); } } } else if (field.getName().equals(FieldNames.CHILDREN.toString())) { for (ModelEntity child : source.getChildren()) { clone.getChildren().add( cloneEntityExcludingEditorComponents(child)); } } else { try { field.set(clone, field.get(source)); } catch (ReflectionException e) { Gdx.app.debug( "Exporter.cloneEntityExcludingEditorComponents", "Error while removing editor components from ModelEntitye " + source, e); } } } return clone; }
Source:
public void newRow() { rows.add(new RowBuilder()); currentRow = rows.get(rows.indexOf(currentRow) + 1); }

Target:
void newRow() { int indexOfCurrentRow = rows.indexOf(currentRow); if (indexOfCurrentRow == rows.size() - 1) { currentRow = new RowBuilder(); rows.add(currentRow); } else { currentRow = rows.get(rows.indexOf(currentRow) + 1); } }
Source:
public SearchRequestBuilder excludeSource(boolean value) { this.excludeSource = value; return this; }

Target:
public SearchRequestBuilder excludeSource(boolean value) { if (value) { Assert.hasNoText(this.fields, String.format("_source section can't be excluded if fields [%s] are requested", this.fields)); } this.excludeSource = value; return this; }
Source:
public static long zip(File directory, OutputStream out) throws IOException { if (!directory.isDirectory()) { throw new IOE("directory[%s] is not a directory", directory); } final File[] files = directory.listFiles(); long totalSize = 0; try (final ZipOutputStream zipOut = new ZipOutputStream(out)) { for (File file : files) { log.info("Adding file[%s] with size[%,d]. Total size so far[%,d]", file, file.length(), totalSize); if (file.length() >= Integer.MAX_VALUE) { zipOut.finish(); throw new IOE("file[%s] too large [%,d]", file, file.length()); } zipOut.putNextEntry(new ZipEntry(file.getName())); totalSize += Files.asByteSource(file).copyTo(zipOut); } zipOut.closeEntry(); zipOut.flush(); if (out instanceof FileOutputStream) { ((FileOutputStream) out).getChannel().force(true); } } return totalSize; }

Target:
public static long zip(File directory, OutputStream out) throws IOException { if (!directory.isDirectory()) { throw new IOE("directory[%s] is not a directory", directory); } final ZipOutputStream zipOut = new ZipOutputStream(out); long totalSize = 0; for (File file : directory.listFiles()) { log.info("Adding file[%s] with size[%,d]. Total size so far[%,d]", file, file.length(), totalSize); if (file.length() >= Integer.MAX_VALUE) { zipOut.finish(); throw new IOE("file[%s] too large [%,d]", file, file.length()); } zipOut.putNextEntry(new ZipEntry(file.getName())); totalSize += Files.asByteSource(file).copyTo(zipOut); } zipOut.closeEntry(); zipOut.flush(); zipOut.finish(); return totalSize; }
Source:
public abstract void execute() throws SQLException; public String getFlywayVersion() { String retval = ""; String releasePart = myProductVersion; if (releasePart.startsWith("V")) { releasePart = releasePart.substring(1); } return releasePart + "." + mySchemaVersion; }

Target:
public abstract void execute() throws SQLException; public String getFlywayVersion() { String releasePart = myProductVersion; if (releasePart.startsWith("V")) { releasePart = releasePart.substring(1); } return releasePart + "." + mySchemaVersion; }
Source:
protected void executeImport() { importModel.importVms( new IFrontendMultipleActionAsyncCallback() { @Override public void executed( FrontendMultipleActionAsyncResult result) { VmBackupModel vmBackupModel = VmBackupModel.this; vmBackupModel.getWindow().stopProgress(); vmBackupModel.cancel(); ArrayList<VdcReturnValueBase> retVals = (ArrayList<VdcReturnValueBase>) result .getReturnValue(); if (retVals != null && vmBackupModel.getSelectedItems().size() == retVals .size()) { StringBuilder importedVms = new StringBuilder(); int counter = 0; boolean toShowConfirmWindow = false; for (Object item : vmBackupModel.getSelectedItems()) { VM vm = (VM) item; if (retVals.get(counter) != null && retVals.get(counter).getCanDoAction()) { importedVms.append(vm.getName()).append(", "); toShowConfirmWindow = true; } counter++; } if (toShowConfirmWindow) { ConfirmationModel confirmModel = new ConfirmationModel(); vmBackupModel.setConfirmWindow(confirmModel); confirmModel.setTitle(ConstantsManager.getInstance() .getConstants() .importVirtualMachinesTitle()); confirmModel.setHelpTag(HelpTag.import_virtual_machine); confirmModel.setHashName("import_virtual_machine"); confirmModel.setMessage(ConstantsManager.getInstance() .getMessages() .importProcessHasBegunForVms(StringHelper.trimEnd(importedVms.toString().trim(), ','))); UICommand tempVar2 = new UICommand("CancelConfirm", vmBackupModel); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().close()); tempVar2.setIsDefault(true); tempVar2.setIsCancel(true); confirmModel.getCommands().add(tempVar2); } } } }, cloneObjectMap); }

Target:
protected void executeImport() { importModel.importVms( new IFrontendMultipleActionAsyncCallback() { @Override public void executed( FrontendMultipleActionAsyncResult result) { getWindow().stopProgress(); cancel(); ArrayList<VdcReturnValueBase> retVals = (ArrayList<VdcReturnValueBase>) result .getReturnValue(); if (retVals != null && getSelectedItems().size() == retVals .size()) { StringBuilder importedVms = new StringBuilder(); int counter = 0; boolean toShowConfirmWindow = false; for (Object item : getSelectedItems()) { VM vm = (VM) item; if (retVals.get(counter) != null && retVals.get(counter).getCanDoAction()) { importedVms.append(vm.getName()).append(", "); toShowConfirmWindow = true; } counter++; } if (toShowConfirmWindow) { ConfirmationModel confirmModel = new ConfirmationModel(); setConfirmWindow(confirmModel); confirmModel.setTitle(ConstantsManager.getInstance() .getConstants() .importVirtualMachinesTitle()); confirmModel.setHelpTag(HelpTag.import_virtual_machine); confirmModel.setHashName("import_virtual_machine"); confirmModel.setMessage(ConstantsManager.getInstance() .getMessages() .importProcessHasBegunForVms(StringHelper.trimEnd(importedVms.toString().trim(), ','))); UICommand tempVar2 = new UICommand("CancelConfirm", VmBackupModel.this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().close()); tempVar2.setIsDefault(true); tempVar2.setIsCancel(true); confirmModel.getCommands().add(tempVar2); } } } }, cloneObjectMap); }
Source:
protected Set<Tuple> tryFindCounterPart(final Tuple first, boolean findPositiveCounterPart, boolean findAll) { DefaultMailbox monotoneQueue = getActiveMonotoneQueue(); DefaultMailbox nonMonotoneQueue = getActiveNonMonotoneQueue(); final TupleMask coreMask = receiver.getCoreMask(); final TupleMask posetMask = receiver.getPosetMask(); final IPosetComparator posetComparator = receiver.getPosetComparator(); final Set<Tuple> result = new HashSet<Tuple>(); final Tuple firstKey = coreMask.transform(first); final Tuple firstValue = posetMask.transform(first); if (findPositiveCounterPart) { for (Tuple second : monotoneQueue.keySet()) { Integer count = monotoneQueue.get(second); if (count > 0) { final Tuple secondKey = coreMask.transform(second); if (firstKey.equals(secondKey)) { Tuple secondValue = posetMask.transform(second); if (posetComparator.isLessOrEqual(firstValue, secondValue)) { result.add(second); if (!findAll) { return result; } } } } } } else { for (Tuple second : nonMonotoneQueue.keySet()) { Integer count = nonMonotoneQueue.get(second); assert count < 0; final Tuple secondKey = coreMask.transform(second); if (firstKey.equals(secondKey)) { Tuple secondValue = posetMask.transform(second); if (posetComparator.isLessOrEqual(secondValue, firstValue)) { result.add(second); if (!findAll) { return result; } } } } } return result; }

Target:
protected Set<Tuple> tryFindCounterPart(final Tuple first, boolean findPositiveCounterPart, boolean findAll) { DefaultMailbox monotoneQueue = getActiveMonotoneQueue(); DefaultMailbox antiMonotoneQueue = getActiveAntiMonotoneQueue(); final TupleMask coreMask = receiver.getCoreMask(); final TupleMask posetMask = receiver.getPosetMask(); final IPosetComparator posetComparator = receiver.getPosetComparator(); final Set<Tuple> result = new HashSet<Tuple>(); final Tuple firstKey = coreMask.transform(first); final Tuple firstValue = posetMask.transform(first); if (findPositiveCounterPart) { for (Tuple second : monotoneQueue.keySet()) { Integer count = monotoneQueue.get(second); if (count > 0) { final Tuple secondKey = coreMask.transform(second); if (firstKey.equals(secondKey)) { Tuple secondValue = posetMask.transform(second); if (posetComparator.isLessOrEqual(firstValue, secondValue)) { result.add(second); if (!findAll) { return result; } } } } } } else { for (Tuple second : antiMonotoneQueue.keySet()) { Integer count = antiMonotoneQueue.get(second); assert count < 0; final Tuple secondKey = coreMask.transform(second); if (firstKey.equals(secondKey)) { Tuple secondValue = posetMask.transform(second); if (posetComparator.isLessOrEqual(secondValue, firstValue)) { result.add(second); if (!findAll) { return result; } } } } } return result; }
Source:
public void firstDerivativeTest() { double a = 1.0; double b = 1.5; double c = -0.5; double[] x = new double[] {0., 2., 5. }; int n = x.length; double[] y = new double[n]; for (int i = 0; i < n; i++) { y[i] = a + b * x[i] + c * x[i] * x[i]; } Interpolator1DDataBundle db = INTERPOLATOR.getDataBundle(x, y); Double grad = INTERPOLATOR.firstDerivative(db, x[n - 1]); assertEquals(b + 2 * c * x[n - 1], grad, 1e-15); } }

Target:
public void firstDerivativeTest() { double a = 1.34; double b = 7.0 / 3.0; double c = -0.52; double[] x = new double[] {-11.0 / 2.3, 0.0, 0.01, 2.71, 17.0 / 3.2 }; int n = x.length; double[] y = new double[n]; for (int i = 0; i < n; i++) { y[i] = a + b * x[i] + c * x[i] * x[i]; } Interpolator1DDataBundle db = INTERPOLATOR.getDataBundle(x, y); Double grad = INTERPOLATOR.firstDerivative(db, x[n - 1]); assertEquals(b + 2 * c * x[n - 1], grad, 1e-15); }
Source:
public void testCreateMtlsKeyStoreNoPrivateKey() throws Exception { final InputStream privateKeyMissing = getClass().getClassLoader().getResourceAsStream("com/google/api/client/util/cert.pem"); IllegalArgumentException exception = assertThrows( IllegalArgumentException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { SecurityUtils.createMtlsKeyStore(privateKeyMissing); } }); assertThat(exception) .hasMessageThat() .isEqualTo("private key is missing from certAndKey string"); }

Target:
public void testCreateMtlsKeyStoreNoPrivateKey() throws Exception { final InputStream privateKeyMissing = getClass().getClassLoader().getResourceAsStream("com/google/api/client/util/cert.pem"); boolean thrown = false; try { SecurityUtils.createMtlsKeyStore(privateKeyMissing); fail("should have thrown"); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains("private key is missing from certAndKey string")); thrown = true; } assertTrue("should have caught an IllegalArgumentException", thrown); }
Source:
public String getSelection() { if (fSelection == null) { return ""; } else { return fSelection; } }

Target:
public String getSelection() { return fSelection; }
Source:
private void updateConfiguration(List<HudsonModelJob> jobs) { Map<String, String> jobNameById = new HashMap<String, String>(); for (HudsonModelJob job : jobs) { String jobUrl = job.getUrl(); if (jobUrl != null && hudsonUrlUtil.isNestedJob(jobUrl)) { jobNameById.put(jobUrl, jobUrl); } else { jobNameById.put(job.getName(), jobUrl); } } HudsonConfiguration configuration = new HudsonConfiguration(); configuration.jobNameById = jobNameById; setConfiguration(configuration); }

Target:
private void updateConfiguration(List<HudsonModelJob> jobs) throws HudsonException { Map<String, String> jobNameById = new HashMap<String, String>(); for (HudsonModelJob job : jobs) { String jobUrl = job.getUrl(); String displayName = hudsonUrlUtil.getDisplayName(jobUrl); if (jobUrl != null && hudsonUrlUtil.isNestedJob(jobUrl)) { jobNameById.put(jobUrl, displayName); } else { jobNameById.put(job.getName(), displayName); } } HudsonConfiguration configuration = new HudsonConfiguration(); configuration.jobNameById = jobNameById; setConfiguration(configuration); }
Source:
public void sync(Agents agents) { syncWithDB(agents); agentInstances.sync(agents); }

Target:
public void sync(Agents agents) { agentInstances.sync(agents); }
Source:
public Contribution getContributionWithFileName(String uri) { List<Contribution> contributionWithUri = contributionDao.getContributionWithTitle(uri); if(null!=contributionWithUri && contributionWithUri.size()>0){ return contributionWithUri.get(0); } return null; }

Target:
public Contribution getContributionWithFileName(String uri) { List<Contribution> contributionWithUri = contributionDao.getContributionWithTitle(uri); if(!contributionWithUri.isEmpty()){ return contributionWithUri.get(0); } return null; }
Source:
public String fetchPathwayNameFailSafe(String reactomeId) { String reactomeURL = "<LINK_0>{0}/displayName"; String url = MessageFormat.format(reactomeURL, reactomeId); try { return StringUtils.trim(restTemplate.getForObject(url, String.class)); } catch (RestClientException e) { LOGGER.warn("Reactome ID \"{}\" could not be found", reactomeId); return ""; } }

Target:
public Optional<String> fetchPathwayNameFailSafe(String reactomeId) { String reactomeURL = "<LINK_0>{0}/displayName"; String url = MessageFormat.format(reactomeURL, reactomeId); try { return Optional.of(StringUtils.trim(restTemplate.getForObject(url, String.class))); } catch (RestClientException e) { LOGGER.warn("Reactome ID \"{}\" could not be found", reactomeId); return Optional.empty(); } }
Source:
private void addToIndex(URL url) { InputStream fs = null; try { fs = url.openStream(); indexer.index(fs); } catch (IOException ex) { } finally { try { if (fs != null) { fs.close(); } } catch (IOException ex) { } } }

Target:
private void addToIndex(URL url) { InputStream fs = null; try { fs = url.openStream(); indexer.index(fs); } catch (IOException ex) { log.warn(UNABLE_TO_OPEN_STREAM_MESSAGE, ex); } finally { try { if (fs != null) { fs.close(); } } catch (IOException ex) { log.warn(UNABLE_TO_CLOSE_STREAM_MESSAGE, ex); } } }
Source:
public void worldIsRound() { factory.createBoard(new Square[][]{{s1}}); Arrays.stream(Direction.values()).forEach((dir) -> assertThat(s1.getSquareAt(dir)).isEqualTo(s1) ); }

Target:
void worldIsRound() { factory.createBoard(new Square[][]{{s1}}); assertThat(Arrays.stream(Direction.values()).map(s1::getSquareAt)).containsOnly(s1); }
Source:
public void run_basic_subversion_build() throws SubversionPluginTestException { final SvnContainer svnContainer = svn.get(); final FreeStyleJob f = jenkins.jobs.create(); f.useScm(SubversionScm.class).url.set(svnContainer.getUrlUnsaveRepo()); f.addShellStep("test -d .svn"); f.save(); Build b = f.startBuild().shouldSucceed(); assertThat(b.getConsole(), Matchers.containsRegexp("test -d .svn", Pattern.MULTILINE)); }

Target:
public void run_basic_subversion_build() throws SubversionPluginTestException { final SvnContainer svnContainer = svn.get(); final FreeStyleJob f = jenkins.jobs.create(); f.useScm(SubversionScm.class).url.set(svnContainer.getUrlUnsaveRepo()); f.addShellStep("test -d .svn"); f.save(); Build b = f.startBuild().shouldSucceed(); assertThat(b.getConsole(), Matchers.containsString("test -d .svn")); }
Source:
public static void loadLibraryFromJar(String path) throws Exception { checkArgument(path.startsWith("/"), "absolute path must start with /"); String[] parts = path.split("/"); String filename = (parts.length > 0) ? parts[parts.length - 1] : null; File dir = File.createTempFile("native", ""); if (!(dir.mkdir())) { throw new IOException("Failed to create temp directory " + dir.getAbsolutePath()); } dir.deleteOnExit(); File temp = new File(dir, filename); temp.deleteOnExit(); byte[] buffer = new byte[1024]; int read; InputStream input = NativeUtils.class.getResourceAsStream(path); try { if (input == null) { throw new FileNotFoundException("Couldn't find file into jar " + path); } OutputStream out = new FileOutputStream(temp); try { while ((read = input.read(buffer)) != -1) { out.write(buffer, 0, read); } } finally { out.close(); } } finally { input.close(); } if (!temp.exists()) { throw new FileNotFoundException("Failed to copy file from jar at " + temp.getAbsolutePath()); } System.load(temp.getAbsolutePath()); }

Target:
public static void loadLibraryFromJar(String path) throws Exception { checkArgument(path.startsWith("/"), "absolute path must start with /"); String[] parts = path.split("/"); String filename = (parts.length > 0) ? parts[parts.length - 1] : null; File dir = File.createTempFile("native", ""); if (!(dir.mkdir())) { throw new IOException("Failed to create temp directory " + dir.getAbsolutePath()); } dir.deleteOnExit(); File temp = new File(dir, filename); temp.deleteOnExit(); byte[] buffer = new byte[1024]; int read; try (InputStream input = NativeUtils.class.getResourceAsStream(path); OutputStream out = new FileOutputStream(temp)) { if (input == null) { throw new FileNotFoundException("Couldn't find file into jar " + path); } while ((read = input.read(buffer)) != -1) { out.write(buffer, 0, read); } } if (!temp.exists()) { throw new FileNotFoundException("Failed to copy file from jar at " + temp.getAbsolutePath()); } System.load(temp.getAbsolutePath()); }
Source:
private boolean isNameUnique(E data) { for (E item : getEntities().getItems()) { if (data != item && data.getName().equals(item.getName())) { return false; } } return true; }

Target:
private boolean isNameUnique(E data) { return getEntities().getItems() .stream() .noneMatch(item -> data != item && data.getName().equals(item.getName())); }
Source:
public List<FieldInfo> findIterableFields(Class<?> iteratedType, String relationshipType, Direction relationshipDirection, boolean strict) { List<FieldInfo> iterableFields = new ArrayList<>(); for (FieldInfo fieldInfo : findIterableFields(iteratedType)) { String relationship = strict ? fieldInfo.relationshipTypeAnnotation() : fieldInfo.relationship(); if (relationshipType.equals(relationship)) { if (((fieldInfo.relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.INCOMING) || fieldInfo .relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.UNDIRECTED)) && relationshipDirection.equals(Direction.INCOMING)) || (relationshipDirection.equals(Direction.OUTGOING) && !(fieldInfo .relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.INCOMING)))) { iterableFields.add(fieldInfo); } } } return iterableFields; }

Target:
public List<FieldInfo> findIterableFields(Class<?> iteratedType, String relationshipType, Direction relationshipDirection, boolean strict) { List<FieldInfo> iterableFields = new ArrayList<>(); for (FieldInfo fieldInfo : findIterableFields(iteratedType)) { String relationship = strict ? fieldInfo.relationshipTypeAnnotation() : fieldInfo.relationship(); if (relationshipType.equals(relationship)) { Direction declaredDirection = fieldInfo.relationshipDirectionOrDefault(Direction.OUTGOING); if (isActualDirectionCompatibleWithDeclaredDirection(relationshipDirection, declaredDirection)) { iterableFields.add(fieldInfo); } } } return iterableFields; }
Source:
public void onEvent(Event event, Object source, Object data) { XWikiDocument xwikiDoc = (XWikiDocument) source; String familyId = xwikiDoc.getDocumentReference().getName(); Family family = this.familyRepository.getFamilyById(familyId); if (event instanceof PatientDeletedEvent) { String patientId = (String) data; Patient p = this.patientRepository.getPatientById(patientId); family.removeMember(p); } else { family.updatePermissions(); } }

Target:
public void onEvent(Event event, Object source, Object data) { XWikiDocument xwikiDoc = (XWikiDocument) source; String patientId = xwikiDoc.getDocumentReference().getName(); Patient patient = this.patientRepository.getPatientById(patientId); Family family = this.familyRepository.getFamilyForPatient(patient); if (family == null) { return; } if (event instanceof PatientDeletedEvent) { family.removeMember(patient); } else { family.updatePermissions(); } }
Source:
public QuantileDigest(Slice serialized) { SliceInput input = new BasicSliceInput(serialized); maxError = input.readDouble(); alpha = input.readDouble(); if (alpha == 0.0) { ticker = noOpTicker(); } else { ticker = Ticker.systemTicker(); } min = input.readLong(); max = input.readLong(); int nodeCount = input.readInt(); counts = new double[nodeCount]; for (int i = 0; i < nodeCount; i++) { double count = input.readDouble(); weightedCount += count; counts[i] = count; } levels = new byte[nodeCount]; for (int i = 0; i < nodeCount; i++) { levels[i] = input.readByte(); } values = new long[nodeCount]; for (int i = 0; i < nodeCount; i++) { values[i] = input.readLong(); } int[] stack = new int[(Integer.highestOneBit(nodeCount - 1) << 1) + 1]; int top = -1; lefts = new int[nodeCount]; rights = new int[nodeCount]; for (int node = 0; node < nodeCount; node++) { byte flags = input.readByte(); if ((flags & Flags.HAS_RIGHT) != 0) { rights[node] = stack[top--]; } else { rights[node] = -1; } if ((flags & Flags.HAS_LEFT) != 0) { lefts[node] = stack[top--]; } else { lefts[node] = -1; } stack[++top] = node; } checkArgument(nodeCount == 0 || top == 0, "Tree is corrupted. Expected a single root node"); root = nodeCount - 1; nextNode = nodeCount; }

Target:
public QuantileDigest(Slice serialized) { SliceInput input = new BasicSliceInput(serialized); maxError = input.readDouble(); alpha = input.readDouble(); if (alpha == 0.0) { ticker = noOpTicker(); } else { ticker = Ticker.systemTicker(); } min = input.readLong(); max = input.readLong(); int nodeCount = input.readInt(); int numberOfLevels = MAX_BITS - Long.numberOfLeadingZeros(min ^ max) + 1; double k = 3 * numberOfLevels / maxError; checkArgument(nodeCount <= 2 * k, "Too many nodes in deserialized tree. Possible corruption"); counts = new double[nodeCount]; for (int i = 0; i < nodeCount; i++) { double count = input.readDouble(); weightedCount += count; counts[i] = count; } levels = new byte[nodeCount]; for (int i = 0; i < nodeCount; i++) { levels[i] = input.readByte(); } values = new long[nodeCount]; for (int i = 0; i < nodeCount; i++) { values[i] = input.readLong(); } int[] stack = new int[(Integer.highestOneBit(nodeCount - 1) << 1) + 1]; int top = -1; lefts = new int[nodeCount]; rights = new int[nodeCount]; for (int node = 0; node < nodeCount; node++) { byte flags = input.readByte(); if ((flags & Flags.HAS_RIGHT) != 0) { rights[node] = stack[top--]; } else { rights[node] = -1; } if ((flags & Flags.HAS_LEFT) != 0) { lefts[node] = stack[top--]; } else { lefts[node] = -1; } stack[++top] = node; } checkArgument(nodeCount == 0 || top == 0, "Tree is corrupted. Expected a single root node"); root = nodeCount - 1; nextNode = nodeCount; }
Source:
public synchronized Future<PlanResult> execute(final Plan plan) { executingPlan = new ExecutingPlan(plan); final Set<EMOperation> initialEMOperations = executingPlan.getNextOpsToExecute(); try { nextOpsToExecuteInParallel.put(initialEMOperations); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while putting ops into the queue", e); } final int numTotalOps = plan.getPlanSize(); return mainExecutor.submit(new Callable<PlanResult>() { private static final int QUEUE_SIZE = 10; private static final long POLLING_TIMEOUT_SEC = 10; private final AtomicInteger numExecutedOps = new AtomicInteger(0); private Collection<Set<EMOperation>> drainedOpSets = new ArrayList<>(QUEUE_SIZE); @Override public PlanResult call() throws Exception { while (true) { final Set<EMOperation> nextOps = nextOpsToExecuteInParallel.poll(POLLING_TIMEOUT_SEC, TimeUnit.SECONDS); if (nextOps != null) { nextOpsToExecuteInParallel.drainTo(drainedOpSets, QUEUE_SIZE); drainedOpSets.forEach(nextOps::addAll); executeOperations(nextOps); numExecutedOps.getAndAdd(nextOps.size()); if (numExecutedOps.get() >= numTotalOps) { break; } drainedOpSets.clear(); } } final ConcurrentMap<EMOperation, OpExecutionStatus> planExecutionResult = executingPlan.getPlanExecutionStatus(); return new PlanResultImpl("Plan Execution Complete!\n[SUMMARY]\n" + planExecutionResult, planExecutionResult.size()); } }); }

Target:
public synchronized Future<PlanResult> execute(final Plan plan) { executingPlan = new ExecutingPlan(plan); final Set<EMOperation> initialEMOperations = executingPlan.getNextOpsToExecute(); try { nextOpsToExecuteInParallel.put(initialEMOperations); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while putting ops into the queue", e); } final int numTotalOps = plan.getPlanSize(); return mainExecutor.submit(new Callable<PlanResult>() { @Override public PlanResult call() throws Exception { int numStartedOps = 0; while (numStartedOps < numTotalOps) { final Set<EMOperation> nextOps = nextOpsToExecuteInParallel.take(); if (nextOps != null) { executeOperations(nextOps); numStartedOps += nextOps.size(); } } executingPlan.waitPlanExecution(); final ConcurrentMap<EMOperation, OpExecutionStatus> planExecutionResult = executingPlan.getPlanExecutionStatus(); return new PlanResultImpl("Plan Execution Complete!\n[SUMMARY]\n" + planExecutionResult, planExecutionResult.size()); } }); }
Source:
public FeedbackResponseAttributes getFeedbackResponse( String feedbackResponseId) { FeedbackResponseAttributes response = frDb.getFeedbackResponse(feedbackResponseId); if (response == null) { return null; } ArrayList<FeedbackResponseAttributes> responses = new ArrayList<FeedbackResponseAttributes>(); responses.add(response); List<FeedbackResponseAttributes> validResponses = getValidResponses(responses, response.courseId); if (validResponses.size() == 0) { return null; } return validResponses.get(0); }

Target:
public FeedbackResponseAttributes getFeedbackResponse( String feedbackResponseId) { FeedbackResponseAttributes response = frDb.getFeedbackResponse(feedbackResponseId); if (response == null) { return null; } List<FeedbackResponseAttributes> responses = new ArrayList<FeedbackResponseAttributes>(); responses.add(response); List<FeedbackResponseAttributes> validResponses = getValidResponses(responses, response.courseId); if (validResponses.isEmpty()) { return null; } return validResponses.get(0); }
Source:
public String getUsage() { StringBuilder sb = new StringBuilder(); sb.append("Usage: branch_purge [-R] [-D] [-A] [-B] [-P] branchGuids=<BRANCH_GUID,..>\n"); sb.append("Synopsis:\n"); sb.append("\tCAUTION: This command will permanently remove branches from the datastore!\n"); sb.append("\tThis command has no effect unless the [P] option is specified. However, it will\n"); sb.append("\tprint what would be purged had the [P] option is specified. Each option turns\n"); sb.append("\tfunctionality on. Thus, the default behavior with no options is to list the \n"); sb.append("\tarchived, deleted, non-baseline branches and not recurse of the guids listed that\n"); sb.append("\twould be purged.\n"); sb.append("Options:\n"); sb.append("\tR: Recurse branch children\n"); sb.append("\tA: Delete Un-Archived branches\n"); sb.append("\tD: Delete Un-Deleted branches\n"); sb.append("\tB: Delete Baseline branches\n"); sb.append("\tP: Purge the branches\n"); return sb.toString(); }

Target:
public String getUsage() { StringBuilder sb = new StringBuilder(); sb.append("Usage: branch_purge [-R] [-D] [-A] [-B] [-P] branchGuids=<BRANCH_GUID,..>\n"); sb.append("Synopsis:\n"); sb.append("\tCAUTION: This command will permanently remove branches from the datastore!\n"); sb.append("\tThis command has no effect unless the [P] option is specified, otherwise it\n"); sb.append("\tprints what would be purged had the [P] option is specified. Each option turns\n"); sb.append("\tfunctionality on. Thus, the default behavior with no options is to list the \n"); sb.append("\tarchived, deleted, non-baseline branches and not recurse of the guids listed that\n"); sb.append("\twould be purged.\n"); sb.append("Options:\n"); sb.append("\tR: Recurse branch children\n"); sb.append("\tA: Allow Un-Archived branches\n"); sb.append("\tD: Allow Un-Deleted branches\n"); sb.append("\tB: Allow Baseline branches\n"); sb.append("\tP: Purge the branches\n"); return sb.toString(); }
Source:
private Mono<Response<RecognizePiiEntitiesResultCollection>> getRecognizePiiEntitiesResponse( Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context) { return service.entitiesRecognitionPiiWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), options == null ? null : options.getModelVersion(), options == null ? null : options.isIncludeStatistics(), null, context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Recognized Personally Identifiable Information entities for a batch of documents- {}", response.getValue())) .doOnError(error -> logger.warning("Failed to recognize Personally Identifiable Information entities - {}", error)) .map(this::toRecognizePiiEntitiesResultCollectionResponse) .onErrorMap(throwable -> mapToHttpResponseExceptionIfExist(throwable)); }

Target:
private Mono<Response<RecognizePiiEntitiesResultCollection>> getRecognizePiiEntitiesResponse( Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context) { return service.entitiesRecognitionPiiWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), options == null ? null : options.getModelVersion(), options == null ? null : options.isIncludeStatistics(), null, context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info( "Start recognizing Personally Identifiable Information entities for a batch of documents.")) .doOnSuccess(response -> logger.info( "Successfully recognized Personally Identifiable Information entities for a batch of documents.")) .doOnError(error -> logger.warning("Failed to recognize Personally Identifiable Information entities - {}", error)) .map(this::toRecognizePiiEntitiesResultCollectionResponse) .onErrorMap(throwable -> mapToHttpResponseExceptionIfExist(throwable)); }
Source:
public void push(RowMap r) throws InterruptedException, Exception { String original_topic_per_table = this.context.getKafkaTopicPerTableFormat(); if(original_topic_per_table.contains("%{database}") || original_topic_per_table.contains("%{table}")) { String db_name = r.getDatabase(); String kafkaTopicWithFormat = original_topic_per_table.replaceAll("%\\{database\\}", db_name); String table_name = r.getTable(); this.topic = kafkaTopicWithFormat.replaceAll("%\\{table\\}", table_name); List<PartitionInfo> partitions_for_kafka; try { partitions_for_kafka = this.kafka.partitionsFor(this.topic); } catch(TimeoutException e) { LOGGER.error("This topic name does not exist: " + this.topic + ": " + e.getLocalizedMessage()); throw (e); } } String key = r.pkToJson(keyFormat); String value = r.toJSON(); ProducerRecord<String, String> record = new ProducerRecord<>(topic, this.partitioner.kafkaPartition(r, this.numPartitions), key, value); if ( r.isTXCommit() ) inflightMessages.addMessage(r.getPosition()); if ( !KafkaCallback.LOGGER.isDebugEnabled() ) value = null; KafkaCallback callback = new KafkaCallback(inflightMessages, r.getPosition(), r.isTXCommit(), this.context, key, value); kafka.send(record, callback); }

Target:
public void push(RowMap r) throws Exception { String kafkaTopicWithFormat = getTopic(r); if(kafkaTopicWithFormat != "") { this.topic = kafkaTopicWithFormat; } String key = r.pkToJson(keyFormat); String value = r.toJSON(); int numPartitions = getKafkaNumPartition(r); ProducerRecord<String, String> record = new ProducerRecord<>(topic, this.partitioner.kafkaPartition(r, numPartitions), key, value); if ( r.isTXCommit() ) inflightMessages.addMessage(r.getPosition()); if ( !KafkaCallback.LOGGER.isDebugEnabled() ) value = null; KafkaCallback callback = new KafkaCallback(inflightMessages, r.getPosition(), r.isTXCommit(), this.context, key, value); kafka.send(record, callback); }
Source:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); State newState = null; if(command instanceof OnOffType) { newState = (OnOffType) command; } else if(command instanceof OpenClosedType) { newState = (OpenClosedType) command; } else if(command instanceof PercentType) { newState = (PercentType) command; } else if(command instanceof DecimalType) { newState = (DecimalType) command; } if(newState != null) { eventPublisher.postUpdate(itemName, newState); } else { logger.warn("internalReceiveCommand({},{}) not handled!", itemName, command); } }

Target:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); State newState = null; if (command instanceof OnOffType) { newState = (OnOffType) command; } else if (command instanceof OpenClosedType) { newState = (OpenClosedType) command; } else if (command instanceof PercentType) { newState = (PercentType) command; } else if (command instanceof DecimalType) { newState = (DecimalType) command; } if (newState != null) { eventPublisher.postUpdate(itemName, newState); } }
Source:
public VDSReturnValue get(long timeout, TimeUnit unit) throws TimeoutException { try { status = new StatusOnlyReturnForXmlRpc(httpTask.get(timeout, unit)); proceedProxyReturnValue(); } catch (TimeoutException e) { httpTask.cancel(true); VDSNetworkException ex = new VDSNetworkException("Timeout during xml-rpc call"); ex.setVdsError(new VDSError(VdcBllErrors.VDS_NETWORK_ERROR, "Timeout during xml-rpc call")); setVdsRuntimeError(ex); log.error("Timeout waiting for VDSM response: {}", e.getMessage()); log.debug("Exception", e); throw e; } catch (Exception e) { log.error("Error: {}", e.getMessage()); if (VDSErrorException.class.isInstance(e) && !"Policy reset".equals(((VDSExceptionBase) e).getVdsError().getMessage())) { log.error("Exception", e); } setVdsRuntimeError(e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e)); } return getVDSReturnValue(); }

Target:
public VDSReturnValue get(long timeout, TimeUnit unit) throws TimeoutException { try { status = new StatusOnlyReturnForXmlRpc(httpTask.get(timeout, unit)); proceedProxyReturnValue(); } catch (TimeoutException e) { httpTask.cancel(true); VDSNetworkException ex = new VDSNetworkException("Timeout during xml-rpc call"); ex.setVdsError(new VDSError(VdcBllErrors.VDS_NETWORK_ERROR, "Timeout during xml-rpc call")); setVdsRuntimeError(ex); log.error("Timeout waiting for VDSM response: {}", e.getMessage()); log.debug("Exception", e); throw e; } catch (VDSNetworkException e) { if (!"Policy reset".equals(e.getVdsError().getMessage())) { log.error("Exception", e); } setVdsExceptionAndLog(e); } catch (Exception e) { log.error("Exception", e); setVdsExceptionAndLog(e); } return getVDSReturnValue(); }
Source:
public static Object getResponse(Object result, HttpServletRequest request, int httpStatus) throws IOException, MessagingException { if (result == null || "true".equals(request.getHeader("X-NXVoidOperation"))) { return emptyContent(); } if (result instanceof Blob) { return result; } else if (result instanceof BlobList) { return blobs((BlobList) result); } else if (result instanceof DocumentRef) { CoreSession session = SessionFactory.getSession(request); return Response.status(httpStatus).entity(session.getDocument((DocumentRef) result)).build(); } else if (result instanceof DocumentRefList) { CoreSession session = SessionFactory.getSession(request); return Response.status(httpStatus).entity(((DocumentRefList) result).stream().map(session::getDocument) .collect(Collectors.toCollection(DocumentModelListImpl::new))).build(); } else if (result instanceof List<?> && !((List) result).isEmpty() && ((List) result).get(0) instanceof NuxeoPrincipal) { return result; } else if (result instanceof DocumentModel || result instanceof DocumentModelList || result instanceof JsonAdapter || result instanceof RecordSet || result instanceof Paginable<?>) { return Response.status(httpStatus).entity(result).build(); } else { return Response.status(httpStatus).entity(new DefaultJsonAdapter(result)).build(); } }

Target:
public static Object getResponse(Object result, HttpServletRequest request, int httpStatus) throws IOException, MessagingException { if (result == null || "true".equals(request.getHeader("X-NXVoidOperation"))) { return emptyContent(); } if (result instanceof Blob) { return result; } else if (result instanceof BlobList) { return blobs((BlobList) result); } else if (result instanceof DocumentRef) { CoreSession session = SessionFactory.getSession(request); return Response.status(httpStatus).entity(session.getDocument((DocumentRef) result)).build(); } else if (result instanceof DocumentRefList) { CoreSession session = SessionFactory.getSession(request); return Response.status(httpStatus).entity(((DocumentRefList) result).stream().map(session::getDocument) .collect(Collectors.toCollection(DocumentModelListImpl::new))).build(); } else if (result instanceof List && !((List<?>) result).isEmpty() && ((List<?>) result).get(0) instanceof NuxeoPrincipal) { return Response.status(httpStatus) .entity(new GenericEntity<>(result, TypeUtils.parameterize(List.class, NuxeoPrincipal.class))) .build(); } else if (result instanceof DocumentModel || result instanceof DocumentModelList || result instanceof JsonAdapter || result instanceof RecordSet || result instanceof Paginable<?>) { return Response.status(httpStatus).entity(result).build(); } else { return Response.status(httpStatus).entity(new DefaultJsonAdapter(result)).build(); } }
Source:
public static Set<String> readNodeList(String confDir, String fileName) { List<String> lines; try { lines = Files.readAllLines(Paths.get(confDir, fileName), StandardCharsets.UTF_8); } catch (IOException e) { System.err.format("Failed to read file %s/%s. Ignored.", confDir, fileName); return new HashSet<>(); } Set<String> nodes = new HashSet<>(); for (String line : lines) { String node = line.trim(); if (node.startsWith("#") || node.length() == 0) { continue; } nodes.add(node); } return nodes; }

Target:
public static Set<String> readNodeList(String confDir, String fileName) { List<String> lines; String path = Paths.get(confDir, fileName).normalize().toString(); try { lines = Files.readAllLines(Paths.get(confDir, fileName), StandardCharsets.UTF_8); } catch (IOException e) { System.err.format("Failed to read file %s/%s. Ignored.%n", confDir, fileName); return new HashSet<>(); } Set<String> nodes = new HashSet<>(); for (String line : lines) { String node = line.trim(); if (node.startsWith("#") || node.length() == 0) { continue; } if (!nodes.add(node)) { System.out.format("Duplicate node hostname %s found in %s%n", node, path); } } return nodes; }
Source:
private boolean isAdditionalSoftwareChanged(CertificationResult existingCert, CertificationResult updatedCert) { if (certResultRules.hasCertOption(updatedCert.getNumber(), CertificationResultRules.ADDITIONAL_SOFTWARE)) { for (CertificationResultAdditionalSoftware updatedAdditionalSoftware : updatedCert.getAdditionalSoftware()) { boolean hasMatch = false; for (CertificationResultAdditionalSoftware existingAdditionalSoftware : existingCert.getAdditionalSoftware()) { if (updatedAdditionalSoftware.matches(existingAdditionalSoftware)) { hasMatch = true; } } if (!hasMatch) { return true; } } for (CertificationResultAdditionalSoftware existingAdditionalSoftware : existingCert.getAdditionalSoftware()) { boolean hasMatch = false; for (CertificationResultAdditionalSoftware updatedAdditionalSoftware : updatedCert.getAdditionalSoftware()) { if (existingAdditionalSoftware.matches(updatedAdditionalSoftware)) { hasMatch = true; } } if (!hasMatch) { return true; } } } return false; }

Target:
private boolean isAdditionalSoftwareChanged(CertificationResult existingCert, CertificationResult updatedCert) { if (certResultRules.hasCertOption(updatedCert.getNumber(), CertificationResultRules.ADDITIONAL_SOFTWARE)) { for (CertificationResultAdditionalSoftware updatedAdditionalSoftware : updatedCert.getAdditionalSoftware()) { boolean isInExistingCert = existingCert.getAdditionalSoftware().stream() .anyMatch(existingAdditionalSoftware -> existingAdditionalSoftware.matches(updatedAdditionalSoftware)); if (!isInExistingCert) { return true; } } for (CertificationResultAdditionalSoftware existingAdditionalSoftware : existingCert.getAdditionalSoftware()) { boolean isInUpdatedCert = updatedCert.getAdditionalSoftware().stream() .anyMatch(updatedAdditionalSoftware -> updatedAdditionalSoftware.matches(existingAdditionalSoftware)); if (!isInUpdatedCert) { return true; } } } return false; }
Source:
protected TableName createNewTable(Admin admin) throws IOException { TableName tableName = newTestTableName(); admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); return tableName; }

Target:
private static TableName createNewTable(Admin admin) throws IOException { TableName tableName = newTestTableName(); admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); return tableName; }
Source:
public void testMaskResourceClassLoader() throws Exception { PluginWrapper pw = jenkins.getPluginManager().getPlugin("foo1"); Class<?> clazz = pw.classLoader.loadClass("org.apache.http.impl.io.SocketInputBuffer"); ClassLoader cl = clazz.getClassLoader(); URL url = cl.getResource("org/apache/http/impl/io/SocketInputBuffer.class"); assert url != null; assertTrue("expected to find the class from foo1 plugin", url.toString().contains("plugins/foo1")); }

Target:
public void testMaskResourceClassLoader() throws Exception { PluginWrapper pw = jenkins.getPluginManager().getPlugin("foo1"); Class<?> clazz = pw.classLoader.loadClass("org.apache.http.impl.io.SocketInputBuffer"); ClassLoader cl = clazz.getClassLoader(); URL url = cl.getResource("org/apache/http/impl/io/SocketInputBuffer.class"); assertNotNull(url); assertTrue("expected to find the class from foo1 plugin", url.toString().contains("plugins/foo1")); }
Source:
public void afterRun() { if (recordStore != null) { if (!wanOriginated) { publishWanUpdate(key, cacheRecord); } } }

Target:
public void afterRun() { if (recordStore != null && !wanOriginated) { publishWanUpdate(key, cacheRecord); } }