auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public byte[] encode(LifecycleMessage message) { byte[] encodedMsg = Util.marshall(message); ByteBuffer buffer = ByteBuffer.allocate(1 + encodedMsg.length); buffer.put(EhcacheEntityMessage.Type.LIFECYCLE_OP.getOpCode()); buffer.put(encodedMsg); return buffer.array(); }

Target:
public byte[] encode(LifecycleMessage message) { byte[] encodedMsg = Util.marshall(message); ByteBuffer buffer = ByteBuffer.allocate(OPCODE_SIZE + encodedMsg.length); buffer.put(message.getOpCode()); buffer.put(encodedMsg); return buffer.array(); }
Source:
private void nextPos() { for (currentPos = pos.down(); currentPos.getY() >= CubicChunksChecker.worldMin; currentPos = currentPos.down()) { if (canBreak()) { updateLength(); return; } else if (!world.isAirBlock(currentPos) && world.getBlockState(currentPos).getBlock() != BCFactoryBlocks.tube) { break; } } currentPos = null; updateLength(); }

Target:
private void nextPos() { for (currentPos = pos.down(); !world.isOutsideBuildHeight(currentPos); currentPos = currentPos.down()) { if (canBreak()) { updateLength(); return; } else if (!world.isAirBlock(currentPos) && world.getBlockState(currentPos).getBlock() != BCFactoryBlocks.tube) { break; } } currentPos = null; updateLength(); }
Source:
public void onResume() { super.onResume(); Log_OC.e(TAG, "onResume"); loadAndShowTextPreview(); }

Target:
public void onResume() { super.onResume(); Log_OC.e(TAG, "onResume"); }
Source:
public void releaseAllServices() { List<String> unreleasedServicesToReport = failOnUnreleasedService ? new ArrayList<String>() : null; for ( ServiceWrapper<?> wrapper : cachedServices.values() ) { boolean stoppedProperly = wrapper.ensureStopped(); if ( !stoppedProperly ) { log.serviceProviderNotReleased( wrapper.serviceClass ); if ( unreleasedServicesToReport != null ) { unreleasedServicesToReport.add( wrapper.serviceClass.getName() ); } } } allServicesReleased = true; if ( failOnUnreleasedService && !unreleasedServicesToReport.isEmpty() ) { throw new AssertionFailure( "The following services have been used but not released: " + unreleasedServicesToReport ); } }

Target:
public synchronized void releaseAllServices() { for ( ServiceWrapper<?> wrapper : cachedServices.values() ) { wrapper.stopVirtual(); } List<String> unreleasedServicesToReport = failOnUnreleasedService ? new ArrayList<String>() : null; for ( ServiceWrapper<?> wrapper : cachedServices.values() ) { if ( wrapper.status != ServiceStatus.STOPPED ) { log.serviceProviderNotReleased( wrapper.serviceClass ); wrapper.stopReal(); if ( unreleasedServicesToReport != null ) { unreleasedServicesToReport.add( wrapper.serviceClass.getName() ); } } } cachedServices.clear(); allServicesReleased = true; if ( failOnUnreleasedService && !unreleasedServicesToReport.isEmpty() ) { throw new AssertionFailure( "The following services have been used but not released: " + unreleasedServicesToReport ); } }
Source:
public void validate(Object target, Errors errors) { log.debug("{}.validate...", this.getClass().getName()); if (target == null) { return; } Person person = (Person) target; if (person.getVoided()) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "voidReason", "error.null"); } else if (!validatePersonHasAtLeastOneNonVoidedName(person)) { errors.rejectValue("names", "Person.shouldHaveAtleastOneNonVoidedName"); } validatePersonNames(person, errors); validatePersonAddresses(person, errors); validateBirthDate(errors, person.getBirthdate()); validateDeathDate(errors, person.getDeathDate(), person.getBirthdate()); validateDeathCause(person, errors); ValidateUtil.validateFieldLengths(errors, Person.class, "gender", "personVoidReason"); }

Target:
public void validate(Object target, Errors errors) { log.debug("{}.validate...", this.getClass().getName()); if (target == null) { return; } Person person = (Person) target; validatePersonNames(person, errors); if (!person.getVoided() && !validatePersonHasAtLeastOneNonVoidedName(person)) { errors.rejectValue("names", "Person.shouldHaveAtleastOneNonVoidedName"); } validatePersonAddresses(person, errors); validateBirthDate(errors, person.getBirthdate()); validateDeathDate(errors, person.getDeathDate(), person.getBirthdate()); if (person.getVoided()) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "voidReason", "error.null"); } validateDeathCause(person, errors); ValidateUtil.validateFieldLengths(errors, Person.class, "gender", "personVoidReason"); }
Source:
public Vector3 toCameraFrame(int pixelX, int pixelY) { double centeredX = pixelX - viewport.getWidth() / 2.0d; double centeredY = viewport.getHeight() / 2.0d - pixelY; return getCameraToScreenTransform().invert().apply(new Vector3(centeredX, centeredY, 0)); }

Target:
public Vector3 toCameraFrame(int pixelX, int pixelY) { final double centeredX = pixelX - viewport.getWidth() / 2.0d; final double centeredY = viewport.getHeight() / 2.0d - pixelY; return getCameraToScreenTransform().invert().apply(new Vector3(centeredX, centeredY, 0)); }
Source:
static <T> Task<T> whenServiceUp(final Entity target, final TaskAdaptable<T> task, String name) { return Tasks.<T>builder().name(name).dynamic(true).body(new Callable<T>() { @Override public T call() { try { while (true) { if (!Entities.isManaged(target)) { Tasks.markInessential(); throw new IllegalStateException("Target "+target+" is no longer managed"); } if (target.getAttribute(Attributes.SERVICE_UP)) { Tasks.resetBlockingDetails(); TaskTags.markInessential(task); DynamicTasks.queue(task); try { return task.asTask().getUnchecked(); } catch (Exception e) { if (Entities.isManaged(target)) { throw Exceptions.propagate(e); } else { Tasks.markInessential(); throw new IllegalStateException("Target "+target+" is no longer managed", e); } } } else { Tasks.setBlockingDetails("Waiting on "+target+" to be ready"); } Time.sleep(Duration.ONE_SECOND); } } finally { Tasks.resetBlockingDetails(); } } }).build(); }

Target:
static <T> Task<T> whenServiceUp(final Entity target, final TaskAdaptable<T> task, String name) { return Tasks.<T>builder().name(name).dynamic(true).body(new Callable<T>() { @Override public T call() { try { while (true) { if (!Entities.isManaged(target)) { Tasks.markInessential(); throw new IllegalStateException("Target "+target+" is no longer managed"); } if (Boolean.TRUE.equals(target.getAttribute(Attributes.SERVICE_UP))) { Tasks.resetBlockingDetails(); TaskTags.markInessential(task); DynamicTasks.queue(task); try { return task.asTask().getUnchecked(); } catch (Exception e) { if (Entities.isManaged(target)) { throw Exceptions.propagate(e); } else { Tasks.markInessential(); throw new IllegalStateException("Target "+target+" is no longer managed", e); } } } else { Tasks.setBlockingDetails("Waiting on "+target+" to be ready"); } Time.sleep(Duration.ONE_SECOND); } } finally { Tasks.resetBlockingDetails(); } } }).build(); }
Source:
private void setEncodeApiResponse(final boolean encodeApiResponse) { ApiServer.encodeApiResponse = encodeApiResponse; }

Target:
private static void setEncodeApiResponse(final boolean encodeApiResponse) { ApiServer.encodeApiResponse = encodeApiResponse; }
Source:
public StramClient(Configuration conf, LogicalPlan dag) throws Exception { this.conf = conf; this.dag = dag; dag.visitDAG(); dag.validate(); yarnClient.init(conf); }

Target:
public StramClient(Configuration conf, LogicalPlan dag) throws Exception { this.conf = conf; this.dag = dag; dag.validate(); yarnClient.init(conf); }
Source:
public void saveSettings() { super.saveSettings(); if (mSite.isJetpackConnected()) { saveJetpackSettings(); updateJetpackProtectSettings(); } try { final JSONObject jsonParams = serializeDotComParamsToJSONObject(); WordPress.getRestClientUtils().setGeneralSiteSettings( mSite.getSiteId(), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Site Settings saved remotely"); notifySavedOnUiThread(null); mRemoteSettings.copyFrom(mSettings); if (response != null) { JSONObject updated = response.optJSONObject("updated"); if (updated == null) return; HashMap<String, Object> properties = new HashMap<>(); Iterator<String> keys = updated.keys(); while (keys.hasNext()) { String currentKey = keys.next(); Object currentValue = updated.opt(currentKey); if (currentValue != null) { properties.put(SAVED_ITEM_PREFIX + currentKey, currentValue); } } AnalyticsUtils.trackWithSiteDetails( AnalyticsTracker.Stat.SITE_SETTINGS_SAVED_REMOTELY, mSite, properties); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error POSTing site settings changes: " + error); notifySavedOnUiThread(error); } }, jsonParams); } catch (JSONException exception) { AppLog.w(AppLog.T.API, "Error serializing settings changes: " + exception); notifySavedOnUiThread(exception); } }

Target:
public void saveSettings() { super.saveSettings(); if (mSite.isJetpackConnected()) { saveJetpackSettings(); updateJetpackProtectSettings(); } try { final JSONObject jsonParams = serializeDotComParamsToJSONObject(); if (jsonParams.length() <= 0) { return; } WordPress.getRestClientUtils().setGeneralSiteSettings( mSite.getSiteId(), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Site Settings saved remotely"); notifySavedOnUiThread(null); mRemoteSettings.copyFrom(mSettings); if (response != null) { JSONObject updated = response.optJSONObject("updated"); if (updated == null) return; HashMap<String, Object> properties = new HashMap<>(); Iterator<String> keys = updated.keys(); while (keys.hasNext()) { String currentKey = keys.next(); Object currentValue = updated.opt(currentKey); if (currentValue != null) { properties.put(SAVED_ITEM_PREFIX + currentKey, currentValue); } } AnalyticsUtils.trackWithSiteDetails( AnalyticsTracker.Stat.SITE_SETTINGS_SAVED_REMOTELY, mSite, properties); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error POSTing site settings changes: " + error); notifySavedOnUiThread(error); } }, jsonParams); } catch (JSONException exception) { AppLog.w(AppLog.T.API, "Error serializing settings changes: " + exception); notifySavedOnUiThread(exception); } }
Source:
public static void _destroyKernel() { if (kernel != null) { try { kernel.destroy(); } catch (Exception e) { } kernel.destroy(); } kernel = null; }

Target:
public static void _destroyKernel() { if (kernel != null) { kernel.destroy(); } kernel = null; }
Source:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { SCM scm = build.getProject().getScm(); if (!(scm instanceof TeamFoundationServerScm)) { listener.getLogger().println("No label for non TFS project"); return false; } FilePath workspace = build.getWorkspace(); TeamFoundationServerScm tfsScm = (TeamFoundationServerScm) scm; boolean buildSucess = Result.SUCCESS.equals(build.getResult()); String whenCreateLabel = getTime(); if ("always".equals(whenCreateLabel) || ("success".equals(whenCreateLabel) && buildSucess)) { final Launcher localLauncher = launcher != null ? launcher : new Launcher.LocalLauncher(listener); final TfTool tool = new TfTool(tfsScm.getDescriptor().getTfExecutable(), localLauncher, listener, workspace); Server server = new Server(tool, tfsScm.getServerUrl(build), tfsScm.getUserName(), tfsScm.getUserPassword()); Computer computer = Computer.currentComputer(); String normalizedLabelName = computeDynamicValue(build, getLabelName()); String tfsWorkspace = tfsScm.getWorkspaceName(build, computer); try { logger.info(String.format("Create label '%s' on workspace '%s'", normalizedLabelName, tfsWorkspace)); LabelCommand labelCommand = new LabelCommand(server, normalizedLabelName, tfsWorkspace, tfsScm.getLocalPath()); server.execute(labelCommand.getArguments()); } catch (Exception e) { return false; } finally { server.close(); } } return true; }

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { SCM scm = build.getProject().getScm(); if (!(scm instanceof TeamFoundationServerScm)) { listener.getLogger().println("Labels are only supported for projects using TFS SCM"); return false; } FilePath workspace = build.getWorkspace(); TeamFoundationServerScm tfsScm = (TeamFoundationServerScm) scm; boolean buildSucess = Result.SUCCESS.equals(build.getResult()); String whenCreateLabel = getWhenToLabel(); if ("always".equals(whenCreateLabel) || ("success".equals(whenCreateLabel) && buildSucess)) { final Launcher localLauncher = launcher != null ? launcher : new Launcher.LocalLauncher(listener); final TfTool tool = new TfTool(tfsScm.getDescriptor().getTfExecutable(), localLauncher, listener, workspace); Server server = new Server(tool, tfsScm.getServerUrl(build), tfsScm.getUserName(), tfsScm.getUserPassword()); Computer computer = Computer.currentComputer(); String normalizedLabelName = computeDynamicValue(build, getLabelName()); String tfsWorkspace = tfsScm.getWorkspaceName(build, computer); try { logger.info(String.format("Create label '%s' on workspace '%s'", normalizedLabelName, tfsWorkspace)); LabelCommand labelCommand = new LabelCommand(server, normalizedLabelName, tfsWorkspace, tfsScm.getLocalPath()); server.execute(labelCommand.getArguments()); } catch (Exception e) { return false; } finally { server.close(); } } return true; }
Source:
Optional<BbUserUnassigned> on(BbUserDeleted event) { List<UserId> assignees = getState().getAssigneeList(); UserId user = event.getId(); if (!assignees.contains(user)) { return empty(); } return Optional.of(userUnassigned(user)); }

Target:
Optional<BbAssigneeRemoved> on(BbUserDeleted event) { List<UserId> assignees = getState().getAssigneeList(); UserId user = event.getId(); if (!assignees.contains(user)) { return empty(); } return Optional.of(userUnassigned(user)); }
Source:
void closeSocket() { try { if (sock != null && !sock.isClosed()) { sock.close(); } } catch (IOException e) { LOG.warn("Ignoring error closing connection to leader", e); } }

Target:
void closeSocket() { try { if (sock != null) { sock.close(); } } catch (IOException e) { LOG.warn("Ignoring error closing connection to leader", e); } }
Source:
public static Pair<String, Map<String, Object>> vertexStatement(ActivityObject activityObject) { Pair<String, Map<String, Object>> mergeVertexRequest = helper.mergeVertexRequest(activityObject); HashMap<String, Object> props = new HashMap<>(); props.put("props", mergeVertexRequest.getValue1()); mergeVertexRequest = mergeVertexRequest.setAt1(props); return mergeVertexRequest; }

Target:
public static Pair<String, Map<String, Object>> vertexStatement(ActivityObject activityObject) { Pair<String, Map<String, Object>> mergeVertexRequest = helper.mergeVertexRequest(activityObject); Map<String, Object> props = new HashMap<>(); props.put("props", mergeVertexRequest.getValue1()); mergeVertexRequest = mergeVertexRequest.setAt1(props); return mergeVertexRequest; }
Source:
public String getTurnDescription( Translation tr ) { if (rawName || !name.isEmpty()) return getName(); return tr.tr("finish"); }

Target:
public String getTurnDescription( Translation tr ) { if (rawName) return getName(); return tr.tr("finish"); }
Source:
private void doSetUserName() { if (!canEditUserName()) { return; } String newName = userNameTxt.getText(); if ("".equals(newName)) { newName = null; } if (newName != null && !newName.matches(Account.USER_NAME_PATTERN)) { invalidUserName(); return; } if (!Window.confirm("Setting the username is permanent. Are you sure?")) { return; } enableUI(false); final String newUserName = newName; Util.ACCOUNT_SEC.changeUserName(newUserName, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { Gerrit.getUserAccount().setUserName(newUserName); userNameLbl.setText(newUserName); userNameLbl.setVisible(true); userNameTxt.setVisible(false); setUserName.setVisible(false); } @Override public void onFailure(final Throwable caught) { enableUI(true); if (InvalidUserNameException.MESSAGE.equals(caught.getMessage())) { invalidUserName(); } else { super.onFailure(caught); } } }); }

Target:
private void doSetUserName() { if (!canEditUserName()) { return; } String newName = userNameTxt.getText(); if ("".equals(newName)) { newName = null; } if (newName != null && !newName.matches(Account.USER_NAME_PATTERN)) { invalidUserName(); return; } enableUI(false); final String newUserName = newName; Util.ACCOUNT_SEC.changeUserName(newUserName, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { Gerrit.getUserAccount().setUserName(newUserName); userNameLbl.setText(newUserName); userNameLbl.setVisible(true); userNameTxt.setVisible(false); setUserName.setVisible(false); } @Override public void onFailure(final Throwable caught) { enableUI(true); if (InvalidUserNameException.MESSAGE.equals(caught.getMessage())) { invalidUserName(); } else { super.onFailure(caught); } } }); }
Source:
private TableView createTemporarySessionView(String tempViewName, String querySQL, List<Column> columnTemplateList, boolean allowRecursiveQueryDetection, boolean addViewToSession) { Schema schema = getSchemaWithDefault(); int id = database.allocateObjectId(); TableView view = new TableView(schema, id, tempViewName, querySQL, parameters, columnTemplateList.toArray(new Column[0]), session, allowRecursiveQueryDetection , false); if (!view.isRecursiveQueryDetected() && allowRecursiveQueryDetection) { view = new TableView(schema, id, tempViewName, querySQL, parameters, columnTemplateList.toArray(new Column[0]), session, false , false); } view.setTableExpression(true); view.setTemporary(true); if(addViewToSession){ session.addLocalTempTable(view); } view.setOnCommitDrop(true); return view; }

Target:
private TableView createTemporarySessionView(String tempViewName, String querySQL, List<Column> columnTemplateList, boolean allowRecursiveQueryDetection, boolean addViewToSession) { Schema schema = getSchemaWithDefault(); int id = database.allocateObjectId(); TableView view = new TableView(schema, id, tempViewName, querySQL, parameters, columnTemplateList.toArray(new Column[0]), session, allowRecursiveQueryDetection, false); if (!view.isRecursiveQueryDetected() && allowRecursiveQueryDetection) { view = new TableView(schema, id, tempViewName, querySQL, parameters, columnTemplateList.toArray(new Column[0]), session, false , false); } view.setTableExpression(true); view.setTemporary(true); view.setHidden(true); if(addViewToSession){ session.addLocalTempTable(view); } view.setOnCommitDrop(false); return view; }
Source:
public TimestampTracker(Environment env, TransactorID tid, long updatePeriodMs) { Preconditions.checkNotNull(env, "environment cannot null"); Preconditions.checkNotNull(tid, "tid cannot null"); Preconditions.checkArgument(updatePeriodMs > 0, "update period must be positive"); this.env = env; this.tid = tid; status = TrackerStatus.IDLE; TimerTask tt = new TimerTask() { @Override public void run() { synchronized(status) { if (status == TrackerStatus.CLOSED) { return; } else if (status == TrackerStatus.BUSY) { updateZkNode(getOldestActiveTimestamp()); } else if (status == TrackerStatus.IDLE) { closeZkNode(); } else { throw new IllegalStateException("Unknown status"); } } } }; timer = new Timer("TimestampTracker timer", true); timer.schedule(tt, updatePeriodMs, updatePeriodMs); }

Target:
public TimestampTracker(Environment env, TransactorID tid, long updatePeriodMs) { Preconditions.checkNotNull(env, "environment cannot null"); Preconditions.checkNotNull(tid, "tid cannot null"); Preconditions.checkArgument(updatePeriodMs > 0, "update period must be positive"); this.env = env; this.tid = tid; status = TrackerStatus.IDLE; TimerTask tt = new TimerTask() { @Override public void run() { try { boolean update = false; long ts = 0; synchronized(TimestampTracker.this) { if (status == TrackerStatus.CLOSED) { return; } else if (status == TrackerStatus.BUSY) { update = true; ts = getOldestActiveTimestamp(); } else if (status == TrackerStatus.IDLE) { closeZkNode(); } else { log.error("Unknown status encountered in Zookeeper update thread"); return; } } if (update) { updateZkNode(ts); } } catch (Exception e) { log.error("Exception occurred in Zookeeper update thread", e); } } }; timer = new Timer("TimestampTracker timer", true); timer.schedule(tt, updatePeriodMs, updatePeriodMs); }
Source:
public static final TestEnvironment getTestEnvironment() { if (!OpenNMSSeleniumTestCase.isDockerEnabled()) { return new NullTestEnvironment(); } try { final TestEnvironmentBuilder builder = TestEnvironment.builder().all(); builder.withOpenNMSEnvironment() .addFile(TelemetryIT.class.getResource("/telemetryd-configuration.xml"), "etc/telemetryd-configuration.xml") .addFile(TelemetryIT.class.getResource("/telemetryd-adapters/junos-telemetry-interface.groovy"), "etc/telemetryd-adapters/junos-telemetry-interface.groovy"); OpenNMSSeleniumTestCase.configureTestEnvironment(builder); m_testEnvironment = builder.build(); return m_testEnvironment; } catch (final Throwable t) { throw new RuntimeException(t); } }

Target:
public static final TestEnvironment getTestEnvironment() { if (!OpenNMSSeleniumTestCase.isDockerEnabled()) { return new NullTestEnvironment(); } try { final TestEnvironmentBuilder builder = TestEnvironment.builder().all(); builder.withOpenNMSEnvironment() .addFile(TelemetryIT.class.getResource("/telemetryd-configuration.xml"), "etc/telemetryd-configuration.xml"); OpenNMSSeleniumTestCase.configureTestEnvironment(builder); m_testEnvironment = builder.build(); return m_testEnvironment; } catch (final Throwable t) { throw new RuntimeException(t); } }
Source:
public IStatus validate(Object in) { String value = (String) in; if(allowEmpty && StringUtils.isBlank(value)) { return ValidationStatus.ok(); } if (!UrlUtils.isValid(value)) { return ValidationStatus.error(invalidURLMessage); } return ValidationStatus.ok(); }

Target:
public IStatus validate(Object in) { String value = (String) in; if(allowEmpty && StringUtils.isBlank(value)) { return ValidationStatus.ok(); } if (!validator.isValid(value)) { return ValidationStatus.error(invalidURLMessage); } return ValidationStatus.ok(); }
Source:
private static DataInfoBasedApprover buildApprover(String skipDeletedByInference, String trustLevelThreshold, String inferenceProvenanceBlacklist) { Float trustLevelThresholdFloat = null; if (StringUtils.isNotBlank(trustLevelThreshold) && !UNDEFINED_NONEMPTY_VALUE.equals(trustLevelThreshold)) { trustLevelThresholdFloat = Float.valueOf(trustLevelThreshold); } return new DataInfoBasedApprover(inferenceProvenanceBlacklist, Boolean.valueOf(skipDeletedByInference), trustLevelThresholdFloat); }

Target:
private static DataInfoBasedApprover buildApprover(String skipDeletedByInference, String trustLevelThreshold, String inferenceProvenanceBlacklist) { Float trustLevelThresholdFloat = Optional.ofNullable(trustLevelThreshold) .filter(x -> StringUtils.isNotBlank(x) && !UNDEFINED_NONEMPTY_VALUE.equals(x)).map(Float::parseFloat) .orElse(null); return new DataInfoBasedApprover(inferenceProvenanceBlacklist, Boolean.parseBoolean(skipDeletedByInference), trustLevelThresholdFloat); }
Source:
private void assignOrphans() { Iterator<Replica> it = _orphaned.iterator(); while (it.hasNext()) { Replica replica = it.next(); boolean added = false; Node preferred = _preferredAssignment.get(replica); if (preferred.capacity > preferred.currentlyAssigned && preferred.canAdd(replica)) { preferred.currentlyAssigned ++; preferred.preferred.add(replica); preferred.newReplicas.add(replica); added = true; } else { int startIndex = computeRandomStartIndex(replica); for (int index = startIndex; index < startIndex + _liveNodesList.size(); index++) { Node receiver = _liveNodesList.get(index % _liveNodesList.size()); if (receiver.capacity > receiver.currentlyAssigned && receiver.canAdd(replica)) { receiver.currentlyAssigned = receiver.currentlyAssigned + 1; receiver.nonPreferred.add(replica); receiver.newReplicas.add(replica); added = true; break; } } } if (!added) { added = assignOrphanByMakingRoom(replica); } if (added) { it.remove(); } } if (_orphaned.size() > 0 && logger.isInfoEnabled()) { logger.info("could not assign nodes to partitions: " + _orphaned); } }

Target:
private void assignOrphans() { Iterator<Replica> it = _orphaned.iterator(); while (it.hasNext()) { Replica replica = it.next(); Node preferred = _preferredAssignment.get(replica); boolean added = tryAddReplica(preferred, replica, true); if (!added) { int startIndex = computeRandomStartIndex(replica); for (int index = startIndex; index < startIndex + _liveNodesList.size(); index++) { Node receiver = _liveNodesList.get(index % _liveNodesList.size()); added = tryAddReplica(receiver, replica, false); if (added) { break; } } } if (!added) { added = assignOrphanByMakingRoom(replica); } if (added) { it.remove(); } } if (_orphaned.size() > 0 && logger.isInfoEnabled()) { logger.info("could not assign nodes to partitions: " + _orphaned); } }
Source:
protected void processMetadata(Class<?> targetType, Method method, MethodMetadata metadata) { String httpMethod = metadata.template().method(); if (httpMethod == null) { throw new SafeNullPointerException( "An HTTP method is required", SafeArg.of("class", targetType.getSimpleName()), SafeArg.of("method", method.getName())); } try { HttpMethod.valueOf(httpMethod.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { throw new SafeIllegalArgumentException( "Unsupported HTTP method", SafeArg.of("class", targetType.getSimpleName()), SafeArg.of("method", method.getName()), SafeArg.of("method", httpMethod)); } metadata.template().header(ENDPOINT_NAME_HEADER, method.getName()); }

Target:
protected void processMetadata(Class<?> targetType, Method method, MethodMetadata metadata) { String httpMethod = metadata.template().method(); if (httpMethod == null) { throw new SafeNullPointerException( "An HTTP method is required", SafeArg.of("class", targetType.getSimpleName()), SafeArg.of("method", method.getName())); } try { HttpMethod.valueOf(httpMethod.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { throw new SafeIllegalArgumentException( "Unsupported HTTP method", SafeArg.of("class", targetType.getSimpleName()), SafeArg.of("method", method.getName()), SafeArg.of("httpMethod", httpMethod)); } metadata.template().header(ENDPOINT_NAME_HEADER, method.getName()); }
Source:
public static Address extractAddress(@Nullable final Form<?> form, final String suffix) { if (form != null) { final CountryCode country = countryOrUndefined(form.field("country" + suffix).value()); return AddressBuilder.of(country) .title(form.field("title" + suffix).value()) .firstName(form.field("firstName" + suffix).value()) .lastName(form.field("lastName" + suffix).value()) .streetName(form.field("streetName" + suffix).value()) .additionalStreetInfo(form.field("additionalStreetInfo" + suffix).value()) .city(form.field("city" + suffix).value()) .postalCode(form.field("postalCode" + suffix).value()) .region(form.field("region" + suffix).value()) .phone(form.field("phone" + suffix).value()) .email(form.field("email" + suffix).value()) .build(); } else { return Address.of(CountryCode.UNDEFINED); } }

Target:
public static Address extractAddress(@Nullable final Form<?> form, final String suffix) { if (form != null) { final Function<String, String> formExtractor = formFieldExtractor(form, suffix); final CountryCode country = countryOrUndefined(formExtractor.apply("country")); return AddressBuilder.of(country) .title(formExtractor.apply("title")) .firstName(formExtractor.apply("firstName")) .lastName(formExtractor.apply("lastName")) .streetName(formExtractor.apply("streetName")) .additionalStreetInfo(formExtractor.apply("additionalStreetInfo")) .city(formExtractor.apply("city")) .postalCode(formExtractor.apply("postalCode")) .region(formExtractor.apply("region")) .phone(formExtractor.apply("phone")) .email(formExtractor.apply("email")) .build(); } else { return Address.of(CountryCode.UNDEFINED); } }
Source:
public void beforeTextChanged(CharSequence s, int start, int count, int after) { int lastCharacterLocation = start + count - 1; if (s.length() > lastCharacterLocation && lastCharacterLocation >= 0) { if (after < count) { if (after > 0) { mLastOperation = Operation.REPLACE; } else { mLastOperation = Operation.DELETE; } mOffset = start; mModifiedText = s.subSequence(start + after, start + count); } } }

Target:
public void beforeTextChanged(CharSequence s, int start, int count, int after) { if (s == null) { return; } int lastCharacterLocation = start + count - 1; if (s.length() > lastCharacterLocation && lastCharacterLocation >= 0) { if (after < count) { if (after > 0) { mLastOperation = Operation.REPLACE; } else { mLastOperation = Operation.DELETE; } mOffset = start; mModifiedText = s.subSequence(start + after, start + count); } } }
Source:
public void onSelectedThread(long threadId) { selectedThreadId = threadId; selectedFrameIndex = 0; for (ThreadDump td : threadDump) { if (td.getId() == selectedThreadId) { view.setFrames(td.getFrames()); } } updateStackFrameDump(); }

Target:
public void onSelectedThread(long threadId) { updateStackFrameDump(threadId); onSelectedFrame(0); }
Source:
public List<Integer> getFavoriteProjectLocationIds(final String programUUID) { final List<ProgramFavorite> programFavorites = this.getProgramFavoriteDao().getProgramFavorites(ProgramFavorite.FavoriteType.LOCATION, Integer.MAX_VALUE, programUUID); final List<Integer> favoriteLocationIds = new ArrayList<>(); if (programFavorites != null && !programFavorites.isEmpty()) { for (final ProgramFavorite programFavorite : programFavorites) { favoriteLocationIds.add(programFavorite.getEntityId()); } } return favoriteLocationIds; }

Target:
public List<Integer> getFavoriteProjectLocationIds(final String programUUID) { final List<ProgramFavorite> programFavorites = this.daoFactory.getProgramFavoriteDao().getProgramFavorites(ProgramFavorite.FavoriteType.LOCATION, Integer.MAX_VALUE, programUUID); final List<Integer> favoriteLocationIds = new ArrayList<>(); if (programFavorites != null && !programFavorites.isEmpty()) { for (final ProgramFavorite programFavorite : programFavorites) { favoriteLocationIds.add(programFavorite.getEntityId()); } } return favoriteLocationIds; }
Source:
public DigitalTwinsClientBuilder httpLogOptions(HttpLogOptions logOptions) { this.logOptions = Objects.requireNonNull(logOptions, "'logOptions' cannot be null."); return this; }

Target:
public DigitalTwinsClientBuilder httpLogOptions(HttpLogOptions logOptions) { this.logOptions = logOptions; return this; }
Source:
public ClassDiagramPatternConfigurationPage() { super("PatternSelection"); setTitle("Pattern Creation"); setDescription("Configure the Class Diagram tools."); }

Target:
public ClassDiagramPatternConfigurationPage() { super("PatternSelection"); setTitle("Pattern Creation"); setDescription("Configure the creation of your Class Diagram skeleton."); }
Source:
public VisualizationType getVisualizationType() { String uriParts[] = getContent().getUrl().split(":"); String derivedType = uriParts[uriParts.length-1]; VisualizationType visualizationType = VisualizationType.TABLE; if (isLocal()) { visualizationType = VisualizationType.get(derivedType); } return visualizationType; }

Target:
public VisualizationType getVisualizationType() { VisualizationType visualizationType = VisualizationType.TABLE; String uriParts[] = getContent().getUrl().split(":"); if (uriParts.length > 0 && isLocal()) { String derivedType = uriParts[uriParts.length-1]; visualizationType = VisualizationType.of(derivedType); } return visualizationType; }
Source:
public Subscriber<? super T> call(final Subscriber<? super R> subscriber) { final AtomicReference<Subscriber<T>> result = new AtomicReference<Subscriber<T>>(); Observable<T> observable = Observable.create(new Observable.OnSubscribe<T>() { @Override public void call(final Subscriber<? super T> sub) { Observer<T> observer = new Observer<T>() { @Override public void onCompleted() { sub.onCompleted(); } @Override public void onError(Throwable e) { sub.onError(e); } @Override public void onNext(T t) { sub.onNext(t); } }; result.set(Subscribers.from(observer)); subscriber.add(result.get()); } }); function.call(observable).unsafeSubscribe(subscriber); return result.get(); }

Target:
public Subscriber<? super T> call(final Subscriber<? super R> subscriber) { final AtomicReference<Subscriber<T>> result = new AtomicReference<Subscriber<T>>(); final CountDownLatch latch = new CountDownLatch(1); Observable<T> observable = Observable.create(new Observable.OnSubscribe<T>() { @Override public void call(final Subscriber<? super T> sub) { Observer<T> observer = new Observer<T>() { @Override public void onCompleted() { sub.onCompleted(); } @Override public void onError(Throwable e) { sub.onError(e); } @Override public void onNext(T t) { sub.onNext(t); } }; result.set(Subscribers.from(observer)); latch.countDown(); } }); function.call(observable).unsafeSubscribe(subscriber); try { latch.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } subscriber.add(result.get()); return result.get(); }
Source:
protected AbstractMessageActionCommand(@Nonnull final String op, final boolean isUid, final int start, final int end, @Nonnull final String targetFolder) { this(op, isUid, start + ImapClientConstants.COLON + end, targetFolder); }

Target:
protected AbstractMessageActionCommand(@Nonnull final String op, final boolean isUid, final int start, final int end, @Nonnull final String targetFolder) { this(op, isUid, new StringBuilder(String.valueOf(start)).append(ImapClientConstants.COLON).append(end).toString(), targetFolder); }
Source:
boolean isOAuth2Flow() { String authorizationMode = this.getClientConfiguration().getAuthorizationMode(); return authorizationMode != null && authorizationMode.equals("PrivateKey"); }

Target:
boolean isOAuth2Flow() { return this.getClientConfiguration().getAuthorizationMode() == AuthorizationMode.PRIVATE_KEY; }
Source:
private void populateEntity(Cdn entity, CdnDTO dto) { if (entity == null) { throw new IllegalArgumentException("the Cdn model entity is null"); } if (dto == null) { throw new IllegalArgumentException("the Cdn dto is null"); } if (dto.getName() != null) { entity.setName(dto.getName()); } if (dto.getLabel() != null) { entity.setLabel(dto.getLabel()); } if (dto.getUrl() != null) { entity.setUrl(dto.getUrl()); } if (dto.getCertificate() != null) { CertificateDTO certDTO = dto.getCertificate(); CdnCertificate cdnCert; if (certDTO.getKey() != null && certDTO.getCert() != null) { cdnCert = new CdnCertificate(); cdnCert.setCert(certDTO.getCert()); cdnCert.setKey(certDTO.getKey()); if (certDTO.getSerial() != null) { CertificateSerialDTO certSerialDTO = certDTO.getSerial(); CertificateSerial certSerial = new CertificateSerial(); certSerial.setExpiration(certSerialDTO.getExpiration()); if (certSerialDTO.getSerial() != null) { certSerial.setSerial(certSerialDTO.getSerial().longValue()); } if (certSerialDTO.isCollected() != null) { certSerial.setCollected(certSerialDTO.isCollected()); } if (certSerialDTO.isRevoked() != null) { certSerial.setRevoked(certSerialDTO.isRevoked()); } cdnCert.setSerial(certSerial); } entity.setCertificate(cdnCert); } else { throw new BadRequestException(i18n.tr("cdn certificate has null key or cert.")); } } }

Target:
private void populateEntity(Cdn entity, CdnDTO dto) { if (entity == null) { throw new IllegalArgumentException("the Cdn model entity is null"); } if (dto == null) { throw new IllegalArgumentException("the Cdn dto is null"); } if (dto.getName() != null) { entity.setName(dto.getName()); } if (dto.getUrl() != null) { entity.setUrl(dto.getUrl()); } if (dto.getCertificate() != null) { CertificateDTO certDTO = dto.getCertificate(); CdnCertificate cdnCert; if (certDTO.getKey() != null && certDTO.getCert() != null) { cdnCert = new CdnCertificate(); cdnCert.setCert(certDTO.getCert()); cdnCert.setKey(certDTO.getKey()); if (certDTO.getSerial() != null) { CertificateSerialDTO certSerialDTO = certDTO.getSerial(); CertificateSerial certSerial = new CertificateSerial(); certSerial.setExpiration(certSerialDTO.getExpiration()); if (certSerialDTO.getSerial() != null) { certSerial.setSerial(certSerialDTO.getSerial().longValue()); } if (certSerialDTO.isCollected() != null) { certSerial.setCollected(certSerialDTO.isCollected()); } if (certSerialDTO.isRevoked() != null) { certSerial.setRevoked(certSerialDTO.isRevoked()); } cdnCert.setSerial(certSerial); } entity.setCertificate(cdnCert); } else { throw new BadRequestException(i18n.tr("cdn certificate has null key or cert.")); } } }
Source:
public void testJsonDataStructure() throws Exception { String csvFile = "data"+File.separator+"OrderLines.csv"; JobRunner jobRunner = new JobRunner(); String[] roles = { "admin" }; jobRunner.setRoles(roles); JSONDocumentManager jsonMgr = client.newJSONDocumentManager(); try (InputStream csvStream = openStream(csvFile); InputStream jobStream = openStream(JobRunner.jobFileFor(csvFile));) { jobRunner.run(client, csvStream, jobStream); ObjectMapper objectMapper = new ObjectMapper(); ObjectNode jobControlObj = (ObjectNode) objectMapper.readTree(jobStream); ObjectNode jobDef = (ObjectNode) jobControlObj.get("job"); StructuredQueryBuilder queryBldr = new StructuredQueryBuilder(); jsonMgr.setPageLength(1); DocumentPage docPage = jsonMgr.search( queryBldr.andNot(queryBldr.collection(JobRunner.getJobCollection(jobDef.path("id").asText())), queryBldr.document(JobRunner.getBeforeJobDocumentUri(jobDef.path("id").asText()), JobRunner.getAfterJobDocumentUri(jobDef.path("id").asText()))), 1); long docCount = docPage.getTotalSize(); FileReader fr = new FileReader(csvFile); LineNumberReader lnr = new LineNumberReader(fr); int linenumber = 0; while (lnr.readLine() != null) { linenumber++; } lnr.close(); assertEquals(docCount, (linenumber - 1)); JacksonHandle firstDocHandle = docPage.nextContent(new JacksonHandle()); JsonNode firstObject = firstDocHandle.get(); assertNotNull(firstObject.get("metadata")); assertNotNull(firstObject.get("instance")); } catch(Exception ex) { ex.printStackTrace(); } }

Target:
public void testJsonDataStructure() throws Exception { String csvFile = "data"+File.separator+"OrderLines.csv"; JobRunner jobRunner = new JobRunner(); String[] roles = { "admin" }; jobRunner.setRoles(roles); JSONDocumentManager jsonMgr = client.newJSONDocumentManager(); try (InputStream csvStream = openStream(csvFile); InputStream jobStream = openStream(JobRunner.jobFileFor(csvFile));) { jobRunner.run(client, csvStream, jobStream); ObjectMapper objectMapper = new ObjectMapper(); ObjectNode jobControlObj = (ObjectNode) objectMapper.readTree(jobStream); ObjectNode jobDef = (ObjectNode) jobControlObj.get("job"); StructuredQueryBuilder queryBldr = new StructuredQueryBuilder(); jsonMgr.setPageLength(1); DocumentPage docPage = jsonMgr.search( queryBldr.andNot(queryBldr.collection(JobRunner.getJobCollection(jobDef.path("id").asText())), queryBldr.document(JobRunner.getBeforeJobDocumentUri(jobDef.path("id").asText()), JobRunner.getAfterJobDocumentUri(jobDef.path("id").asText()))), 1); long docCount = docPage.getTotalSize(); FileReader fr = new FileReader(csvFile); LineNumberReader lnr = new LineNumberReader(fr); int linenumber = 0; while (lnr.readLine() != null) { linenumber++; } lnr.close(); assertEquals(docCount, (linenumber - 1)); JacksonHandle firstDocHandle = docPage.nextContent(new JacksonHandle()); JsonNode firstObject = firstDocHandle.get(); JsonNode metadataNode = firstObject.get("metadata"); assertNotNull(metadataNode); assertNotNull(metadataNode.get(0)); JsonNode instanceNode = firstObject.get("instance"); assertNotNull(instanceNode); assertNotNull(instanceNode.get(0)); } catch(Exception ex) { ex.printStackTrace(); } }
Source:
static String[] parseForFormalTypeParameters(String s) { ArrayList<String> sigs = new ArrayList<>(10); int beginToken = 1; while (s.charAt(beginToken) != '>') { int endToken = FormalTypeParameter.formalTypeParameterEnds(s, beginToken); sigs.add(s.substring(beginToken, endToken)); beginToken = endToken; } Iterator<String> it = sigs.iterator(); String[] result = new String[sigs.size()]; Arrays.setAll(result, j -> it.next()); return result; }

Target:
static String[] parseForFormalTypeParameters(String s) { ArrayList<String> sigs = new ArrayList<>(10); int beginToken = 1; while (s.charAt(beginToken) != '>') { int endToken = FormalTypeParameter.formalTypeParameterEnds(s, beginToken); sigs.add(s.substring(beginToken, endToken)); beginToken = endToken; } return sigs.toArray(new String[0]); }
Source:
public void updateGist_OK() throws IOException { Gist gist = new Gist(); gist.setId("test_repository"); gistService.updateGist(gist); verify(gitHubClient).put("/gists/test_repository.json", gist, Gist.class); }

Target:
public void updateGist_OK() throws IOException { Gist gist = new Gist(); gist.setId("123"); gistService.updateGist(gist); verify(gitHubClient).put("/gists/123.json", gist, Gist.class); }
Source:
public TrackedIssue setComponentKey(String componentKey) { Preconditions.checkArgument(StringUtils.countMatches(componentKey, ":") <= 1, "componentKey should not have branch"); this.componentKey = componentKey; return this; }

Target:
public TrackedIssue setComponentKey(String componentKey) { this.componentKey = componentKey; return this; }
Source:
public boolean hasMore() { if (it.hasNext()) { return true; } try { jsonParser.close(); if (++fileIndex >= files.size() || files.get(fileIndex).length() == 0) { return false; } jsonParser = jsonFactory.createParser(files.get(fileIndex)); it = jsonParser.readValuesAs(Row.class); return true; } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public boolean hasMore() { if (it.hasNext()) { return true; } try { if (jsonParser != null) { jsonParser.close(); } if (++fileIndex >= files.size() || files.get(fileIndex).length() == 0) { return false; } jsonParser = jsonFactory.createParser(files.get(fileIndex)); it = jsonParser.readValuesAs(Row.class); return true; } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public void run() { log.debug("Auth Token context persist consumer is started"); while (true) { try { AuthContextTokenDO authContextTokenDO = authContextTokenQueue.take(); if (authContextTokenDO != null) { if (authContextTokenDO.getAuthzCodeDO() == null) { log.debug("Auth Token Data removing Task is started to run"); TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); tokenMgtDAO.doExpireAuthorizationCode(authContextTokenDO.getAuthzCode(), authContextTokenDO .getTokenId()); } else { log.debug("Auth Token Data persisting Task is started to run"); TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); tokenMgtDAO.persistAuthorizationCode(authContextTokenDO.getAuthzCode(), authContextTokenDO.getConsumerKey(), authContextTokenDO.getCallbackUrl(), authContextTokenDO.getAuthzCodeDO()); } } } catch (InterruptedException | IdentityOAuth2Exception e) { log.error(e); } } }

Target:
public void run() { log.debug("Auth Token context persist consumer is started"); while (true) { try { AuthContextTokenDO authContextTokenDO = authContextTokenQueue.take(); if (authContextTokenDO != null) { if (authContextTokenDO.getAuthzCodeDO() == null) { log.debug("Auth Token Data removing Task is started to run"); TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); tokenMgtDAO.deactivateAuthorizationCode(authContextTokenDO.getAuthzCode(), authContextTokenDO .getTokenId()); } else { log.debug("Auth Token Data persisting Task is started to run"); TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); tokenMgtDAO.persistAuthorizationCode(authContextTokenDO.getAuthzCode(), authContextTokenDO.getConsumerKey(), authContextTokenDO.getCallbackUrl(), authContextTokenDO.getAuthzCodeDO()); } } } catch (InterruptedException | IdentityOAuth2Exception e) { log.error(e); } } }
Source:
public boolean equals(Object o) { if (o == null) { return false; } if (this == o) { return true; } if (!(this.getClass().equals(o.getClass()))) { return false; } SitePropertySource that = (SitePropertySource) o; return Objects.equal(mFilename, that.mFilename); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } SitePropertySource that = (SitePropertySource) o; return Objects.equal(mFilename, that.mFilename); }
Source:
protected void validateParameters(VnicProfile vnicProfile) { validateParameters(vnicProfile, "name"); if (!vnicProfile.isSetNetwork() || !vnicProfile.getNetwork().isSetId()) { vnicProfile.setNetwork(new Network()); vnicProfile.getNetwork().setId(networkId); } }

Target:
protected void validateParameters(VnicProfile vnicProfile) { validateParameters(vnicProfile, "name"); }
Source:
public void setUp() throws Exception { metadata = new MetadataImpl.MetadataImplBuilder(DEF_SET_ID).build(); when(definitionUtils.getQualifier(eq(DEF_SET_ID))).thenReturn(qualifier); preferencesHolders = spy(new ManagedInstanceStub<>(preferencesHolder)); doAnswer(invocation -> { ParameterizedCommand<Profile> callback = (ParameterizedCommand<Profile>) invocation.getArguments()[1]; callback.execute(profile); return null; }).when(profilePreferencesLoader).load(eq(metadata), any(ParameterizedCommand.class), any(ParameterizedCommand.class)); when(profile.getProfileId()).thenReturn(PROFILE_ID); tested = new StunnerProjectPreferencesRegistryLoader(definitionUtils, preferencesHolders, preferences, textPreferences, profilePreferencesLoader); }

Target:
public void setUp() { metadata = new MetadataImpl.MetadataImplBuilder(DEF_SET_ID).build(); when(definitionUtils.getQualifier(eq(DEF_SET_ID))).thenReturn(qualifier); preferencesHolders = spy(new ManagedInstanceStub<>(preferencesHolder)); doAnswer(invocation -> { ParameterizedCommand<Profile> callback = (ParameterizedCommand<Profile>) invocation.getArguments()[1]; callback.execute(profile); return null; }).when(profilePreferencesLoader).load(eq(metadata), any(ParameterizedCommand.class), any(ParameterizedCommand.class)); when(profile.getProfileId()).thenReturn(PROFILE_ID); tested = new StunnerProjectPreferencesRegistryLoader(definitionUtils, preferencesHolders, preferences, textPreferences, profilePreferencesLoader); }
Source:
public static ProfileTypeBuilder<TriggerProfileType> newTrigger(ProfileTypeUID profileTypeUID, String label) { return new ProfileTypeBuilder<>(profileTypeUID, label, (leProfileTypeUID, leLabel, leSupportedItemTypes, supportedItemTypesOfChannel, leSupportedChannelTypeUIDs) -> new TriggerProfileTypeImpl(leProfileTypeUID, leLabel, leSupportedItemTypes, leSupportedChannelTypeUIDs)); }

Target:
public static ProfileTypeBuilder<TriggerProfileType> newTrigger(ProfileTypeUID profileTypeUID, String label) { return new ProfileTypeBuilder<>(profileTypeUID, label, (leProfileTypeUID, leLabel, leSupportedItemTypes, leSupportedItemTypesOfChannel, leSupportedChannelTypeUIDs) -> new TriggerProfileTypeImpl(leProfileTypeUID, leLabel, leSupportedItemTypes, leSupportedChannelTypeUIDs)); }
Source:
ChecksDetails extractChecksDetails() { String text = extractChecksText(); System.out.println(text); ChecksOutput output = new ChecksOutput.ChecksOutputBuilder() .withTitle(extractChecksTitle()) .withSummary("<sub>Send us [feedback](<LINK_0>") .withText(text) .build(); return new ChecksDetails.ChecksDetailsBuilder() .withName("Tests") .withStatus(ChecksStatus.COMPLETED) .withConclusion(summary.getFailCount() > 0 ? ChecksConclusion.FAILURE : ChecksConclusion.SUCCESS) .withDetailsURL(jenkinsFacade.getAbsoluteUrl(action.run.getUrl(), action.getUrlName())) .withOutput(output) .build(); }

Target:
ChecksDetails extractChecksDetails() { String testsURL = DisplayURLProvider.get().getTestsURL(action.run); ChecksOutput output = new ChecksOutput.ChecksOutputBuilder() .withTitle(extractChecksTitle()) .withSummary("<sub>Send us [feedback](<LINK_0>") .withText(extractChecksText(testsURL)) .build(); return new ChecksDetails.ChecksDetailsBuilder() .withName("Tests") .withStatus(ChecksStatus.COMPLETED) .withConclusion(summary.getFailCount() > 0 ? ChecksConclusion.FAILURE : ChecksConclusion.SUCCESS) .withDetailsURL(testsURL) .withOutput(output) .build(); }
Source:
public MqttException(int reasonCode) { super(); this.reasonCode = reasonCode; }

Target:
public MqttException(int reasonCode) { this.reasonCode = reasonCode; }