auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void verifySuggest() { createGraphMLAndWaitUntilDone(); given().params("s", "unknown") .accept(ContentType.JSON) .get("/search/suggestions/{namespace}/", "acme:regions") .then().statusCode(204); Response response = given().params("s", "North Region") .accept(ContentType.JSON) .get("/search/suggestions/{namespace}/", "acme:regions"); LOG.info("Results from search:" + response.asString()); response .then().statusCode(200) .contentType(ContentType.JSON) .content("[0].context", Matchers.is("GenericVertex")) .content("[0].label", Matchers.is("North Region")) .content("[0].provider", Matchers.is("LabelSearchProvider")); }

Target:
public void verifySuggest() { createGraphMLAndWaitUntilDone(); given().log().ifValidationFails() .params("s", "unknown") .accept(ContentType.JSON) .get("/search/suggestions/{namespace}/", "acme:regions") .then().log().ifValidationFails() .statusCode(204); given().log().ifValidationFails() .params("s", "North Region") .accept(ContentType.JSON) .get("/search/suggestions/{namespace}/", "acme:regions") .then().log().ifValidationFails() .statusCode(200) .contentType(ContentType.JSON) .content("[0].context", Matchers.is("GenericVertex")) .content("[0].label", Matchers.is("North Region")) .content("[0].provider", Matchers.is("LabelSearchProvider")) .content("", Matchers.hasSize(1)); }
Source:
public void tearDown() { if (null == defaultAndesAckWaitTimeOut) { System.clearProperty("AndesAckWaitTimeOut"); } else { System.setProperty("AndesAckWaitTimeOut", defaultAndesAckWaitTimeOut); } }

Target:
public void tearDown() { if (StringUtils.isBlank(defaultAndesAckWaitTimeOut)) { System.clearProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY); } else { System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, defaultAndesAckWaitTimeOut); } }
Source:
public WintersNight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}{R}{G}"); addSuperType(SuperType.WORLD); ManaEffect effect = new AddManaOfAnyTypeProducedEffect(); effect.setText("that player adds one mana to his or her mana pool of any type that land produced"); Ability ability = new TapForManaAllTriggeredManaAbility(effect, filter, SetTargetPointer.PERMANENT); Effect effect2 = new DontUntapInControllersNextUntapStepTargetEffect(); effect2.setText("That land doesn't untap during its controller's next untap step"); ability.addEffect(effect2); this.addAbility(ability); }

Target:
public WintersNight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}{G}{W}"); addSuperType(SuperType.WORLD); ManaEffect effect = new AddManaOfAnyTypeProducedEffect(); effect.setText("that player adds one mana to his or her mana pool of any type that land produced"); Ability ability = new TapForManaAllTriggeredManaAbility(effect, filter, SetTargetPointer.PERMANENT); Effect effect2 = new DontUntapInControllersNextUntapStepTargetEffect(); effect2.setText("That land doesn't untap during its controller's next untap step"); ability.addEffect(effect2); this.addAbility(ability); }
Source:
@CombineFunction public static void combine( @AggregationState DifferentialEntropyState state, @AggregationState DifferentialEntropyState otherState) { DifferentialEntropyStateStrategy strategy = state.getStrategy(); DifferentialEntropyStateStrategy otherStrategy = otherState.getStrategy(); if (strategy == null && otherStrategy != null) { state.setStrategy(otherStrategy); return; } if (otherStrategy == null) { return; } verify(strategy.getClass() == otherStrategy.getClass(), format("In combine, %s != %s", strategy.getClass().getSimpleName(), otherStrategy.getClass().getSimpleName())); strategy.mergeWith(otherStrategy); }

Target:
public static void combine( @AggregationState DifferentialEntropyState state, @AggregationState DifferentialEntropyState otherState) { DifferentialEntropyStateStrategy strategy = state.getStrategy(); DifferentialEntropyStateStrategy otherStrategy = otherState.getStrategy(); if (strategy == null && otherStrategy != null) { state.setStrategy(otherStrategy); return; } if (otherStrategy == null) { return; } verify(strategy.getClass() == otherStrategy.getClass(), format("In combine, %s != %s", strategy.getClass().getSimpleName(), otherStrategy.getClass().getSimpleName())); strategy.mergeWith(otherStrategy); }
Source:
protected void executeQueryCommand() { HashMap<String, List<String>> namespacesMap = new HashMap<>(); for (ExtensionProxy authz: EngineExtensionsManager.getInstance().getExtensionsByService(Authz.class.getName())) { for (String namespace : authz.getContext().get(Authz.ContextKeys.AVAILABLE_NAMESPACES, Arrays.asList("*"))) { MultiValueMapUtils.addToMap(AuthzUtils.getName(authz), namespace, namespacesMap); } } for (Entry<String, List<String>> entry : namespacesMap.entrySet()) { Collections.sort(entry.getValue()); } setReturnValue(namespacesMap); }

Target:
protected void executeQueryCommand() { HashMap<String, List<String>> namespacesMap = new HashMap<>(); for (ExtensionProxy authz: EngineExtensionsManager.getInstance().getExtensionsByService(Authz.class.getName())) { for (String namespace : authz.getContext().get(Authz.ContextKeys.AVAILABLE_NAMESPACES, Arrays.asList("*"))) { MultiValueMapUtils.addToMap(AuthzUtils.getName(authz), namespace, namespacesMap); } } for (List<String> entry : namespacesMap.values()) { Collections.sort(entry); } setReturnValue(namespacesMap); }
Source:
public void testAlwaysMeteredVpnWithNonNullUnderlyingNetwork() throws Exception { if (!supportedHardware()) { return; } Network wifi = getWifiNetwork(); assertEquals(wifi, mCM.getActiveNetwork()); ArrayList<Network> underlyingNetworks = new ArrayList<>(1); underlyingNetworks.add(wifi); String allowedApps = mPackageName; boolean isAlwaysMetered = true; startVpn( new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"}, new String[] {"0.0.0.0/0", "::/0"}, allowedApps, "", null, underlyingNetworks, isAlwaysMetered); assertEquals(mNetwork, mCM.getActiveNetwork()); ensureVpnTransportContains(NetworkCapabilities.TRANSPORT_WIFI); assertTrue(isNetworkMetered(mNetwork)); assertTrue(mCM.isActiveNetworkMetered()); }

Target:
public void testAlwaysMeteredVpnWithNonNullUnderlyingNetwork() throws Exception { if (!supportedHardware()) { return; } Network wifi = getWifiNetwork(); assertEquals(wifi, mCM.getActiveNetwork()); ArrayList<Network> underlyingNetworks = new ArrayList<>(1); underlyingNetworks.add(wifi); String allowedApps = mPackageName; boolean isAlwaysMetered = true; startVpn( new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"}, new String[] {"0.0.0.0/0", "::/0"}, allowedApps, "", null, underlyingNetworks, isAlwaysMetered); assertEquals(mNetwork, mCM.getActiveNetwork()); assertVpnTransportContains(NetworkCapabilities.TRANSPORT_WIFI); assertTrue(isNetworkMetered(mNetwork)); assertTrue(mCM.isActiveNetworkMetered()); }
Source:
public void eventReceived(Object output) { if (output instanceof MIOutput) { MIOOBRecord[] records = ((MIOutput)output).getMIOOBRecords(); for (MIOOBRecord r : records) { if (r instanceof MINotifyAsyncOutput) { MINotifyAsyncOutput notifyOutput = (MINotifyAsyncOutput)r; String asyncClass = notifyOutput.getAsyncClass(); if ("record-started".equals(asyncClass) || "record-stopped".equals(asyncClass)) { if ("record-stopped".equals(asyncClass)) { fReverseTraceMethod = ReverseTraceMethod.STOP_TRACE; getSession().dispatchEvent(new GdbReverseModeChangedDMEvent(fCommandControl.getContext(), false), getProperties()); return; } else { getConnection().queueCommand( fCommandFactory.createCLIRecord(getConnection().getContext()), new DataRequestMonitor<MIInfo>(getExecutor(), null) { @Override public void handleSuccess() { MIOutput output = getData().getMIOutput(); if (output.toString().contains("Processor")) fReverseTraceMethod = ReverseTraceMethod.PROCESSOR_TRACE; else if (output.toString().contains("Branch")) fReverseTraceMethod = ReverseTraceMethod.BRANCH_TRACE; else fReverseTraceMethod = ReverseTraceMethod.FULL_TRACE; getSession().dispatchEvent(new GdbReverseModeChangedDMEvent(fCommandControl.getContext(), true), getProperties()); done(); } @Override public void handleFailure() { done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Trace method could not be determined", null)); } }); } } } } } }

Target:
public void eventReceived(Object output) { if (output instanceof MIOutput) { MIOOBRecord[] records = ((MIOutput)output).getMIOOBRecords(); for (MIOOBRecord r : records) { if (r instanceof MINotifyAsyncOutput) { MINotifyAsyncOutput notifyOutput = (MINotifyAsyncOutput)r; String asyncClass = notifyOutput.getAsyncClass(); if ("record-started".equals(asyncClass) || "record-stopped".equals(asyncClass)) { if ("record-stopped".equals(asyncClass)) { fReverseTraceMethod = ReverseTraceMethod.STOP_TRACE; getSession().dispatchEvent(new GdbReverseModeChangedDMEvent(fCommandControl.getContext(), false), getProperties()); } else { getConnection().queueCommand( fCommandFactory.createCLIInfoRecord(getConnection().getContext()), new DataRequestMonitor<MIinfoRecord>(getExecutor(), null) { @Override public void handleSuccess() { MIinfoRecord output = getData(); fReverseTraceMethod = output.getReverseMethod(); getSession().dispatchEvent(new GdbReverseModeChangedDMEvent(fCommandControl.getContext(), true), getProperties()); } }); } } } } } }
Source:
public Response getSearch(@QueryParam("q") String q) { try { PipedInputStream results = spawn.getSearchResultStream(new SearchOptions(q)); StreamingOutput stream = new StreamingOutput() { @Override public void write(OutputStream output) throws IOException, WebApplicationException { byte[] buf = new byte[256]; while (results.read(buf) != -1) { output.write(buf); output.flush(); } results.close(); } }; return Response.ok().entity(stream).build(); } catch (IOException e) { e.printStackTrace(); return Response.serverError().build(); } }

Target:
public Response getSearch(@QueryParam("q") String q) { try { final PipedInputStream results = spawn.getSearchResultStream(new SearchOptions(q)); StreamingOutput stream = new StreamingOutput() { @Override public void write(OutputStream output) throws IOException, WebApplicationException { byte[] buf = new byte[256]; try { while (results.read(buf) != -1) { output.write(buf); output.flush(); } } finally { results.close(); } } }; return Response.ok().entity(stream).build(); } catch (IOException e) { e.printStackTrace(); return Response.serverError().build(); } }
Source:
public HighscoreLeaderboard() { removeQueue = new ConcurrentLinkedQueue<>(); addQueue = new ConcurrentLinkedQueue<>(); entries = FXCollections.observableArrayList(); addedEntries = new HashMap<>(); setItems(entries); setStyle("-fx-font: 20 arial; "); }

Target:
public HighscoreLeaderboard() { entries = FXCollections.observableArrayList(); sortedEntries = Collections.synchronizedSortedSet(new TreeSet<Entry>((c1, c2) -> Double.compare(c2.score, c1.score))); setItems(entries); setStyle("-fx-font: 20 arial; "); }
Source:
private String parseCodeName() { if (this.major == 10) { final String OSHI_VERSIONS_PROPERTIES = "oshi.versions.properties"; Properties verProps = FileUtil.readPropertiesFromFilename(OSHI_VERSIONS_PROPERTIES); String major = String.valueOf(this.major); String minor = String.valueOf(this.minor); String version_number = major+"."+minor; String version_name = verProps.getProperty(version_number); return version_name; } LOG.warn("Unable to parse version {}.{} to a codename.", this.major, this.minor); return ""; }

Target:
private String parseCodeName() { if (this.major == 10) { Properties verProps = FileUtil.readPropertiesFromFilename(MACOS_VERSIONS_PROPERTIES); return verProps.getProperty(this.major + "." + this.minor); } LOG.warn("Unable to parse version {}.{} to a codename.", this.major, this.minor); return ""; }
Source:
public CommandProcessingResult close(Long savingsId, JsonCommand command) { final AppUser user = this.context.authenticatedUser(); this.savingsAccountTransactionDataValidator.validateClosing(command); final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); final List<Long> existingTransactionIds = new ArrayList<Long>(); final List<Long> existingReversedTransactionIds = new ArrayList<Long>(); final Map<String, Object> changes = account.close(user, command, DateUtils.getLocalDateOfTenant()); if (!changes.isEmpty()) { this.savingAccountRepository.save(account); final String noteText = command.stringValueOfParameterNamed("note"); if (StringUtils.isNotBlank(noteText)) { final Note note = Note.savingNote(account, noteText); changes.put("note", noteText); this.noteRepository.save(note); } } postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds); return new CommandProcessingResultBuilder() .withEntityId(savingsId) .withOfficeId(account.officeId()) .withClientId(account.clientId()) .withGroupId(account.groupId()) .withSavingsId(savingsId) .with(changes) .build(); }

Target:
public CommandProcessingResult close(Long savingsId, JsonCommand command) { final AppUser user = this.context.authenticatedUser(); this.savingsAccountTransactionDataValidator.validateClosing(command); final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); final Map<String, Object> changes = account.close(user, command, DateUtils.getLocalDateOfTenant()); if (!changes.isEmpty()) { this.savingAccountRepository.save(account); final String noteText = command.stringValueOfParameterNamed("note"); if (StringUtils.isNotBlank(noteText)) { final Note note = Note.savingNote(account, noteText); changes.put("note", noteText); this.noteRepository.save(note); } } return new CommandProcessingResultBuilder() .withEntityId(savingsId) .withOfficeId(account.officeId()) .withClientId(account.clientId()) .withGroupId(account.groupId()) .withSavingsId(savingsId) .with(changes) .build(); }
Source:
public static Triple fromJena(RDFTermFactory factory, org.apache.jena.graph.Triple triple) throws ConversionException{ if (factory instanceof JenaRDFTermFactory) { return ((JenaRDFTermFactory) factory).fromJena(triple); } BlankNodeOrIRI subject; IRI predicate; try { subject = (BlankNodeOrIRI) fromJena(factory, triple.getSubject()); predicate = (IRI) fromJena(factory, triple.getPredicate()); } catch (ClassCastException ex) { throw new ConversionException("Can't convert generalized triple: " + triple, ex); } RDFTerm object = fromJena(factory, triple.getObject()); return factory.createTriple(subject, predicate, object); }

Target:
public static Triple fromJena(RDFTermFactory factory, org.apache.jena.graph.Triple triple) throws ConversionException{ if (factory instanceof JenaRDFTermFactory) { return ((JenaRDFTermFactory) factory).fromJena(triple); } final BlankNodeOrIRI subject; final IRI predicate; try { subject = (BlankNodeOrIRI) fromJena(factory, triple.getSubject()); predicate = (IRI) fromJena(factory, triple.getPredicate()); } catch (ClassCastException ex) { throw new ConversionException("Can't convert generalized triple: " + triple, ex); } RDFTerm object = fromJena(factory, triple.getObject()); return factory.createTriple(subject, predicate, object); }
Source:
public boolean equals(Object o) { if (o instanceof RassXMLAwardPiCoPiEntry) { RassXMLAwardPiCoPiEntry other = (RassXMLAwardPiCoPiEntry) o; return StringUtils.equals(primaryString, other.getPrimaryString()) && StringUtils.equals(primaryString, other.getPrimaryString()); } else { return false; } }

Target:
public boolean equals(Object o) { if (o instanceof RassXMLAwardPiCoPiEntry) { RassXMLAwardPiCoPiEntry other = (RassXMLAwardPiCoPiEntry) o; return Objects.equals(primary, other.getPrimary()) && StringUtils.equals(projectDirectorPrincipalName, other.getProjectDirectorPrincipalName()); } else { return false; } }
Source:
private boolean shouldLoadFromBackstack(@NonNull Activity activity) { return activity.getIntent() != null && (ACTION_SHOW_TAB_LIST.equals(getActivity().getIntent().getAction()) || ACTION_RESUME_READING.equals(getActivity().getIntent().getAction())); }

Target:
private boolean shouldLoadFromBackstack(@NonNull Activity activity) { return activity.getIntent() != null && (ACTION_SHOW_TAB_LIST.equals(activity.getIntent().getAction()) || ACTION_RESUME_READING.equals(activity.getIntent().getAction())); }
Source:
public abstract Connection getConnection() throws SQLException; public abstract void initDB() throws SQLException; public abstract void cleanDB() throws SQLException; public void runScript(String script) { try { ScriptRunner runner = new ScriptRunner(con, false, true); URL url = Thread.currentThread().getContextClassLoader().getResource(script); runner.runScript(new BufferedReader(new FileReader(url.getPath()))); } catch (Exception e) { System.err.println(e); fail(e.getMessage()); } }

Target:
public abstract Connection getConnection() throws SQLException; public abstract void initDB() throws SQLException; public abstract void cleanDB() throws SQLException; public void runScript(String script) { try { ScriptRunner runner = new ScriptRunner(con, false, true); URL url = Thread.currentThread().getContextClassLoader().getResource(script); runner.runScript(new BufferedReader(new FileReader(url.getPath()))); } catch (Exception e) { fail(e.getMessage()); } }
Source:
private PluginMeta getMeta(PluginFQN pluginFQN) throws InfrastructureException { final String id = pluginFQN.getId(); final String version = pluginFQN.getVersion(); try { UriBuilder metaURIBuilder = pluginFQN.getRegistry() == null ? pluginRegistry.clone() : UriBuilder.fromUri(pluginFQN.getRegistry()); URI metaURI = metaURIBuilder.path(id).path(version).path("meta.yaml").build(); PluginMeta meta = getBody(metaURI, PluginMeta.class); validateMeta(meta, id, version); return meta; } catch (IllegalArgumentException | UriBuilderException | MalformedURLException e) { throw new InternalInfrastructureException( format("Metadata of plugin %s:%s retrieval failed", id, version)); } catch (IOException e) { throw new InfrastructureException( format( "Error occurred on retrieval of plugin %s. Error: %s", id + ':' + version, e.getMessage())); } }

Target:
private PluginMeta getMeta(PluginFQN pluginFQN) throws InfrastructureException { final String id = pluginFQN.getId(); final String version = pluginFQN.getVersion(); try { UriBuilder metaURIBuilder = pluginFQN.getRegistry() == null ? pluginRegistry.clone() : UriBuilder.fromUri(pluginFQN.getRegistry()); URI metaURI = metaURIBuilder.path(id).path(version).path("meta.yaml").build(); PluginMeta meta = getBody(metaURI, PluginMeta.class); validateMeta(meta, id, version); return meta; } catch (IllegalArgumentException | UriBuilderException | MalformedURLException e) { throw new InternalInfrastructureException( format( "Metadata of plugin %s:%s retrieval failed. Error is %s", id, version, e.getMessage())); } catch (IOException e) { throw new InfrastructureException( format( "Error occurred on retrieval of plugin %s. Error: %s", id + ':' + version, e.getMessage())); } }
Source:
public String errorMessage() { return String.format("Expected result to match regular expression:%n%s%n%nbut found:%n%s%n", failedRegex, failedActual); }

Target:
public String errorMessage() { return String.format("Expected result to match regular expression:" + "%n%s%n%nbut found:%n%s%n", failedRegex, failedActual); }
Source:
public void testGetProjectScrumWorkersUsername(){ ProjectInfo projectInfo = new ProjectInfo(); projectInfo.name = "TEST_PROJECT_NAME"; projectInfo.displayName = "TEST_PROJECT_DISPLAYNAME"; projectInfo.common = "TEST_PROJECT_COMMON"; projectInfo.manager = "TEST_PROJECT_MANAGER"; projectInfo.attachFileSize = 2048L; long projectId = mProjectMapper.createProject(projectInfo.name, projectInfo); assertTrue(projectId > 0); assertEquals(0, mProjectMapper.getProjectScrumWorkersUsername(projectId).size()); String accountName = "TEST_ACCOUNT_NAME"; String nickName = "TEST_ACCOUNT_NICKNAME"; String email = "TEST_ACCOUNT_EMAIL"; String password = "TEST_ACCOUNT_PASSWORD"; AccountObject account = new AccountObject(accountName); account.setNickName(nickName); account.setEmail(email); account.setPassword(password); account.save(); boolean createResult = account.createProjectRole(projectId, RoleEnum.ProductOwner); assertTrue(createResult); ArrayList<String> userNameList = mProjectMapper.getProjectScrumWorkersUsername(projectId); assertEquals(1, userNameList.size()); assertEquals(accountName, userNameList.get(0)); }

Target:
public void testGetProjectScrumWorkersUsername(){ assertEquals(0, mProjectMapper.getProjectScrumWorkersUsername(mProjectId).size()); String accountName = "TEST_ACCOUNT_NAME"; String nickName = "TEST_ACCOUNT_NICKNAME"; String email = "TEST_ACCOUNT_EMAIL"; String password = "TEST_ACCOUNT_PASSWORD"; AccountObject account = new AccountObject(accountName); account.setNickName(nickName); account.setEmail(email); account.setPassword(password); account.save(); boolean createAcountResult = account.createProjectRole(mProjectId, RoleEnum.ProductOwner); assertTrue(createAcountResult); ArrayList<String> userNameList = mProjectMapper.getProjectScrumWorkersUsername(mProjectId); assertEquals(1, userNameList.size()); assertEquals(accountName, userNameList.get(0)); }
Source:
JsonResponseHistoryServerArchivist(JsonArchivist jsonArchivist, Path archivePath, Executor ioExecutor) { this.jsonArchivist = Preconditions.checkNotNull(jsonArchivist); this.archivePath = Preconditions.checkNotNull(archivePath); this.ioExecutor = ioExecutor; }

Target:
JsonResponseHistoryServerArchivist(JsonArchivist jsonArchivist, Path archivePath, Executor ioExecutor) { this.jsonArchivist = Preconditions.checkNotNull(jsonArchivist); this.archivePath = Preconditions.checkNotNull(archivePath); this.ioExecutor = Preconditions.checkNotNull(ioExecutor); }
Source:
public RemotingOkHttpCall doClone() { return new RemotingOkHttpCall(getDelegate().clone(), backoffStrategy, urls, client, schedulingExecutor, executionExecutor, timeout, maxNumRelocations); }

Target:
public RemotingOkHttpCall doClone() { return new RemotingOkHttpCall(getDelegate().clone(), backoffStrategy, urls, client, schedulingExecutor, executionExecutor, syncCallTimeout, maxNumRelocations); }
Source:
public void completed(AbstractBuild r) { if (skipOnMatrixChildren(r)) { return; } String key = BuildKey.format(r); AbstractProject<?, ?> project = r.getProject(); AbstractBuild<?, ?> previousBuild = project.getLastBuild(); if (null != previousBuild) { do { previousBuild = previousBuild.getPreviousCompletedBuild(); } while ((null != previousBuild && previousBuild.getResult() == Result.ABORTED) || previousBuild.getNumber() == r.getNumber()); if (null != previousBuild) { log.info(key, "found #%d as previous completed, non-aborted build", previousBuild.getNumber()); } else { log.debug(key, "did not find previous completed, non-aborted build"); } NotificationConditions conditions = NotificationConditions.create(notifier, log); if (conditions.test(new Context(r, previousBuild))) { String message = getBuildStatusMessage(r, notifier.getIncludeTestSummary(), notifier.getIncludeFailedTests(), notifier.getIncludeCustomMessage()); if (notifier.getCommitInfoChoice().showAnything()) { message = message + "\n" + getCommitList(r); } slackFactory.apply(r).publish(message, getBuildColor(r)); } } }

Target:
public void completed(AbstractBuild r) { if (skipOnMatrixChildren(r)) { return; } String key = BuildKey.format(r); AbstractProject<?, ?> project = r.getProject(); AbstractBuild<?, ?> previousBuild = project.getLastBuild(); if (null != previousBuild) { do { previousBuild = previousBuild.getPreviousCompletedBuild(); } while ((null != previousBuild && previousBuild.getResult() == Result.ABORTED) || (null != previousBuild && previousBuild.getNumber() == r.getNumber())); if (null != previousBuild) { log.info(key, "found #%d as previous completed, non-aborted build", previousBuild.getNumber()); } else { log.debug(key, "did not find previous completed, non-aborted build"); } NotificationConditions conditions = NotificationConditions.create(notifier, log); if (conditions.test(new Context(r, previousBuild))) { String message = getBuildStatusMessage(r, notifier.getIncludeTestSummary(), notifier.getIncludeFailedTests(), notifier.getIncludeCustomMessage()); if (notifier.getCommitInfoChoice().showAnything()) { message = message + "\n" + getCommitList(r); } slackFactory.apply(r).publish(message, getBuildColor(r)); } } }
Source:
public void testIterationStart(LoopIterationEvent event) { JMeterVariables jMeterVariables = JMeterContextService.getContext().getVariables(); if ((getControlledByThread() && !jMeterVariables.isSameUserOnNextIteration()) || getClearEachIteration()) { log.debug("Initialise cookies from pre-defined list"); setProperty(initialCookies.clone()); } }

Target:
public void testIterationStart(LoopIterationEvent event) { JMeterVariables jMeterVariables = JMeterContextService.getContext().getVariables(); if ((getControlledByThread() && !jMeterVariables.isSameUserOnNextIteration()) || (!getControlledByThread() && getClearEachIteration())) { log.debug("Initialise cookies from pre-defined list"); setProperty(initialCookies.clone()); } }
Source:
private void endApplication(@Nullable Thread uncaughtExceptionThread, Throwable th) { final boolean letDefaultHandlerEndApplication = config.alsoReportToAndroidFramework(); final boolean handlingUncaughtException = uncaughtExceptionThread != null; if (!Debug.isDebuggerConnected() && handlingUncaughtException && letDefaultHandlerEndApplication && defaultExceptionHandler != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Handing Exception on to default ExceptionHandler"); defaultExceptionHandler.uncaughtException(uncaughtExceptionThread, th); } else { final Activity lastActivity = lastActivityManager.getLastActivity(); if (lastActivity != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Finishing the last Activity prior to killing the Process"); lastActivity.runOnUiThread(new Runnable() { @Override public void run() { lastActivity.finish(); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Finished " + lastActivity.getClass()); } }); if (uncaughtExceptionThread != lastActivity.getMainLooper().getThread()) { lastActivityManager.waitForActivityStop(100); } lastActivityManager.clearLastActivity(); } if (!Debug.isDebuggerConnected()) { android.os.Process.killProcess(android.os.Process.myPid()); System.exit(10); } } }

Target:
private void endApplication(@Nullable Thread uncaughtExceptionThread, Throwable th) { final boolean letDefaultHandlerEndApplication = config.alsoReportToAndroidFramework(); final boolean handlingUncaughtException = uncaughtExceptionThread != null; if (handlingUncaughtException && letDefaultHandlerEndApplication && defaultExceptionHandler != null) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Handing Exception on to default ExceptionHandler"); defaultExceptionHandler.uncaughtException(uncaughtExceptionThread, th); } else { finishLastActivity(uncaughtExceptionThread); android.os.Process.killProcess(android.os.Process.myPid()); System.exit(10); } }
Source:
public java.util.Optional<ComponentDto> selectById(DbSession session, long id) { return java.util.Optional.ofNullable(mapper(session).selectById(id)); }

Target:
public Optional<ComponentDto> selectById(DbSession session, long id) { return Optional.fromNullable(mapper(session).selectById(id)); }
Source:
} catch (ClassFilterException ex) { LOGGER.log(Level.SEVERE, "Default class filter cannot be initialized. Remoting will not start", ex); throw new IllegalStateException("Default class filter cannot be initialized", ex); }

Target:
} catch (ClassFilterException ex) { LOGGER.log(Level.SEVERE, "Default class filter cannot be initialized. Remoting will not start", ex); throw new ExceptionInInitializerError(ex); }
Source:
public void registerForConnectivityEvents(@NonNull Object object, @NonNull ConnectivityChangeListener listener) { if (configuration == null) { throw new IllegalStateException(NOT_INITIALIZED_ERROR); } registerForConnectivityEvents(object, configuration.isNotifyImmediately(), listener); }

Target:
public void registerForConnectivityEvents(@NonNull Object object, @NonNull ConnectivityChangeListener listener) { assertNotNull(configuration); registerForConnectivityEvents(object, configuration.isNotifyImmediately(), listener); }
Source:
public Subscriber<? super Observable[]> call(final Subscriber<? super R> child) { final Zip<R> zipper = new Zip<R>(child, zipFunction); final ZipProducer<R> producer = new ZipProducer<R>(zipper); child.setProducer(producer); return new ZipSubscriber(child, zipper, producer); }

Target:
public Subscriber<? super Observable[]> call(final Subscriber<? super R> child) { final Zip<R> zipper = new Zip<R>(child, zipFunction); final ZipProducer<R> producer = new ZipProducer<R>(zipper); child.setProducer(producer); final ZipSubscriber subscriber = new ZipSubscriber(child, zipper, producer); return subscriber; }
Source:
public BatchItem(final JSONObject event) { this.response = new BatchItemResponse(); this.event = event; Optional. of(event.optJSONObject("metadata")) .map(e -> e.optString("eid")) .ifPresent(this.response::setEid); }

Target:
public BatchItem(final JSONObject event) { this.response = new BatchItemResponse(); this.event = event; Optional. ofNullable(event.optJSONObject("metadata")) .map(e -> e.optString("eid", null)) .ifPresent(this.response::setEid); }
Source:
private static OrcProto.ColumnEncoding toColumnEncoding(ColumnEncoding columnEncodings) { Preconditions.checkArgument( !columnEncodings.getSequenceEncodings().isPresent(), "ORC writer doesn't support flat map encodings: " + columnEncodings); return OrcProto.ColumnEncoding.newBuilder() .setKind(toColumnEncoding(columnEncodings.getColumnEncodingKind())) .setDictionarySize(columnEncodings.getDictionarySize()) .build(); }

Target:
private static OrcProto.ColumnEncoding toColumnEncoding(ColumnEncoding columnEncodings) { checkArgument( !columnEncodings.getAdditionalSequenceEncodings().isPresent(), "Writing columns with non-zero sequence IDs is not supported in ORC: " + columnEncodings); return OrcProto.ColumnEncoding.newBuilder() .setKind(toColumnEncoding(columnEncodings.getColumnEncodingKind())) .setDictionarySize(columnEncodings.getDictionarySize()) .build(); }
Source:
public static Coder<?> of() { return new HBaseMutationCoder(); }

Target:
public static Coder<Mutation> of() { return new HBaseMutationCoder(); }
Source:
public void testAutomaticStartStop() throws Exception { final TestRunnable task = new TestRunnable(500); e.execute(task); Thread thread = e.thread; assertThat(thread, is(not(nullValue()))); assertThat(thread.isAlive(), is(true)); thread.join(); assertThat(thread.isAlive(), is(false)); assertThat(task.ran.get(), is(true)); task.ran.set(false); e.execute(task); assertThat(e.thread, not(sameInstance(thread))); thread = e.thread; thread.join(); assertThat(thread.isAlive(), is(false)); assertThat(task.ran.get(), is(true)); }

Target:
public void testAutomaticStartStop() throws Exception { final TestRunnable task = new TestRunnable(500); e.execute(task); Thread thread = e.thread; assertThat(thread, is(not(nullValue()))); assertThat(thread.isAlive(), is(true)); thread.join(); assertThat(task.ran.get(), is(true)); task.ran.set(false); e.execute(task); assertThat(e.thread, not(sameInstance(thread))); thread = e.thread; thread.join(); assertThat(task.ran.get(), is(true)); }
Source:
protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { return new String[] { "stepInitializeBaseSequence", "stepSetEnvironmentVariables", "stepSetExecutable", "stepSetArguments", "stepRemoteConnection", "stepSpecifyCoreFile", "stepStartTrackingBreakpoints", "stepInitializeMemory", "stepStartExecution", "stepCleanupBaseSequence", }; } return null; }

Target:
protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { return new String[] { "stepInitializeBaseSequence", "stepSetEnvironmentVariables", "stepSetExecutable", "stepSetArguments", "stepRemoteConnection", "stepSpecifyCoreFile", "stepInitializeMemory", "stepStartTrackingBreakpoints", "stepStartExecution", "stepCleanupBaseSequence", }; } return null; }
Source:
public void onReceive(Context context, Intent intent) { mContext = context; if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) { Uri messageUri = intent.getData(); byte[] pdu = (byte[]) intent.getExtra("pdu"); SmsMessage message = updateMessageStatus(context, messageUri, pdu); if (message.getStatus() < Sms.STATUS_PENDING) MessagingNotification.nonBlockingUpdateNewMessageIndicator(context, true, message.isStatusReportMessage); } }

Target:
public void onReceive(Context context, Intent intent) { mContext = context; if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) { Uri messageUri = intent.getData(); byte[] pdu = (byte[]) intent.getExtra("pdu"); SmsMessage message = updateMessageStatus(context, messageUri, pdu); if (message.getStatus() < Sms.STATUS_PENDING) MessagingNotification.nonBlockingUpdateNewMessageIndicator(context, true, message.isStatusReportMessage()); } }
Source:
public Channel retrieve(VeluxBridge bridge) { logger.trace("retrieve() called."); GetWLANConfig bcp = bridge.bridgeAPI().getWLANConfig(); if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { logger.trace("retrieve() found successfully configuration {}.", bcp.getWLANConfig()); channel.wlanSSID = new StringType(bcp.getWLANConfig().getSSID()); channel.wlanPassword = new StringType(bcp.getWLANConfig().getPassword()); channel.isRetrieved = true; return channel; } else { logger.trace("retrieve() finished with failure."); return null; } }

Target:
public Channel retrieve(VeluxBridge bridge) { logger.trace("retrieve() called."); GetWLANConfig bcp = bridge.bridgeAPI().getWLANConfig(); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { logger.trace("retrieve() found successfully configuration {}.", bcp.getWLANConfig()); channel.openHABwlanSSID = new StringType(bcp.getWLANConfig().getSSID()); channel.openHABwlanPassword = new StringType(bcp.getWLANConfig().getPassword()); channel.isRetrieved = true; return channel; } else { logger.trace("retrieve() finished with failure."); return null; } }
Source:
private void changeLegendLabelHandling() { chartWidget.getOptions().getLegend() .getLabels().setLabelsCallback(new LegendLabelsCallback() { @Override public LegendLabelItem[] generateLegendLabels(IsChart chart) { List<LegendLabelItem> legendItems = new ArrayList<LegendLabelItem>(); List<String> dataLabels = new ArrayList<String>(); for (int i = 0; i < dataModels.size(); ++i) { MockPieChartDataModel model = dataModels.get(i); PieDataset dataset = model.dataSeries; List<String> labels = model.getLabels(); dataLabels.addAll(labels); for (int j = 0; j < labels.size(); ++j) { LegendLabelItem legendItem = new LegendLabelItem(); legendItem.setDatasetIndex(i); legendItem.setIndex(j); legendItem.setText(labels.get(j)); legendItem.setFillStyle(dataset.getBackgroundColor().get(j)); legendItems.add(legendItem); } } chartWidget.getData().setLabels(dataLabels.toArray(new String[0])); return legendItems.toArray(new LegendLabelItem[0]); } }); }

Target:
private void changeLegendLabelHandling() { chartWidget.getOptions().getLegend() .getLabels().setLabelsCallback(new LegendLabelsCallback() { @Override public LegendLabelItem[] generateLegendLabels(IsChart chart) { List<LegendLabelItem> legendItems = new ArrayList<LegendLabelItem>(); List<String> dataLabels = new ArrayList<String>(); for (int i = 0; i < dataModels.size(); ++i) { MockPieChartDataModel model = dataModels.get(i); PieDataset dataset = model.getDataSeries(); List<String> labels = model.getLabels(); dataLabels.addAll(labels); for (int j = 0; j < labels.size(); ++j) { LegendLabelItem legendItem = new LegendLabelItem(); legendItem.setDatasetIndex(i); legendItem.setIndex(j); legendItem.setText(labels.get(j)); legendItem.setFillStyle(dataset.getBackgroundColor().get(j)); legendItems.add(legendItem); } } chartWidget.getData().setLabels(dataLabels.toArray(new String[0])); return legendItems.toArray(new LegendLabelItem[0]); } }); }
Source:
public void setUp() throws Exception { final Indices indices = new Indices( new IndexMappingFactory(new Node(jestClient())), mock(NodeId.class), new NullAuditEventSender(), new EventBus("index-field-type-poller-it"), createIndicesAdapter() ); poller = new IndexFieldTypePoller(jestClient(), indices, new MetricRegistry()); indexSet = new TestIndexSet(indexSetConfig); importFixture("org/graylog2/indexer/fieldtypes/IndexFieldTypePollerIT.json"); }

Target:
public void setUp() throws Exception { @SuppressWarnings("UnstableApiUsage") final Indices indices = new Indices( new IndexMappingFactory(new Node(jestClient())), mock(NodeId.class), new NullAuditEventSender(), mock(EventBus.class), createIndicesAdapter() ); poller = new IndexFieldTypePoller(jestClient(), indices, new MetricRegistry()); indexSet = new TestIndexSet(indexSetConfig); importFixture("org/graylog2/indexer/fieldtypes/IndexFieldTypePollerIT.json"); }
Source:
protected void tearDown() throws Exception { super.tearDown(); for (File file : toDelete) delete(file); toDelete.clear(); }

Target:
protected void tearDown() throws Exception { super.tearDown(); for (File file : toDelete) { delete(file); } toDelete.clear(); }
Source:
protected boolean reconstructMaster() { newMasterStorageDomainId = getNewMaster().getId(); proceedStorageDomainTreatmentByDomainType(getNewMaster(), false); if (getParameters().isInactive() && !getStorageDomain().getId().equals(getNewMasterId())) { executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Inactive, getCompensationContext()); calcStoragePoolStatusByDomainsStatus(); getCompensationContext().stateChanged(); return null; } }); } if (_isLastMaster) { return stopSpm(); } boolean commandSucceeded = stopSpm(); final List<String> disconnectPoolFormats = Config.<List<String>> getValue( ConfigValues.DisconnectPoolOnReconstruct); if (commandSucceeded && disconnectPoolFormats.contains(getNewMaster().getStorageFormat().getValue())) { commandSucceeded = runVdsCommand( VDSCommandType.DisconnectStoragePool, new DisconnectStoragePoolVDSCommandParameters(getVds().getId(), getStoragePool().getId(), getVds().getVdsSpmId()) ).getSucceeded(); } if (!commandSucceeded) { return false; } List<StoragePoolIsoMap> domains = getStoragePoolIsoMapDAO() .getAllForStoragePool(getStoragePool().getId()); setActionReturnValue(true); return runVdsCommand(VDSCommandType.ReconstructMaster, new ReconstructMasterVDSCommandParameters(getVds().getId(), getVds().getVdsSpmId(), getStoragePool().getId(), getStoragePool().getName(), getNewMasterId(), domains, getStoragePool().getmaster_domain_version())).getSucceeded(); }

Target:
protected boolean reconstructMaster() { newMasterStorageDomainId = getNewMasterId(); proceedStorageDomainTreatmentByDomainType(getNewMaster(), false); if (getParameters().isInactive() && !getStorageDomain().getId().equals(getNewMasterId())) { executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Inactive, getCompensationContext()); calcStoragePoolStatusByDomainsStatus(); getCompensationContext().stateChanged(); return null; } }); } if (_isLastMaster) { return stopSpm(); } boolean commandSucceeded = stopSpm(); final List<String> disconnectPoolFormats = Config.<List<String>> getValue( ConfigValues.DisconnectPoolOnReconstruct); if (commandSucceeded && disconnectPoolFormats.contains(getNewMaster().getStorageFormat().getValue())) { commandSucceeded = runVdsCommand( VDSCommandType.DisconnectStoragePool, new DisconnectStoragePoolVDSCommandParameters(getVds().getId(), getStoragePool().getId(), getVds().getVdsSpmId()) ).getSucceeded(); } if (!commandSucceeded) { return false; } List<StoragePoolIsoMap> domains = getStoragePoolIsoMapDAO() .getAllForStoragePool(getStoragePool().getId()); setActionReturnValue(true); return runVdsCommand(VDSCommandType.ReconstructMaster, new ReconstructMasterVDSCommandParameters(getVds().getId(), getVds().getVdsSpmId(), getStoragePool().getId(), getStoragePool().getName(), getNewMasterId(), domains, getStoragePool().getMasterDomainVersion())).getSucceeded(); }
Source:
Optional<BufferAndAvailability> getNextBuffer() throws IOException, InterruptedException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); CheckpointBarrier notifyReceivedBarrier = parseCheckpointBarrierOrNull(buffer); if (notifyReceivedBarrier != null) { receivedCheckpointId = notifyReceivedBarrier.getId(); } else if (receivedCheckpointId < lastRequestedCheckpointId) { inputGate.getBufferReceivedListener().notifyBufferReceived(buffer.retainBuffer(), channelInfo); } numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); return Optional.of(new BufferAndAvailability(buffer, next.isDataAvailable(), next.buffersInBacklog())); }

Target:
Optional<BufferAndAvailability> getNextBuffer() throws IOException, InterruptedException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); CheckpointBarrier notifyReceivedBarrier = parseCheckpointBarrierOrNull(buffer); if (notifyReceivedBarrier != null) { receivedCheckpointId = notifyReceivedBarrier.getId(); } else if (receivedCheckpointId < lastRequestedCheckpointId && buffer.isBuffer()) { inputGate.getBufferReceivedListener().notifyBufferReceived(buffer.retainBuffer(), channelInfo); } numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); return Optional.of(new BufferAndAvailability(buffer, next.isDataAvailable(), next.buffersInBacklog())); }
Source:
public boolean runFlakyTest(boolean testIsFlaky, String description) { if (debug()) { System.out.println("DEBUG: run.flaky.tests.debug: "+debug()); System.out.println("DEBUG: run.flaky.tests: "+runFlakyTests()); System.out.println("DEBUG: testIsFlaky : "+testIsFlaky); System.out.println("DEBUG: description : "+description); } if ("FALSE".equalsIgnoreCase(runFlakyTests())) { if (debug()) { System.out.println("DEBUG: test will run: "+!testIsFlaky); } return !testIsFlaky; } else if ("NONE".equalsIgnoreCase(runFlakyTests())) { if (debug()) { System.out.println("DEBUG: test will NOT be run!"); } return false; } else { if (debug()) { System.out.println("DEBUG: test WILL be run!"); } return true; } }

Target:
public boolean runFlakyTest(boolean testIsFlaky, String description) { if (DEBUG) { System.out.println("DEBUG: run.flaky.tests.debug: "+debug()); System.out.println("DEBUG: run.flaky.tests: "+RUN_FLAKY_TESTS); System.out.println("DEBUG: testIsFlaky : "+testIsFlaky); System.out.println("DEBUG: description : "+description); } if ("FALSE".equalsIgnoreCase(RUN_FLAKY_TESTS)) { if (DEBUG) { System.out.println("DEBUG: test will run: "+!testIsFlaky); } return !testIsFlaky; } else if ("NONE".equalsIgnoreCase(RUN_FLAKY_TESTS)) { if (DEBUG) { System.out.println("DEBUG: test will NOT be run!"); } return false; } else { if (DEBUG) { System.out.println("DEBUG: test WILL be run!"); } return true; } }
Source:
public AdvancedNetworkConfig setEndpointConfigs(Map<EndpointQualifier, EndpointConfig> endpointConfigs) { this.endpointConfigs.clear(); this.endpointConfigs.putAll(endpointConfigs); return this; }

Target:
public AdvancedNetworkConfig setEndpointConfigs(Map<EndpointQualifier, EndpointConfig> endpointConfigs) { for (Map.Entry<EndpointQualifier, EndpointConfig> entry : endpointConfigs.entrySet()) { entry.getValue().setProtocolType(entry.getKey().getType()); } for (ProtocolType protocolType : ProtocolType.values()) { int count = countEndpointConfigs(endpointConfigs, protocolType); if (count > protocolType.getServerSocketCardinality()) { throw new InvalidConfigurationException("Protocol type " + protocolType + " does not allow more than " + protocolType.getServerSocketCardinality() + " server sockets but " + count + " were defined"); } } this.endpointConfigs.clear(); this.endpointConfigs.putAll(endpointConfigs); return this; }
Source:
private static Oid getOid() { Oid oid = null; try { oid = new Oid("1.3.6.1.5.5.2"); } catch (GSSException gsse) { log.error("Unable to create OID 1.3.6.1.5.5.2 !"+ gsse.toString()); } return oid; }

Target:
private static Oid getOid() { Oid oid = null; try { oid = new Oid(IWAConstants.OID); } catch (GSSException gsse) { log.error("Unable to create OID " + IWAConstants.OID + " !" + gsse.toString()); } return oid; }
Source:
private boolean tryLockVmForUpdate(Pair<VM, VmInternalData> pair) { Guid vmId = getVmId(pair); if (vmId != null) { VmManager vmManager = getResourceManager().getVmManager(vmId); if (vmManager.isLatestData(pair.getSecond(), vdsManager.getVdsId()) && vmManager.trylock()) { if (fetchTime - vmManager.getVmDataChangedTime() <= 0) { log.warn("skipping VM '{}' from this monitoring cycle" + " - the VM data has changed since fetching the data", vmId); vmManager.unlock(); } else { vmManagers.put(vmId, vmManager); return true; } } else { log.debug("skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager ", getVmId(pair)); } } return false; }

Target:
private boolean tryLockVmForUpdate(Pair<VM, VmInternalData> pair) { Guid vmId = getVmId(pair); if (vmId != null) { VmManager vmManager = getResourceManager().getVmManager(vmId); if (vmManager.trylock()) { if (!vmManager.isLatestData(pair.getSecond(), vdsManager.getVdsId())) { log.warn("skipping VM '{}' from this monitoring cycle" + " - newer VM data was already processed", vmId); vmManager.unlock(); } else if (fetchTime - vmManager.getVmDataChangedTime() <= 0) { log.warn("skipping VM '{}' from this monitoring cycle" + " - the VM data has changed since fetching the data", vmId); vmManager.unlock(); } else { vmManagers.put(vmId, vmManager); return true; } } else { log.debug("skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager ", getVmId(pair)); } } return false; }
Source:
private Object[] consumedArguments(Object[] arguments, Method templateMethod) { return arguments; }

Target:
private Object[] consumedArguments(Object[] arguments, Method templateMethod) { boolean hasAggregate = Arrays.stream(templateMethod.getParameters()) .anyMatch(ParameterizedTestParameterResolver::isAggregate); int parametersCount = templateMethod.getParameterCount(); return hasAggregate ? arguments : (arguments.length > parametersCount ? Arrays.copyOf(arguments, parametersCount) : arguments); }
Source:
private void mapBuildsToDeploymentConfigs(Collection<IBuild> builds) { for (IBuild build : builds) { mapBuildToDeploymentConfig(build); } }

Target:
private void mapBuildsToDeploymentConfigs(Collection<IBuild> builds) { builds.forEach(build->mapBuildToDeploymentConfig(build)); }