auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int compareTo(Object obj) { if (this == obj) { return 0; } if (obj == null) { return 1; } if (getClass() != obj.getClass()) { return 1; } RepositoryVersion other = (RepositoryVersion) obj; if (this.getMajor() == null || other.getMajor() == null) { return this.toString().compareTo(other.toString()); } int erg = this.getMajor() - other.getMajor(); if (erg != 0) { return erg; } if (this.getMinor() != null && other.getMinor() == null) { return 1; } else if (this.getMinor() == null && other.getMinor() != null) { return -1; } else if (this.getMinor() != null && other.getMinor() != null) { erg = this.getMinor() - other.getMinor(); if (erg != 0) { return erg; } } if (this.getMicro() != null && other.getMicro() == null) { return 1; } else if (this.getMicro() == null && other.getMicro() != null) { return -1; } else if (this.getMicro() != null && other.getMicro() != null) { erg = this.getMicro() - other.getMicro(); if (erg != 0) { return erg; } } if (this.getQualifier() != null && other.getQualifier() == null) { if (this.getQualifier().equals("+")) { return 1; } else { return -1; } } if (this.getQualifier() == null && other.getQualifier() != null) { if (other.getQualifier().equals("+")) { return -1; } else { return 1; } } if (this.getQualifier() != null && other.getQualifier() != null) { erg = this.getQualifier().compareTo(other.getQualifier()); if (this.getQualifier().equals("+") || other.getQualifier().equals("+")) { return erg * -1; } if (erg != 0) { return erg; } } return 0; }

Target:
public int compareTo(Object obj) { if (this == obj) { return 0; } if (obj == null) { return 1; } if (getClass() != obj.getClass()) { return 1; } RepositoryVersion other = (RepositoryVersion) obj; int erg = compareMajor(other); if (erg != 0) { return erg; } erg = compareMinor(other); if (erg != 0) { return erg; } erg = compareMicro(other); if (erg != 0) { return erg; } if (this.getQualifier() != null && other.getQualifier() == null) { if (this.getQualifier().equals("+")) { return 1; } else { return -1; } } if (this.getQualifier() == null && other.getQualifier() != null) { if (other.getQualifier().equals("+")) { return -1; } else { return 1; } } erg = compareQualifier(other); if (this.getQualifier().equals("+") || other.getQualifier().equals("+")) { return erg * -1; } return erg; }
Source:
public ActionResult execute() { CourseUpdateRequest courseUpdateRequest = getAndValidateRequestBody(CourseUpdateRequest.class); String courseTimeZone = courseUpdateRequest.getTimeZone(); FieldValidator validator = new FieldValidator(); String timeZoneErrorMessage = validator.getInvalidityInfoForTimeZone(courseTimeZone); if (!timeZoneErrorMessage.isEmpty()) { return new JsonResult(timeZoneErrorMessage, HttpStatus.SC_BAD_REQUEST); } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String courseName = courseUpdateRequest.getCourseName(); try { logic.updateCourseCascade( CourseAttributes.updateOptionsBuilder(courseId) .withName(courseName) .withTimezone(ZoneId.of(courseTimeZone)) .build()); } catch (InvalidParametersException ipe) { return new JsonResult(ipe.getMessage(), HttpStatus.SC_BAD_REQUEST); } catch (EntityDoesNotExistException edee) { return new JsonResult(edee.getMessage(), HttpStatus.SC_NOT_FOUND); } return new JsonResult(new CourseData(logic.getCourse(courseId))); }

Target:
public ActionResult execute() { CourseUpdateRequest courseUpdateRequest = getAndValidateRequestBody(CourseUpdateRequest.class); String courseTimeZone = courseUpdateRequest.getTimeZone(); String timeZoneErrorMessage = FieldValidator.getInvalidityInfoForTimeZone(courseTimeZone); if (!timeZoneErrorMessage.isEmpty()) { return new JsonResult(timeZoneErrorMessage, HttpStatus.SC_BAD_REQUEST); } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String courseName = courseUpdateRequest.getCourseName(); CourseAttributes updatedCourse; try { updatedCourse = logic.updateCourseCascade( CourseAttributes.updateOptionsBuilder(courseId) .withName(courseName) .withTimezone(ZoneId.of(courseTimeZone)) .build()); } catch (InvalidParametersException ipe) { return new JsonResult(ipe.getMessage(), HttpStatus.SC_BAD_REQUEST); } catch (EntityDoesNotExistException edee) { throw new EntityNotFoundException(edee); } return new JsonResult(new CourseData(updatedCourse)); }
Source:
public static TaskTimer getTimer(IConfiguration config) throws Exception{ CronTimer cronTimer = null; switch (config.getBackupSchedulerType()) { case TIME: int hour = config.getBackupHour(); if (hour >= 0) { cronTimer = new CronTimer(JOBNAME, hour, 1, 0); logger.info("Starting snapshot backup with backup hour: " + hour); }else logger.info("Skipping snapshot backup as backup hour is less than 0: " + hour); break; case CRON: String cronExpression = config.getBackupCronExpression(); if(!StringUtils.isEmpty(cronExpression) && cronExpression.equalsIgnoreCase("-1")){ logger.info("Skipping snapshot backup as backup cron is set to NA"); }else { if(StringUtils.isEmpty(cronExpression) || !CronExpression.isValidExpression(cronExpression)) throw new Exception("Invalid CRON expression: " + cronExpression + ". Please use NA if you wish to disable backup else fix the CRON expression and try again!"); cronTimer = new CronTimer(JOBNAME, config.getBackupCronExpression()); logger.info(String.format("Starting snapshot backup with CRON expression %s", cronTimer.getCronExpression())); } break; } return cronTimer; }

Target:
public static TaskTimer getTimer(IConfiguration config) throws Exception{ CronTimer cronTimer = null; switch (config.getBackupSchedulerType()) { case HOUR: int hour = config.getBackupHour(); if (hour >= 0) { cronTimer = new CronTimer(JOBNAME, hour, 1, 0); logger.info("Starting snapshot backup with backup hour: " + hour); }else logger.info("Skipping snapshot backup as backup hour is less than 0: " + hour); break; case CRON: String cronExpression = config.getBackupCronExpression(); if(!StringUtils.isEmpty(cronExpression) && cronExpression.equalsIgnoreCase("-1")){ logger.info("Skipping snapshot backup as backup cron is set to NA"); }else { if(StringUtils.isEmpty(cronExpression) || !CronExpression.isValidExpression(cronExpression)) throw new Exception("Invalid CRON expression: " + cronExpression + ". Please use -1 if you wish to disable backup else fix the CRON expression and try again!"); cronTimer = new CronTimer(JOBNAME, config.getBackupCronExpression()); logger.info(String.format("Starting snapshot backup with CRON expression %s", cronTimer.getCronExpression())); } break; } return cronTimer; }
Source:
public AbstractSegmentStoreAnalysisRequest(ISegmentStore<ISegment> segmentStore) { super(ITmfEvent.class, 0, ITmfEventRequest.ALL_DATA, ExecutionType.BACKGROUND); fSegmentStore = segmentStore; }

Target:
public AbstractSegmentStoreAnalysisRequest(ISegmentStore<ISegment> segmentStore) { this(segmentStore, 0); }
Source:
public void populateDynamicChoices(ItemsetBinding itemset, TreeReference curQRef) { Vector<SelectChoice> choices = new Vector<SelectChoice>(); DataInstance fi; if (itemset.nodesetRef.getInstanceName() != null) { fi = getNonMainInstance(itemset.nodesetRef.getInstanceName()); if (fi == null) { throw new XPathException("Instance " + itemset.nodesetRef.getInstanceName() + " not found"); } } else { fi = getMainInstance(); } Vector<TreeReference> matches = itemset.nodesetExpr.evalNodeset(fi, new EvaluationContext(exprEvalContext, itemset.contextRef.contextualize(curQRef))); if (matches == null) { throw new XPathException("No items found at '" + itemset.nodesetRef + "'. Make sure the '" + itemset.nodesetRef.getInstanceName() + "' lookup table is available."); } for (int i = 0; i < matches.size(); i++) { TreeReference item = matches.elementAt(i); String label = itemset.labelExpr.evalReadable(fi, new EvaluationContext(exprEvalContext, item)); String value = null; TreeElement copyNode = null; if (itemset.copyMode) { copyNode = this.getMainInstance().resolveReference(itemset.copyRef.contextualize(item)); } if (itemset.valueRef != null) { value = itemset.valueExpr.evalReadable(fi, new EvaluationContext(exprEvalContext, item)); } SelectChoice choice = new SelectChoice(label, value != null ? value : "dynamic:" + i, itemset.labelIsItext); choice.setIndex(i); if (itemset.copyMode) choice.copyNode = copyNode; choices.addElement(choice); } itemset.setChoices(choices, this.getLocalizer()); }

Target:
public void populateDynamicChoices(ItemsetBinding itemset, TreeReference curQRef) { Vector<SelectChoice> choices = new Vector<SelectChoice>(); DataInstance fi; if (itemset.nodesetRef.getInstanceName() != null) { fi = getNonMainInstance(itemset.nodesetRef.getInstanceName()); if (fi == null) { throw new XPathException("Instance " + itemset.nodesetRef.getInstanceName() + " not found"); } } else { fi = getMainInstance(); } Vector<TreeReference> matches = itemset.nodesetExpr.evalNodeset(fi, new EvaluationContext(exprEvalContext, itemset.contextRef.contextualize(curQRef))); if (matches == null) { String instanceName = itemset.nodesetRef.getInstanceName(); if (instanceName == null) { throw new XPathException("No items found at '" + itemset.nodesetRef + "'"); } else { throw new XPathException("Make sure the '" + instanceName + "' lookup table is available, and that its contents are accessible to the current user."); } } for (int i = 0; i < matches.size(); i++) { TreeReference item = matches.elementAt(i); String label = itemset.labelExpr.evalReadable(fi, new EvaluationContext(exprEvalContext, item)); String value = null; TreeElement copyNode = null; if (itemset.copyMode) { copyNode = this.getMainInstance().resolveReference(itemset.copyRef.contextualize(item)); } if (itemset.valueRef != null) { value = itemset.valueExpr.evalReadable(fi, new EvaluationContext(exprEvalContext, item)); } SelectChoice choice = new SelectChoice(label, value != null ? value : "dynamic:" + i, itemset.labelIsItext); choice.setIndex(i); if (itemset.copyMode) choice.copyNode = copyNode; choices.addElement(choice); } itemset.setChoices(choices, this.getLocalizer()); }
Source:
private void handleRadioButtonClick(ClickEvent event) { getDetailModel().setViewFilterType((viewRadioGroup.getSelectedValue())); boolean attached = viewRadioGroup.getSelectedValue() == NetworkHostFilter.attached; getTable().ensureColumnPresent(hostStatus, constants.empty(), true, "30px"); getTable().ensureColumnPresent(nameColumn, constants.nameHost(), true, "200px"); getTable().ensureColumnPresent(clusterColumn, constants.clusterHost(), true, "200px"); getTable().ensureColumnPresent(dcColumn, constants.dcHost(), true, "200px"); getTable().ensureColumnPresent(nicStatusColumn, constants.statusNetworkHost(), attached, "140px"); getTable().ensureColumnPresent(hostOutOfSync, constants.hostOutOfSync(), true, "100px"); getTable().ensureColumnPresent(nicColumn, constants.nicNetworkHost(), attached, "100px"); getTable().ensureColumnPresent(speedColumn, templates.sub(constants.speedNetworkHost(), constants.mbps()).asString(), attached, "100px"); getTable().ensureColumnPresent(nicRxColumn, templates.sub(constants.rxNetworkHost(), constants.mbps()).asString(), attached, "100px"); getTable().ensureColumnPresent(nicTxColumn, templates.sub(constants.txNetworkHost(), constants.mbps()).asString(), attached, "100px"); }

Target:
private void handleRadioButtonClick(ClickEvent event) { getDetailModel().setViewFilterType((viewRadioGroup.getSelectedValue())); boolean attached = viewRadioGroup.getSelectedValue() == NetworkHostFilter.attached; getTable().ensureColumnPresent(hostStatus, constants.empty(), true, "30px"); getTable().ensureColumnPresent(nameColumn, constants.nameHost(), true, "200px"); getTable().ensureColumnPresent(clusterColumn, constants.clusterHost(), true, "200px"); getTable().ensureColumnPresent(dcColumn, constants.dcHost(), true, "200px"); getTable().ensureColumnPresent(nicStatusColumn, constants.statusNetworkHost(), attached, "140px"); getTable().ensureColumnPresent(hostOutOfSync, constants.hostOutOfSync(), attached, "75px"); getTable().ensureColumnPresent(nicColumn, constants.nicNetworkHost(), attached, "100px"); getTable().ensureColumnPresent(speedColumn, templates.sub(constants.speedNetworkHost(), constants.mbps()).asString(), attached, "100px"); getTable().ensureColumnPresent(nicRxColumn, templates.sub(constants.rxNetworkHost(), constants.mbps()).asString(), attached, "100px"); getTable().ensureColumnPresent(nicTxColumn, templates.sub(constants.txNetworkHost(), constants.mbps()).asString(), attached, "100px"); }
Source:
public void testGenerics16() throws Exception { ICompilationUnit cuIGeneric= createCUfromTestFile(getPackageP(), "IGeneric"); ICompilationUnit cuMainImpl= createCUfromTestFile(getPackageP(), "MainImpl"); ICompilationUnit cuOtherImpl= createCUfromTestFile(getPackageP(), "OtherImpl"); String[] methodNames= { "genericMethod" }; String[][] signatures= { { "QString;" } }; IType typeIGeneric= getType(cuIGeneric, "IGeneric"); IType typeMainImpl= getType(cuMainImpl, "MainImpl"); IMethod[] methods= getMethods(typeMainImpl, methodNames, signatures); PullUpRefactoringProcessor processor= createRefactoringProcessor(methods); Refactoring ref= processor.getRefactoring(); assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK()); processor.setDestinationType(typeIGeneric); processor.setDeletedMethods(getMethods(processor.getMatchingElements(new NullProgressMonitor(), false))); RefactoringStatus result= performRefactoring(ref); assertFalse("No errors should occur: " + result.getMessageMatchingSeverity(RefactoringStatus.ERROR), result != null && result.hasError()); assertEqualLines("IGeneric", getFileContents(getOutputTestFileName("IGeneric")), cuIGeneric.getSource()); assertEqualLines("MainImpl", getFileContents(getOutputTestFileName("MainImpl")), cuMainImpl.getSource()); assertEqualLines("OtherImpl", getFileContents(getOutputTestFileName("OtherImpl")), cuOtherImpl.getSource()); }

Target:
public void testGenerics16() throws Exception { ICompilationUnit cuIGeneric= createCUfromTestFile(getPackageP(), "IGeneric"); ICompilationUnit cuMainImpl= createCUfromTestFile(getPackageP(), "MainImpl"); ICompilationUnit cuOtherImpl= createCUfromTestFile(getPackageP(), "OtherImpl"); String[] methodNames= { "genericMethod" }; String[][] signatures= { { "QString;" } }; IType typeIGeneric= getType(cuIGeneric, "IGeneric"); IType typeMainImpl= getType(cuMainImpl, "MainImpl"); IMethod[] methods= getMethods(typeMainImpl, methodNames, signatures); PullUpRefactoringProcessor processor= createRefactoringProcessor(methods); Refactoring ref= processor.getRefactoring(); assertTrue("activation", ref.checkInitialConditions(new NullProgressMonitor()).isOK()); processor.setDestinationType(typeIGeneric); processor.setDeletedMethods(getMethods(processor.getMatchingElements(new NullProgressMonitor(), false))); RefactoringStatus result= performRefactoring(ref); if (result != null && result.hasError()) { fail("No errors should occur: " + result.getMessageMatchingSeverity(RefactoringStatus.ERROR)); } assertEqualLines("IGeneric", getFileContents(getOutputTestFileName("IGeneric")), cuIGeneric.getSource()); assertEqualLines("MainImpl", getFileContents(getOutputTestFileName("MainImpl")), cuMainImpl.getSource()); assertEqualLines("OtherImpl", getFileContents(getOutputTestFileName("OtherImpl")), cuOtherImpl.getSource()); }
Source:
public Set<Entry<K, V>> entrySet() { return commonCache.entrySet(); }

Target:
public Set<Entry<K, V>> entrySet() { return doWithReadLock(c -> c.entrySet()); }
Source:
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(group.queries)) { readMetrics.unavailables.mark(); readMetricsMap.get(consistencyLevel).unavailables.mark(); throw new IsBootstrappingException(); } if (BlacklistedPartitionCache.instance.size() > 0) { for (SinglePartitionReadQuery query : group.queries) { if (BlacklistedPartitionCache.instance.contains(query.metadata().id, query.partitionKey())) { throw new InvalidRequestException("Cannot perform READ on a blacklisted partition"); } } } return consistencyLevel.isSerialConsistency() ? readWithPaxos(group, consistencyLevel, state, queryStartNanoTime) : readRegular(group, consistencyLevel, queryStartNanoTime); }

Target:
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(group.queries)) { readMetrics.unavailables.mark(); readMetricsMap.get(consistencyLevel).unavailables.mark(); throw new IsBootstrappingException(); } if (BlacklistedPartitionCache.instance.size() > 0) { for (SinglePartitionReadQuery query : group.queries) { if (BlacklistedPartitionCache.instance.contains(query.metadata().id, query.partitionKey())) { throw new InvalidRequestException(String.format("Cannot perform READ on a blacklisted partition: %s", query.partitionKey().toString())); } } } return consistencyLevel.isSerialConsistency() ? readWithPaxos(group, consistencyLevel, state, queryStartNanoTime) : readRegular(group, consistencyLevel, queryStartNanoTime); }
Source:
public void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() throws Throwable { activePublisherTest(10, false, new PublisherTestRun<T>() { @Override public void run(Publisher<T> pub) throws Throwable { final ManualSubscriber<T> sub = env.newManualSubscriber(pub); sub.request(-1); sub.expectErrorWithMessage(IllegalArgumentException.class, "3.9"); } }); }

Target:
public void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() throws Throwable { activePublisherTest(10, false, new PublisherTestRun<T>() { @Override public void run(Publisher<T> pub) throws Throwable { final ManualSubscriber<T> sub = env.newManualSubscriber(pub); final Random r = new Random(); sub.request(-r.nextInt(Integer.MAX_VALUE) - 1); sub.expectErrorWithMessage(IllegalArgumentException.class, "3.9"); } }); }
Source:
public void testMergeDataAfterAcceptingDeletion() { Assert.assertNotNull(subDiff); Assert.assertNotNull(deletionDiff); Assert.assertNotNull(oppositeDiff); ArrayList<Diff> uiDiff = Lists.newArrayList(deletionDiff, subDiff); MergeRunnableImpl mergeRunnable = new MergeRunnableImpl(true, false, MergeMode.ACCEPT); mergeRunnable.merge(uiDiff, false, mergerRegistry); Assert.assertEquals(getMergeData(deletionDiff).getMergeMode(), MergeMode.ACCEPT); Assert.assertEquals(getMergeData(subDiff).getMergeMode(), MergeMode.REJECT); Assert.assertEquals(getMergeData(oppositeDiff).getMergeMode(), MergeMode.REJECT); }

Target:
public void testMergeDataAfterAcceptingDeletion() { Assert.assertNotNull(subDiff); Assert.assertNotNull(deletionDiff); Assert.assertNotNull(oppositeDiff); ArrayList<Diff> uiDiff = Lists.newArrayList(deletionDiff, subDiff); MergeRunnableImpl mergeRunnable = new MergeRunnableImpl(true, false, MergeMode.ACCEPT); mergeRunnable.merge(uiDiff, false, mergerRegistry); Node rootNode = (Node)left.getContents().get(0); Assert.assertEquals(0, rootNode.getContainmentRef1().get(0).getContainmentRef1().size()); Assert.assertEquals(MergeMode.ACCEPT, getMergeData(deletionDiff).getMergeMode()); Assert.assertEquals(MergeMode.REJECT, getMergeData(subDiff).getMergeMode()); Assert.assertEquals(MergeMode.REJECT, getMergeData(oppositeDiff).getMergeMode()); }
Source:
public void configure() throws Exception { final String MANAGEMENT_BUS_IA = "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA"; final String MANAGEMENT_BUS_PLAN = "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokePlan"; this.from("direct:invoke").to("stream:out").process(exchange -> { exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), Activator.apiID); final String messageID = exchange.getIn().getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); if (messageID != null) { exchange.getIn().setMessageId(messageID); exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), false); } else { exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), true); } }).to("stream:out").choice().when(header("OPERATION").isEqualTo(Operations.invokeIA)).to("direct:invokeIA") .when(header("OPERATION").isEqualTo(Operations.invokePlan)).to("direct:invokePlan").end(); this.from("direct:invokeIA").to("stream:out").wireTap(MANAGEMENT_BUS_IA); this.from("direct:invokePlan").to("stream:out").to(MANAGEMENT_BUS_PLAN).end(); this.from("direct-vm:" + Activator.apiID).recipientList(this.simple("direct:response${id}")).end(); }

Target:
public void configure() throws Exception { final String MANAGEMENT_BUS_IA = "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA"; final String MANAGEMENT_BUS_PLAN = "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokePlan"; this.from("direct:invoke").to("stream:out").process(exchange -> { exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), Activator.apiID); final String messageID = exchange.getIn().getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); if (messageID != null) { exchange.getIn().setMessageId(messageID); exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), false); } else { exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), true); } }).to("stream:out").choice().when(header("OPERATION").isEqualTo(OsgiEventOperations.INVOKE_IA.getHeaderValue())) .to("direct:invokeIA").when(header("OPERATION").isEqualTo(OsgiEventOperations.INVOKE_PLAN.getHeaderValue())) .to("direct:invokePlan").end(); this.from("direct:invokeIA").to("stream:out").wireTap(MANAGEMENT_BUS_IA); this.from("direct:invokePlan").to("stream:out").to(MANAGEMENT_BUS_PLAN).end(); this.from("direct-vm:" + Activator.apiID).recipientList(this.simple("direct:response${id}")).end(); }
Source:
public <T extends TopLevelItem> T get(Class<T> type, String name) { try { assert getContext() != null; return newInstance(type, getContext(), url("job/%s/", name), name); } catch (AssertionError e) { return newInstance(type, injector, url("job/%s/", name), name); } }

Target:
public <T extends TopLevelItem> T get(Class<T> type, String name) { if (contextAvailable() && typeAcceptsContext(type)) { return newInstance(type, getContext(), url("job/%s/", name), name); } return newInstance(type, injector, url("job/%s/", name), name); }
Source:
private boolean provideJavaClasses(ImportPackageObject pkg, IProgressMonitor monitor) { try { IProject project = fModel.getUnderlyingResource().getProject(); if (!project.hasNature(JavaCore.NATURE_ID)) return false; SubMonitor subMonitor = SubMonitor.convert(monitor, "", 1); IJavaProject jProject = JavaCore.create(project); SearchEngine engine = new SearchEngine(); IJavaSearchScope searchScope = PluginJavaSearchUtil.createSeachScope(jProject); Requestor requestor = new Requestor(); String packageName = pkg.getName(); engine.search( SearchPattern.createPattern(packageName, IJavaSearchConstants.PACKAGE, IJavaSearchConstants.REFERENCES, SearchPattern.R_EXACT_MATCH), new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope, requestor, subMonitor.newChild(1)); if (requestor.foundMatches()) return true; } catch (CoreException e) { } return false; }

Target:
private boolean provideJavaClasses(ImportPackageObject pkg, IProgressMonitor monitor) { try { IProject project = fModel.getUnderlyingResource().getProject(); if (!project.hasNature(JavaCore.NATURE_ID)) return false; SubMonitor subMonitor = SubMonitor.convert(monitor, 1); IJavaProject jProject = JavaCore.create(project); SearchEngine engine = new SearchEngine(); IJavaSearchScope searchScope = PluginJavaSearchUtil.createSeachScope(jProject); Requestor requestor = new Requestor(); String packageName = pkg.getName(); engine.search( SearchPattern.createPattern(packageName, IJavaSearchConstants.PACKAGE, IJavaSearchConstants.REFERENCES, SearchPattern.R_EXACT_MATCH), new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope, requestor, subMonitor.newChild(1)); if (requestor.foundMatches()) return true; } catch (CoreException e) { PDEPlugin.logException(e); } return false; }
Source:
public void shouldReturnRandomIntInRange_givenFromLessThanTo() { final Set<Integer> randomInts = new HashSet<>(); final int lowerBound = -Randoms.randomInt(100); final int upperBound = Randoms.randomInt(100); for (int n = 0; n < 100; n++) { final int randomInt = Randoms.randomIntInRange(lowerBound, upperBound); assertTrue(randomInt >= lowerBound && randomInt < upperBound); randomInts.add(randomInt); } assertTrue("100 random samples should not all be same int: " + randomInts.iterator().next(), randomInts.size() > 1); }

Target:
public void shouldReturnRandomIntInRange_givenFromLessThanTo() { final Set<Integer> randomInts = new HashSet<>(); final int lowerBound = Randoms.randomInt(200) - 100; final int upperBound = lowerBound + 50 + Randoms.randomInt(200); for (int n = 0; n < 100; n++) { final int randomInt = Randoms.randomIntInRange(lowerBound, upperBound); assertTrue(randomInt >= lowerBound && randomInt < upperBound); randomInts.add(randomInt); } assertTrue("100 random samples should not all be same int: " + randomInts.iterator().next(), randomInts.size() > 1); }
Source:
public String toString() { return String.format("Topology[%s] :: Active Cluster=%s :: Standby Clusters=%s", topologyConfigId, activeClusters, standbyClusters); }

Target:
public String toString() { return String.format("Topology[%s] :: Active Cluster=%s :: Standby Clusters=%s :: Invalid Clusters=%s", topologyConfigId, activeClusters, standbyClusters, invalidClusters); }
Source:
public int read(byte[] buffer, int offset, int length) throws IOException { int bytesRead; if (mSequentialReadCount >= SEQUENTIAL_READ_LIMIT) { ((FSDataInputStream) in).seek(mPos); mSequentialReadCount = 0; } if (mPos == ((FSDataInputStream) in).getPos()) { bytesRead = in.read(buffer, offset, length); } else { bytesRead = ((FSDataInputStream) in).read(mPos, buffer, offset, length); } if (bytesRead > 0) { mPos += bytesRead; } mSequentialReadCount++; return bytesRead; }

Target:
public int read(byte[] buffer, int offset, int length) throws IOException { int bytesRead; if (isSequentialReadMode() && mPos != ((Seekable) in).getPos()) { ((Seekable) in).seek(mPos); } if (mPos == ((Seekable) in).getPos()) { bytesRead = in.read(buffer, offset, length); } else { bytesRead = ((PositionedReadable) in).read(mPos, buffer, offset, length); } if (bytesRead > 0) { mPos += bytesRead; mSequentialReadCount++; } return bytesRead; }
Source:
private RepositoryTreeNode getNodeForPath(Repository repository, String repoRelativePath) { for (ViewerFilter filter : getCommonViewer().getFilters()) { if (NodeFilterFactory.isWorkTreeFilter(filter)) { ITreeContentProvider cp = (ITreeContentProvider) getCommonViewer() .getContentProvider(); RepositoryTreeNode repoNode = findRepositoryNode(cp, cp.getElements(getCommonViewer().getInput()), repository); return repoNode; } } RepositoryTreeNode currentNode = getRepositoryChildNode(repository, RepositoryTreeNodeType.WORKINGDIR); if (currentNode == null) { return null; } ITreeContentProvider cp = (ITreeContentProvider) getCommonViewer() .getContentProvider(); IPath relPath = new Path(repoRelativePath); for (String segment : relPath.segments()) { for (Object child : cp.getChildren(currentNode)) { @SuppressWarnings("unchecked") RepositoryTreeNode<File> childNode = (RepositoryTreeNode<File>) child; if (childNode.getObject().getName().equals(segment)) { currentNode = childNode; break; } } } return currentNode; }

Target:
private RepositoryTreeNode getNodeForPath(Repository repository, String repoRelativePath) { RepositoryTreeNode currentNode = getRepositoryChildNode(repository, RepositoryTreeNodeType.WORKINGDIR); CommonViewer viewer = getCommonViewer(); if (currentNode == null) { return null; } else { final RepositoryTreeNode workingDir = currentNode; if (Arrays.stream(viewer.getFilters()).anyMatch(filter -> !filter .select(viewer, workingDir.getParent(), workingDir))) { return currentNode.getParent(); } } ITreeContentProvider cp = (ITreeContentProvider) viewer .getContentProvider(); IPath relPath = new Path(repoRelativePath); for (String segment : relPath.segments()) { for (Object child : cp.getChildren(currentNode)) { @SuppressWarnings("unchecked") RepositoryTreeNode<File> childNode = (RepositoryTreeNode<File>) child; if (childNode.getObject().getName().equals(segment)) { currentNode = childNode; break; } } } return currentNode; }
Source:
public static Driver createDriver(DriverContext driverContext, Operator firstOperator, Operator... otherOperators) { return createDriver(requireNonNull(driverContext, "driverContext is null"), ImmutableList.<Operator>builder() .add(requireNonNull(firstOperator, "firstOperator is null")) .add(requireNonNull(otherOperators, "otherOperators is null")) .build()); }

Target:
public static Driver createDriver(DriverContext driverContext, Operator firstOperator, Operator... otherOperators) { requireNonNull(driverContext, "driverContext is null"); requireNonNull(firstOperator, "firstOperator is null"); requireNonNull(otherOperators, "otherOperators is null"); ImmutableList<Operator> operators = ImmutableList.<Operator>builder() .add(firstOperator) .add(otherOperators) .build(); return createDriver(driverContext, operators); }
Source:
public boolean isExtended() { return (NB.decodeUInt16(info, infoOffset + P_FLAGS) & EXTENDED) == EXTENDED; }

Target:
boolean isExtended() { return (info[infoOffset + P_FLAGS] & EXTENDED) != 0; }
Source:
public void setTableQuota(final TableName table, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, table, null, null, QuotaUtil.getTableQuota(masterServices.getConnection(), table)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addTableQuota(masterServices.getConnection(), table, quotaPojo.toQuotas()); } @Override public void delete() throws IOException { SpaceQuotaSnapshot currSnapshotOfTable = QuotaTableUtil.getCurrentSnapshotFromQuotaTable(masterServices.getConnection(), table); QuotaUtil.deleteTableQuota(masterServices.getConnection(), table); QuotaObserverChore quotaChore = ((HMaster)masterServices).getQuotaObserverChore(); quotaChore.removeTableQuotasnapshot(table); if (currSnapshotOfTable != null) { SpaceQuotaStatus quotaStatus = currSnapshotOfTable.getQuotaStatus(); if (SpaceViolationPolicy.DISABLE == quotaStatus.getPolicy().orElse(null) && quotaStatus.isInViolation()) { QuotaUtil.enableTableIfNotEnabled(masterServices.getConnection(), table); } } } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetTableQuota(table, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetTableQuota(table, quotaPojo); } }); }

Target:
public void setTableQuota(final TableName table, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, table, null, null, QuotaUtil.getTableQuota(masterServices.getConnection(), table)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addTableQuota(masterServices.getConnection(), table, quotaPojo.toQuotas()); } @Override public void delete() throws IOException { SpaceQuotaSnapshot currSnapshotOfTable = QuotaTableUtil.getCurrentSnapshotFromQuotaTable(masterServices.getConnection(), table); QuotaUtil.deleteTableQuota(masterServices.getConnection(), table); QuotaObserverChore quotaChore = masterServices.getQuotaObserverChore(); quotaChore.removeTableQuotasnapshot(table); if (currSnapshotOfTable != null) { SpaceQuotaStatus quotaStatus = currSnapshotOfTable.getQuotaStatus(); if (SpaceViolationPolicy.DISABLE == quotaStatus.getPolicy().orElse(null) && quotaStatus.isInViolation()) { QuotaUtil.enableTableIfNotEnabled(masterServices.getConnection(), table); } } } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetTableQuota(table, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetTableQuota(table, quotaPojo); } }); }
Source:
public void setUseGlobalState(boolean enableGlobalState) { useGlobalState = enableGlobalState; if (useGlobalState) { checkState(); } else { client.setState(new HttpState()); clientViaProxy.setState(new HttpState()); setProxyAuth(clientViaProxy); setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); } }

Target:
public void setUseGlobalState(boolean enableGlobalState) { this.useGlobalState = enableGlobalState; checkState(); }
Source:
private void processNextPeriodicMeterReadsForMonthly(final List<PeriodicMeterReads> periodicMeterReads, final List<DataObject> bufferedObjects, final DateTime bufferedDateTime) { final DataObject positiveActiveEnergyTariff1 = bufferedObjects.get(BUFFER_INDEX_A_POS_RATE_1 - 1); LOGGER.debug("positiveActiveEnergyTariff1: {}", this.dlmsHelperService.getDebugInfo(positiveActiveEnergyTariff1)); final DataObject positiveActiveEnergyTariff2 = bufferedObjects.get(BUFFER_INDEX_A_POS_RATE_2 - 1); LOGGER.debug("positiveActiveEnergyTariff2: {}", this.dlmsHelperService.getDebugInfo(positiveActiveEnergyTariff2)); final DataObject negativeActiveEnergyTariff1 = bufferedObjects.get(BUFFER_INDEX_A_NEG_RATE_1 - 1); LOGGER.debug("negativeActiveEnergyTariff1: {}", this.dlmsHelperService.getDebugInfo(negativeActiveEnergyTariff1)); final DataObject negativeActiveEnergyTariff2 = bufferedObjects.get(BUFFER_INDEX_A_NEG_RATE_2 - 1); LOGGER.debug("negativeActiveEnergyTariff2: {}", this.dlmsHelperService.getDebugInfo(negativeActiveEnergyTariff2)); final PeriodicMeterReads nextMeterReads = new PeriodicMeterReads(bufferedDateTime.toDate(), (long) positiveActiveEnergyTariff1.value(), (long) positiveActiveEnergyTariff2.value(), (long) negativeActiveEnergyTariff1.value(), (long) negativeActiveEnergyTariff2.value()); periodicMeterReads.add(nextMeterReads); }

Target:
private void processNextPeriodicMeterReadsForMonthly(final List<PeriodicMeterReads> periodicMeterReads, final List<DataObject> bufferedObjects, final DateTime bufferedDateTime) throws ProtocolAdapterException { final Long positiveActiveEnergyTariff1 = this.dlmsHelperService.readLongNotNull( bufferedObjects.get(BUFFER_INDEX_A_POS_RATE_1 - 1), "positiveActiveEnergyTariff1"); final Long positiveActiveEnergyTariff2 = this.dlmsHelperService.readLongNotNull( bufferedObjects.get(BUFFER_INDEX_A_POS_RATE_2 - 1), "positiveActiveEnergyTariff2"); final Long negativeActiveEnergyTariff1 = this.dlmsHelperService.readLongNotNull( bufferedObjects.get(BUFFER_INDEX_A_NEG_RATE_1 - 1), "negativeActiveEnergyTariff1"); final Long negativeActiveEnergyTariff2 = this.dlmsHelperService.readLongNotNull( bufferedObjects.get(BUFFER_INDEX_A_NEG_RATE_2 - 1), "negativeActiveEnergyTariff2"); final PeriodicMeterReads nextMeterReads = new PeriodicMeterReads(bufferedDateTime.toDate(), positiveActiveEnergyTariff1, positiveActiveEnergyTariff2, negativeActiveEnergyTariff1, negativeActiveEnergyTariff2); periodicMeterReads.add(nextMeterReads); }
Source:
public int dequeueSample(DecoderInputBuffer sample) { DecoderInputBuffer sampleFromQueue = mQueue.poll(); if (sampleFromQueue == null) { return C.RESULT_NOTHING_READ; } int size = sampleFromQueue.data.position(); sample.ensureSpaceForWrite(size); sample.setFlags((sampleFromQueue.isKeyFrame() ? C.BUFFER_FLAG_KEY_FRAME : 0) | (sampleFromQueue.isDecodeOnly() ? C.BUFFER_FLAG_DECODE_ONLY : 0) | (sampleFromQueue.isEncrypted() ? C.BUFFER_FLAG_ENCRYPTED : 0)); sample.timeUs = sampleFromQueue.timeUs; sample.data.clear(); sampleFromQueue.data.position(0).limit(size); sample.data.put(sampleFromQueue.data); mSamplePool.releaseSample(sampleFromQueue); return C.RESULT_BUFFER_READ; }

Target:
public int dequeueSample(DecoderInputBuffer sample) { DecoderInputBuffer sampleFromQueue = mQueue.poll(); if (sampleFromQueue == null) { return C.RESULT_NOTHING_READ; } int size = sampleFromQueue.data.position(); sample.ensureSpaceForWrite(size); sample.setFlags((sampleFromQueue.isKeyFrame() ? C.BUFFER_FLAG_KEY_FRAME : 0) | (sampleFromQueue.isDecodeOnly() ? C.BUFFER_FLAG_DECODE_ONLY : 0) | (sampleFromQueue.isEncrypted() ? C.BUFFER_FLAG_ENCRYPTED : 0)); sample.timeUs = sampleFromQueue.timeUs; sample.data.clear(); sampleFromQueue.flip(); sample.data.put(sampleFromQueue.data); mSamplePool.releaseSample(sampleFromQueue); return C.RESULT_BUFFER_READ; }
Source:
public static Iterable<Object[]> parameters() { List<Fixture> fixtures = new ArrayList<>(); int[] iterations = new int[]{100}; LockManager[] lockManagers = LockManager.values(); LockWaitStrategies[] lockWaitStrategies = LockWaitStrategies.values(); LockType[] lockTypes = LockType.values(); for ( LockManager lockManager : lockManagers ) { for ( LockWaitStrategies waitStrategy : lockWaitStrategies ) { for ( LockType lockTypeAX : lockTypes ) { for ( LockType lockTypeAY : lockTypes ) { for ( LockType lockTypeBX : lockTypes ) { for ( LockType lockTypeBY : lockTypes ) { for ( int iteration : iterations ) { fixtures.add( new Fixture( iteration, lockManager, waitStrategy, lockTypeAX, lockTypeAY, lockTypeBX, lockTypeBY ) ); } } } } } } } return fixtures.stream().map( f -> new Object[]{f} ).collect( Collectors.toList() ); }

Target:
public static Iterable<Object[]> parameters() { List<Fixture> fixtures = new ArrayList<>(); int iteration = 100; LockManager[] lockManagers = LockManager.values(); LockWaitStrategies[] lockWaitStrategies = LockWaitStrategies.values(); LockType[] lockTypes = LockType.values(); for ( LockManager lockManager : lockManagers ) { for ( LockWaitStrategies waitStrategy : lockWaitStrategies ) { for ( LockType lockTypeAX : lockTypes ) { for ( LockType lockTypeAY : lockTypes ) { for ( LockType lockTypeBX : lockTypes ) { for ( LockType lockTypeBY : lockTypes ) { fixtures.add( new Fixture( iteration, lockManager, waitStrategy, lockTypeAX, lockTypeAY, lockTypeBX, lockTypeBY ) ); } } } } } } return fixtures.stream().map( f -> new Object[]{f} ).collect( Collectors.toList() ); }
Source:
public EventHeaderDef createDefinition(IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFReaderException { alignRead(input); ByteOrder bo = input.getByteOrder(); input.setByteOrder(fByteOrder); int first = (int) input.get(COMPACT_ID, false); int second = (int) input.get(COMPACT_TS, false); if (first != 65535) { input.setByteOrder(bo); return new EventHeaderDef(this, first, second, COMPACT_TS); } long timestampLong = input.get(FULL_TS, false); input.setByteOrder(bo); return new EventHeaderDef(this, second, timestampLong, FULL_TS); }

Target:
public EventHeaderDef createDefinition(IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFReaderException { alignRead(input); ByteOrder bo = input.getByteOrder(); input.setByteOrder(fByteOrder); int first = (int) input.get(COMPACT_ID, false); int second = (int) input.get(COMPACT_TS, false); if (first != EXTENDED_VALUE) { input.setByteOrder(bo); return new EventHeaderDef(this, first, second, COMPACT_TS); } long timestampLong = input.get(FULL_TS, false); input.setByteOrder(bo); return new EventHeaderDef(this, second, timestampLong, FULL_TS); }
Source:
public static BeanMapping fromPrism( BeanMappingPrism beanMapping, ExecutableElement method, Messager messager ) { if ( beanMapping == null ) { return null; } boolean resultTypeIsDefined = !TypeKind.VOID.equals( beanMapping.resultType().getKind() ); if ( !resultTypeIsDefined && beanMapping.qualifiedBy().isEmpty() ) { messager.printMessage( Diagnostic.Kind.ERROR, "'resultType' and 'qualifiedBy' are are are undefined in @BeanMapping, " + "define at least one of them.", method ); } return new BeanMapping( beanMapping.qualifiedBy(), resultTypeIsDefined ? beanMapping.resultType() : null ); }

Target:
public static BeanMapping fromPrism( BeanMappingPrism beanMapping, ExecutableElement method, Messager messager ) { if ( beanMapping == null ) { return null; } boolean resultTypeIsDefined = !TypeKind.VOID.equals( beanMapping.resultType().getKind() ); if ( !resultTypeIsDefined && beanMapping.qualifiedBy().isEmpty() ) { messager.printMessage( Diagnostic.Kind.ERROR, "'resultType' and 'qualifiedBy' are undefined in @BeanMapping, " + "define at least one of them.", method ); } return new BeanMapping( beanMapping.qualifiedBy(), resultTypeIsDefined ? beanMapping.resultType() : null ); }
Source:
private TestClient testClient() { final TestClient client = Mockito.mock(TestClient.class); final TestResponse response = Mockito.mock(TestResponse.class); Mockito.when(client.header(Mockito.anyString(), Mockito.anyObject())) .thenReturn(client); Mockito.when(client.post(Mockito.anyString(), Mockito.anyObject())) .thenReturn(response); Mockito.when(response.assertStatus(Mockito.anyInt())) .thenReturn(response); Mockito.when(response.xpath(Mockito.anyString())).thenReturn(null); return client; }

Target:
private TestClient testClient() { final TestClient client = Mockito.mock(TestClient.class); final TestResponse response = Mockito.mock(TestResponse.class); Mockito.when(client.header(Mockito.anyString(), Mockito.anyObject())) .thenReturn(client); Mockito.when(client.post(Mockito.anyString(), Mockito.anyObject())) .thenReturn(response); Mockito.when(response.assertStatus(Mockito.anyInt())) .thenReturn(response); Mockito.when(response.xpath(Mockito.anyString())) .thenReturn(Collections.<String>emptyList()); return client; }
Source:
protected void map( Object key, Object value, Context context ) throws IOException, InterruptedException { try { final InputRow inputRow; try { inputRow = parseInputRow(value, parser); } catch (ParseException e) { if (reportParseExceptions) { throw e; } if (log.isDebugEnabled()) { log.debug(e, "Ignoring invalid row [%s] due to parsing error", value.toString()); } context.getCounter(HadoopDruidIndexerConfig.IndexJobCounters.INVALID_ROW_COUNTER).increment(1); return; } if (inputRow == null) { if (log.isDebugEnabled()) { log.debug("Throwing away row [%s]", value.toString()); } return; } if (!granularitySpec.bucketIntervals().isPresent() || granularitySpec.bucketInterval(DateTimes.utc(inputRow.getTimestampFromEpoch())) .isPresent()) { innerMap(inputRow, value, context, reportParseExceptions); } } catch (RuntimeException e) { throw new RE(e, "Failure on row[%s]", value); } }

Target:
protected void map( Object key, Object value, Context context ) throws IOException, InterruptedException { try { final InputRow inputRow; try { inputRow = parseInputRow(value, parser); } catch (ParseException e) { if (reportParseExceptions) { throw e; } log.debug(e, "Ignoring invalid row [%s] due to parsing error", value); context.getCounter(HadoopDruidIndexerConfig.IndexJobCounters.INVALID_ROW_COUNTER).increment(1); return; } if (inputRow == null) { log.debug("Throwing away row [%s]", value); return; } if (!granularitySpec.bucketIntervals().isPresent() || granularitySpec.bucketInterval(DateTimes.utc(inputRow.getTimestampFromEpoch())) .isPresent()) { innerMap(inputRow, value, context, reportParseExceptions); } } catch (RuntimeException e) { throw new RE(e, "Failure on row[%s]", value); } }
Source:
private void setLatestExecutionStatus(final SchedulingServiceAsync service, final JobIdentifier job, final TenantIdentifier tenant) { service.getLatestExecution(tenant, job, new DCAsyncCallback<ExecutionLog>() { @Override public void onSuccess(final ExecutionLog result) { if (result != null) { final ExecutionStatus executionStatus = result.getExecutionStatus(); final DateTimeFormat formatDate = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); final String formattedDate = formatDate.format(result.getJobBeginDate()); latestExecutionLabel.setText("- Latest execution:" + formattedDate + ", " + executionStatus.name()); } } }); }

Target:
private void setLatestExecutionStatus(final SchedulingServiceAsync service, final JobIdentifier job, final TenantIdentifier tenant) { service.getLatestExecution(tenant, job, new DCAsyncCallback<ExecutionLog>() { @Override public void onSuccess(final ExecutionLog result) { if (result != null) { final String executionStatus = result.getExecutionStatus().toString().toLowerCase(); final String formattedDate = FORMAT_DATE.format(result.getJobBeginDate()); latestExecutionLabel.setText("- Latest execution: " + formattedDate + ", " + executionStatus .substring(0, 1).toUpperCase() + executionStatus.substring(1)); } } }); }
Source:
private List<MavenProject> probableFractionProjects() { if (PROBABLE_FRACTIONS == null) { final ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); request.setProcessPlugins(false); request.setSystemProperties(System.getProperties()); request.setRemoteRepositories(this.project.getRemoteArtifactRepositories()); request.setRepositorySession(this.repositorySystemSession); request.setResolveDependencies(true); try { PROBABLE_FRACTIONS = this.projectBuilder .build(Collections.singletonList(findRoot(this.project).getFile()), true, request) .stream() .filter(this::isNotArquillianArtifact) .map(ProjectBuildingResult::getProject) .collect(Collectors.toList()); } catch (ProjectBuildingException e) { getLog().error(e); } } return PROBABLE_FRACTIONS; }

Target:
private List<MavenProject> probableFractionProjects() throws MojoExecutionException { if (PROBABLE_FRACTIONS == null) { final ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); request.setProcessPlugins(false); request.setSystemProperties(System.getProperties()); request.setRemoteRepositories(this.project.getRemoteArtifactRepositories()); request.setRepositorySession(this.repositorySystemSession); request.setResolveDependencies(true); try { PROBABLE_FRACTIONS = this.projectBuilder .build(Collections.singletonList(findRoot(this.project).getFile()), true, request) .stream() .filter(this::isNotArquillianArtifact) .map(ProjectBuildingResult::getProject) .collect(Collectors.toList()); } catch (ProjectBuildingException e) { throw new MojoExecutionException("Error generating list of PROBABLE_FRACTIONS", e); } } return PROBABLE_FRACTIONS; }