auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void leaderChange_afterJobSubmission_recoversSubmittedJob() throws Exception { try (final DispatcherRunner dispatcherRunner = createDispatcherRunner()) { final UUID firstLeaderSessionId = UUID.randomUUID(); final DispatcherGateway firstDispatcherGateway = electLeaderAndRetrieveGateway(firstLeaderSessionId); firstDispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); CommonTestUtils.waitUntilJobManagerIsInitialized(() -> firstDispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get()); dispatcherLeaderElectionService.notLeader(); final UUID secondLeaderSessionId = UUID.randomUUID(); final DispatcherGateway secondDispatcherGateway = electLeaderAndRetrieveGateway(secondLeaderSessionId); final Collection<JobID> jobIds = secondDispatcherGateway.listJobs(TIMEOUT).get(); assertThat(jobIds, contains(jobGraph.getJobID())); } }

Target:
public void leaderChange_afterJobSubmission_recoversSubmittedJob() throws Exception { try (final DispatcherRunner dispatcherRunner = createDispatcherRunner()) { final UUID firstLeaderSessionId = UUID.randomUUID(); final DispatcherGateway firstDispatcherGateway = electLeaderAndRetrieveGateway(firstLeaderSessionId); firstDispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); dispatcherLeaderElectionService.notLeader(); final UUID secondLeaderSessionId = UUID.randomUUID(); final DispatcherGateway secondDispatcherGateway = electLeaderAndRetrieveGateway(secondLeaderSessionId); final Collection<JobID> jobIds = secondDispatcherGateway.listJobs(TIMEOUT).get(); assertThat(jobIds, contains(jobGraph.getJobID())); } }
Source:
private boolean thereAreLinesBetween(Node a, Node b) { if (!a.getRange().isPresent() || !b.getRange().isPresent()) { return true; } if (!PositionUtils.areInOrder(a, b)) { return thereAreLinesBetween(b, a); } int endOfA = a.getRange().get().end.line; return b.getRange().get().begin.line > endOfA + 1; }

Target:
private boolean thereAreLinesBetween(Node a, Node b) { if (!a.getRange().isPresent() || !b.getRange().isPresent()) { return true; } if (!PositionUtils.areInOrder(a, b)) { return thereAreLinesBetween(b, a); } int endOfA = a.getEnd().get().line; return b.getBegin().get().line > endOfA + 1; }
Source:
protected final void serialize(T src, JsonObject to, JsonSerializationContext context) { to.addProperty(MEMBER_MIN, src.min.toString(getFormatter())); to.addProperty(MEMBER_MAX, src.max.toString(getFormatter())); super.serialize(src, to, context); }

Target:
protected final void serialize(T src, JsonObject to, JsonSerializationContext context) { if(src.min != null) { to.addProperty(MEMBER_MIN, src.min.toString(getFormatter())); } if(src.max != null) { to.addProperty(MEMBER_MAX, src.max.toString(getFormatter())); } super.serialize(src, to, context); }
Source:
public void editInstructor(int instrNum, String name, String email, Boolean isDisplayedToStudents, String displayName, String role) { clickEditInstructorLink(instrNum); editInstructorName(instrNum, name); if (getEmailField(instrNum).getAttribute("readonly") == null) { editInstructorEmail(instrNum, email); } if (editInstructorDisplayedToStudents(instrNum, isDisplayedToStudents)) { editInstructorDisplayName(instrNum, displayName); } selectRoleForInstructor(instrNum, role); saveEditInstructor(instrNum); waitForPageToLoad(); }

Target:
public void editInstructor(int instrNum, String name, String email, Boolean isDisplayedToStudents, String displayName, String role) { clickEditInstructorLink(instrNum); editInstructorName(instrNum, name); if (getEmailField(instrNum).getAttribute("readonly") == null) { editInstructorEmail(instrNum, email); } editInstructorDisplayedToStudents(instrNum, isDisplayedToStudents); if (isDisplayedToStudents) { editInstructorDisplayName(instrNum, displayName); } selectRoleForInstructor(instrNum, role); saveEditInstructor(instrNum); waitForPageToLoad(); }
Source:
public Secret getPassword() { JenkinsJVM.checkNotJenkinsJVM(); try { String appInstallationToken; synchronized (this) { try { if (cachedToken == null || cachedToken.isStale()) { cachedToken = ch.call(new GetToken(tokenRefreshData)); LOGGER.log(Level.INFO, "Retrieved GitHub App Installation Token for app ID {0} on agent", appID); } } catch (Exception e) { if (cachedToken != null && !cachedToken.isExpired()) { LOGGER.log(Level.WARNING, "Keeping cached GitHub App Installation Token for app ID {0} on agent: token is stale but has not expired", appID); } else { throw e; } } appInstallationToken = cachedToken.getToken(); } LOGGER.log(Level.FINEST, "Returned GitHub App Installation Token for app ID {0} on agent", appID); return Secret.fromString(appInstallationToken); } catch (IOException | InterruptedException x) { LOGGER.log(Level.WARNING, "Failed to get GitHub App Installation token on agent: " + getId(), x); throw new RuntimeException(x); } }

Target:
public Secret getPassword() { JenkinsJVM.checkNotJenkinsJVM(); try { String appInstallationToken; synchronized (this) { try { if (cachedToken == null || cachedToken.isStale()) { LOGGER.log(Level.FINE, "Generating App Installation Token for app ID {0} on agent", appID); cachedToken = ch.call(new GetToken(tokenRefreshData)); LOGGER.log(Level.FINER, "Retrieved GitHub App Installation Token for app ID {0} on agent", appID); } } catch (Exception e) { if (cachedToken != null && !cachedToken.isExpired()) { LOGGER.log(Level.WARNING, "Failed to generate new GitHub App Installation Token for app ID " + appID + " on agent: cached token is stale but has not expired"); LOGGER.log(Level.FINER, () -> Functions.printThrowable(e)); } else { throw e; } } appInstallationToken = cachedToken.getToken(); } LOGGER.log(Level.FINEST, "Returned GitHub App Installation Token for app ID {0} on agent", appID); return Secret.fromString(appInstallationToken); } catch (IOException | InterruptedException x) { throw new RuntimeException(x); } }
Source:
public void onCheatSheetTabClick(ClickEvent event) { showTab(cheatSheetTab, cheatSheetTabContent); hideTab(editorTab, editorTabContent); }

Target:
public void onCheatSheetTabClick(ClickEvent event) { presenter.onCheatSheetTabActivated(); }
Source:
public boolean resize(int pointerCount) { if (useCount) { return true; } lruLock.lock(); try { long memoryUsed = ((long) pointerCount) << 3; boolean isNegative = memoryUsed < 0; long change = UnpooledOffHeapMemoryAllocator.estimateSizeOverhead(Math.abs(memoryUsed)); if (change >= maxSize) { return false; } if (isNegative) { currentSize -= change; } else { currentSize += change; } } finally { lruLock.unlock(); } return true; }

Target:
public boolean resize(int pointerCount) { if (useCount) { return true; } lruLock.lock(); try { boolean isNegative = pointerCount < 0; long memoryUsed = ((long) Math.abs(pointerCount)) << 3; long change = UnpooledOffHeapMemoryAllocator.estimateSizeOverhead(memoryUsed); if (!isNegative) { long changeSizeForAllSegments = change * numSegments; if (changeSizeForAllSegments < 0 || changeSizeForAllSegments >= maxSize) { return false; } } if (isNegative) { currentSize -= change; } else { currentSize += change; } } finally { lruLock.unlock(); } return true; }
Source:
protected void sendRedirect(HttpServletResponse response, String finalLocation) throws IOException { try { if (SC_FOUND == statusCode) { response.sendRedirect(finalLocation); } else { response.setStatus(statusCode); response.setHeader("Location", finalLocation); try { response.getWriter().write(finalLocation); } finally { response.getWriter().close(); } } } catch (IOException ioe) { LOG.warn("Unable to redirect to: {}, code: {}! (IOException): {}", finalLocation, statusCode, ioe.toString()); throw ioe; } catch (IllegalStateException ise) { LOG.warn("Unable to redirect to: {}, code: {}! isCommited: {}. (IllegalStateException): {}", finalLocation, statusCode, response.isCommitted(), ise.toString()); throw ise; } }

Target:
protected void sendRedirect(HttpServletResponse response, String finalLocation) throws IOException { try { if (SC_FOUND == statusCode) { response.sendRedirect(finalLocation); } else { response.setStatus(statusCode); response.setHeader("Location", finalLocation); try { response.getWriter().write(finalLocation); } finally { response.getWriter().close(); } } } catch (IOException ioe) { LOG.warn("Unable to redirect to: {}, code: {}; {}", finalLocation, statusCode, ioe); throw ioe; } catch (IllegalStateException ise) { LOG.warn("Unable to redirect to: {}, code: {}; isCommited: {}; {}", finalLocation, statusCode, response.isCommitted(), ise); throw ise; } }
Source:
public void createPartControl(Composite parent) { super.createPartControl(parent); super.getTimeGraphCombo().addTimeGraphFilterAdditionalButtonInfo( new ControlFlowCheckActiveButtonProvider(true)); super.getTimeGraphCombo().addTimeGraphFilterAdditionalButtonInfo( new ControlFlowCheckActiveButtonProvider(false)); }

Target:
public void createPartControl(Composite parent) { super.createPartControl(parent); super.getTimeGraphCombo().addTimeGraphFilterCheckActiveButton( new ControlFlowCheckActiveProvider("Check Active", "Checks all threads executing within the time frame.")); super.getTimeGraphCombo().addTimeGraphFilterUncheckInactiveButton( new ControlFlowCheckActiveProvider("Uncheck Inactive", "Unchecks all threads not executing within the time frame.")); }
Source:
void multipleRejectionSubscriptions() { ImmutableSetMultimap<DispatchKey, SubscriberMethod> map = MethodScan .findMethodsBy(ARejectionSubscriber.class, new SubscriberSignature()); assertThat(map.keys()).hasSize(2); }

Target:
void multipleRejectionSubscriptions() { ImmutableSetMultimap<DispatchKey, SubscriberMethod> map = findMethodsBy(ARejectionSubscriber.class, new SubscriberSignature()); assertThat(map.keys()).hasSize(2); }
Source:
public String saveAndRedirect() { if (migration && WorkflowStatus.DRAFT.equals(this.workflowStatus)) { Helper.setErrorMessage(Helper.getTranslation("errorMigrationDraft")); return this.stayOnCurrentPage; } try { if (hasMultipleSructureTreeConfigurations()) { Helper.setErrorMessage(Helper.getTranslation("errorMultipleConfigurations")); return this.stayOnCurrentPage; } if (saveFiles()) { this.workflow.setStatus(this.workflowStatus); saveWorkflow(); if (migration) { return MIGRATION_FORM_PATH + "&workflowId=" + workflow.getId(); } return workflowListPath; } else { return this.stayOnCurrentPage; } } catch (IOException e) { Helper.setErrorMessage("errorDiagramFile", new Object[] {this.workflow.getTitle() }, logger, e); return this.stayOnCurrentPage; } catch (WorkflowException e) { Helper.setErrorMessage("errorDiagramTask", new Object[] {this.workflow.getTitle(), e.getMessage() }, logger, e); return this.stayOnCurrentPage; } }

Target:
public String saveAndRedirect() { if (migration && WorkflowStatus.DRAFT.equals(this.workflowStatus)) { Helper.setErrorMessage(Helper.getTranslation("errorMigrationDraft")); return this.stayOnCurrentPage; } try { if (hasMultipleSructureTreeConfiguration()) { Helper.setErrorMessage(Helper.getTranslation("errorMultipleConfigurations")); return this.stayOnCurrentPage; } if (saveFiles()) { this.workflow.setStatus(this.workflowStatus); saveWorkflow(); if (migration) { return MIGRATION_FORM_PATH + "&workflowId=" + workflow.getId(); } return workflowListPath; } else { return this.stayOnCurrentPage; } } catch (IOException e) { Helper.setErrorMessage("errorDiagramFile", new Object[] {this.workflow.getTitle() }, logger, e); return this.stayOnCurrentPage; } catch (WorkflowException e) { Helper.setErrorMessage("errorDiagramTask", new Object[] {this.workflow.getTitle(), e.getMessage() }, logger, e); return this.stayOnCurrentPage; } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if(!SessionHistory.hasGameAlreadyPlayedOnce) { DatabaseHandler dbHandler = new DatabaseHandler(this); dbHandler.resetUnlocked(7); } setContentView(R.layout.activity_vocab_match_tutorials); tutorialView = (ImageView) findViewById(R.id.tut); curTutorialImage = 1; tutorialView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(curTutorialImage == PowerUpUtils.VOCAB_MATCH_TUTS.length){ Intent intent = new Intent(VocabMatchTutorials.this,VocabMatchGameActivity.class) .putExtra(PowerUpUtils.CALLED_BY, true); finish(); startActivity(intent); overridePendingTransition(R.animator.fade_in_custom, R.animator.fade_out_custom); }else { tutorialView.setImageDrawable(getResources().getDrawable(PowerUpUtils.VOCAB_MATCH_TUTS[curTutorialImage])); curTutorialImage++; } } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_vocab_match_tutorials); tutorialView = (ImageView) findViewById(R.id.tut); curTutorialImage = 1; tutorialView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(curTutorialImage == PowerUpUtils.VOCAB_MATCH_TUTS.length){ Intent intent = new Intent(VocabMatchTutorials.this,VocabMatchGameActivity.class) .putExtra(PowerUpUtils.CALLED_BY, true); finish(); startActivity(intent); overridePendingTransition(R.animator.fade_in_custom, R.animator.fade_out_custom); }else { tutorialView.setImageDrawable(getResources().getDrawable(PowerUpUtils.VOCAB_MATCH_TUTS[curTutorialImage])); curTutorialImage++; } } }); }
Source:
public AbfsRestOperation renamePath(String source, final String destination, final String continuation) throws AzureBlobFileSystemException { final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders(); String sasToken = ""; if (authType == AuthType.SAS) { final AbfsUriQueryBuilder queryBuilder = new AbfsUriQueryBuilder(); appendSASTokenToQuery(source, SASTokenProvider.RENAME_SOURCE_OPERATION, queryBuilder); sasToken = queryBuilder.toString(); } final String encodedRenameSource = urlEncode(FORWARD_SLASH + this.getFileSystem() + source) + sasToken; requestHeaders.add(new AbfsHttpHeader(X_MS_RENAME_SOURCE, encodedRenameSource)); requestHeaders.add(new AbfsHttpHeader(IF_NONE_MATCH, STAR)); final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder(); abfsUriQueryBuilder.addQuery(QUERY_PARAM_CONTINUATION, continuation); if (authType == AuthType.SAS) { appendSASTokenToQuery(destination, SASTokenProvider.RENAME_DESTINATION_OPERATION, abfsUriQueryBuilder); } final URL url = createRequestUrl(destination, abfsUriQueryBuilder.toString()); final AbfsRestOperation op = new AbfsRestOperation( AbfsRestOperationType.RenamePath, this, HTTP_METHOD_PUT, url, requestHeaders); op.execute(); return op; }

Target:
public AbfsRestOperation renamePath(String source, final String destination, final String continuation) throws AzureBlobFileSystemException { final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders(); final AbfsUriQueryBuilder srcQueryBuilder = new AbfsUriQueryBuilder(); appendSASTokenToQuery(source, SASTokenProvider.RENAME_SOURCE_OPERATION, srcQueryBuilder); String encodedRenameSource = urlEncode(FORWARD_SLASH + this.getFileSystem() + source); if (authType == AuthType.SAS) { encodedRenameSource += srcQueryBuilder.toString(); } LOG.trace("Rename source queryparam added {}", encodedRenameSource); requestHeaders.add(new AbfsHttpHeader(X_MS_RENAME_SOURCE, encodedRenameSource)); requestHeaders.add(new AbfsHttpHeader(IF_NONE_MATCH, STAR)); final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder(); abfsUriQueryBuilder.addQuery(QUERY_PARAM_CONTINUATION, continuation); appendSASTokenToQuery(destination, SASTokenProvider.RENAME_DESTINATION_OPERATION, abfsUriQueryBuilder); final URL url = createRequestUrl(destination, abfsUriQueryBuilder.toString()); final AbfsRestOperation op = new AbfsRestOperation( AbfsRestOperationType.RenamePath, this, HTTP_METHOD_PUT, url, requestHeaders); op.execute(); return op; }
Source:
public void routerErrorCodeResolutionTest() throws Exception { blobId = new BlobId(BlobId.BLOB_ID_V6, BlobId.BlobIdType.NATIVE, ClusterMapUtils.UNKNOWN_DATACENTER_ID, Utils.getRandomShort(TestUtils.RANDOM), Utils.getRandomShort(TestUtils.RANDOM), partition, false, BlobId.BlobDataType.DATACHUNK); blobIdString = blobId.getID(); LinkedHashMap<ServerErrorCode, RouterErrorCode> codesToSetAndTest = new LinkedHashMap<>(); codesToSetAndTest.put(ServerErrorCode.Blob_Authorization_Failure, RouterErrorCode.BlobAuthorizationFailure); codesToSetAndTest.put(ServerErrorCode.Blob_Expired, RouterErrorCode.BlobExpired); codesToSetAndTest.put(ServerErrorCode.Disk_Unavailable, RouterErrorCode.AmbryUnavailable); codesToSetAndTest.put(ServerErrorCode.IO_Error, RouterErrorCode.UnexpectedInternalError); doRouterErrorCodeResolutionTest(codesToSetAndTest); codesToSetAndTest.clear(); codesToSetAndTest.put(ServerErrorCode.Blob_Authorization_Failure, RouterErrorCode.BlobAuthorizationFailure); codesToSetAndTest.put(ServerErrorCode.Disk_Unavailable, RouterErrorCode.AmbryUnavailable); codesToSetAndTest.put(ServerErrorCode.Replica_Unavailable, RouterErrorCode.AmbryUnavailable); codesToSetAndTest.put(ServerErrorCode.Partition_Unknown, RouterErrorCode.UnexpectedInternalError); doRouterErrorCodeResolutionTest(codesToSetAndTest); blobId = new BlobId(BlobId.BLOB_ID_V6, BlobId.BlobIdType.NATIVE, clusterMap.getLocalDatacenterId(), Utils.getRandomShort(TestUtils.RANDOM), Utils.getRandomShort(TestUtils.RANDOM), partition, false, BlobId.BlobDataType.DATACHUNK); blobIdString = blobId.getID(); }

Target:
public void routerErrorCodeResolutionTest() throws Exception { LinkedHashMap<ServerErrorCode, RouterErrorCode> codesToSetAndTest = new LinkedHashMap<>(); codesToSetAndTest.put(ServerErrorCode.Blob_Authorization_Failure, RouterErrorCode.BlobAuthorizationFailure); codesToSetAndTest.put(ServerErrorCode.Blob_Expired, RouterErrorCode.BlobExpired); codesToSetAndTest.put(ServerErrorCode.Disk_Unavailable, RouterErrorCode.AmbryUnavailable); codesToSetAndTest.put(ServerErrorCode.IO_Error, RouterErrorCode.UnexpectedInternalError); doRouterErrorCodeResolutionTest(codesToSetAndTest); codesToSetAndTest.clear(); codesToSetAndTest.put(ServerErrorCode.Blob_Authorization_Failure, RouterErrorCode.BlobAuthorizationFailure); codesToSetAndTest.put(ServerErrorCode.Disk_Unavailable, RouterErrorCode.AmbryUnavailable); codesToSetAndTest.put(ServerErrorCode.Replica_Unavailable, RouterErrorCode.AmbryUnavailable); codesToSetAndTest.put(ServerErrorCode.Partition_Unknown, RouterErrorCode.UnexpectedInternalError); doRouterErrorCodeResolutionTest(codesToSetAndTest); }
Source:
public void purgeUserLocation_shouldPurgeAUserLocation() throws Exception { Assert.fail("Not yet implemented"); }

Target:
public void purgeUserLocation_shouldPurgeAUserLocation() throws Exception { MohCoreService cservice = Context.getService(MohCoreService.class); User sysUser = new User(); sysUser.setUserId(501); Location userLoc = new Location(); userLoc.setLocationId(1); UserLocation userlocation = new UserLocation(); userlocation.setSysUser(sysUser); userlocation.setUserLoc(userLoc); UserLocation uloc = cservice.saveUserLocation(userlocation); Integer userlocationid=uloc.getUserLocationId(); Assert.assertNotNull(userlocationid); cservice.purgeUserLocation(uloc); Assert.assertNull(cservice.getUserLocation(userlocationid)); }
Source:
private void updateDefaultQuota() { if (_oldStoragePool.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED && getStoragePool().getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED) { Pair<Quota, Boolean> defaultQuotaPair = getQutoaHelper().getUnlimitedQuota(getStoragePool(), true, true); Quota defaultQuota = defaultQuotaPair.getFirst(); boolean isQuotaReused = defaultQuotaPair.getSecond(); if (isQuotaReused) { log.debugFormat("Reusing quota {0} as the default quota for Storage Pool {1}", defaultQuota.getId(), defaultQuota.getStoragePoolId()); } else { defaultQuota.setQuotaName(getQutoaHelper().getDefaultQuotaName(getStoragePool())); } getQutoaHelper().saveQuotaForUser(defaultQuota, MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID, isQuotaReused); } }

Target:
private void updateDefaultQuota() { if (wasQuotaEnforcementDisabled()) { Pair<Quota, Boolean> defaultQuotaPair = getQutoaHelper().getUnlimitedQuota(getStoragePool(), true, true); Quota defaultQuota = defaultQuotaPair.getFirst(); boolean isQuotaReused = defaultQuotaPair.getSecond(); if (isQuotaReused) { log.debugFormat("Reusing quota {0} as the default quota for Storage Pool {1}", defaultQuota.getId(), defaultQuota.getStoragePoolId()); } else { defaultQuota.setQuotaName(getQutoaHelper().getDefaultQuotaName(getStoragePool())); } getQutoaHelper().saveQuotaForUser(defaultQuota, MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID, isQuotaReused); } }
Source:
static ConsoleLauncherExecutionResult forSummary(TestExecutionSummary summary, CommandLineOptions options) { return new ConsoleLauncherExecutionResult(summary, options); }

Target:
static ConsoleLauncherExecutionResult forSummary(TestExecutionSummary summary, CommandLineOptions options) { int exitCode = computeExitCode(summary, options); return new ConsoleLauncherExecutionResult(exitCode, summary); }
Source:
public Observable<ChangeNotification<Server>> resolvePeers(final ServiceType serviceType) { return clusterChangeObservable().map( new Func1<ChangeNotification<WriteServerAddress>, ChangeNotification<Server>>() { @Override public ChangeNotification<Server> call(ChangeNotification<WriteServerAddress> notification) { if (notification.getKind() == Kind.BufferSentinel) { return null; } WriteServerAddress data = notification.getData(); int port; switch (serviceType) { case Registration: port = data.getRegistrationPort(); break; case Interest: port = data.getDiscoveryPort(); break; default: port = data.getReplicationPort(); } Server serverAddress = new Server(data.getHostName(), port); switch (notification.getKind()) { case Add: return new ChangeNotification<Server>(Kind.Add, serverAddress); case Modify: throw new IllegalStateException("Modify not expected"); case Delete: return new ChangeNotification<Server>(Kind.Delete, serverAddress); } return null; } }).filter(RxFunctions.filterNullValuesFunc()); }

Target:
public Observable<ChangeNotification<Server>> resolvePeers(final ServiceType serviceType) { return clusterChangeObservable().map( new Func1<ChangeNotification<ClusterAddress>, ChangeNotification<Server>>() { @Override public ChangeNotification<Server> call(ChangeNotification<ClusterAddress> notification) { if (notification.getKind() == Kind.BufferSentinel) { return null; } ClusterAddress data = notification.getData(); int port; switch (serviceType) { case Registration: port = data.getRegistrationPort(); break; case Interest: port = data.getInterestPort(); break; case Replication: port = data.getReplicationPort(); break; default: throw new IllegalStateException("Unexpected enum value " + serviceType); } Server serverAddress = new Server(data.getHostName(), port); switch (notification.getKind()) { case Add: return new ChangeNotification<Server>(Kind.Add, serverAddress); case Modify: throw new IllegalStateException("Modify not expected"); case Delete: return new ChangeNotification<Server>(Kind.Delete, serverAddress); } return null; } }).filter(RxFunctions.filterNullValuesFunc()); }
Source:
public void testGeometryGetObjectValue() throws Exception { Slice slice = GeoFunctions.stPoint(1.2, 3.4); int[] offsets = {0, slice.length()}; boolean[] valueIsNull = {false}; VariableWidthBlock block = new VariableWidthBlock(1, slice, offsets, valueIsNull); assertEquals("POINT (1.2 3.4)", GEOMETRY.getObjectValue(null, block, 0)); }

Target:
public void testGeometryGetObjectValue() throws Exception { BlockBuilder builder = GEOMETRY.createBlockBuilder(new BlockBuilderStatus(), 1); GEOMETRY.writeSlice(builder, GeoFunctions.stPoint(1.2, 3.4)); Block block = builder.build(); assertEquals("POINT (1.2 3.4)", GEOMETRY.getObjectValue(null, block, 0)); }
Source:
public int hashCode() { int hash = mLocation.hashCode(); hash = hash * 31 + mMessageId; hash = hash * 31 + mSerialNumber; return hash; }

Target:
public int hashCode() { return mLocation.hashCode() + 5 * mMessageId + 7 * mSerialNumber; }
Source:
private void verifyAndOrRebuildIndex() throws IOException { if (verifyType == IndexTool.IndexVerifyType.AFTER || verifyType == IndexTool.IndexVerifyType.NONE || verifyType == IndexTool.IndexVerifyType.NONE) { rebuildIndexRows(mutations); } if (verifyType == IndexTool.IndexVerifyType.NONE) { return; } if (verifyType == IndexTool.IndexVerifyType.BEFORE || verifyType == IndexTool.IndexVerifyType.BOTH || verifyType == IndexTool.IndexVerifyType.ONLY) { onlyVerify = true; parallelizeIndexVerify(); } if (verifyType == IndexTool.IndexVerifyType.BEFORE || verifyType == IndexTool.IndexVerifyType.BOTH) { mutations.clear(); for (Map.Entry<byte[], Put> entry: dataKeyToDataPutMap.entrySet()) { mutations.add(entry.getValue()); } rebuildIndexRows(mutations); } if (verifyType == IndexTool.IndexVerifyType.AFTER || verifyType == IndexTool.IndexVerifyType.BOTH) { onlyVerify = false; indexKeyToDataPutMap.clear(); parallelizeIndexVerify(); } indexKeyToDataPutMap.clear(); }

Target:
private void verifyAndOrRebuildIndex() throws IOException { if (verifyType == IndexTool.IndexVerifyType.AFTER || verifyType == IndexTool.IndexVerifyType.NONE) { rebuildIndexRows(mutations); } if (verifyType == IndexTool.IndexVerifyType.NONE) { return; } if (verifyType == IndexTool.IndexVerifyType.BEFORE || verifyType == IndexTool.IndexVerifyType.BOTH || verifyType == IndexTool.IndexVerifyType.ONLY) { doNotFail = true; parallelizeIndexVerify(); } if (verifyType == IndexTool.IndexVerifyType.BEFORE || verifyType == IndexTool.IndexVerifyType.BOTH) { mutations.clear(); for (Map.Entry<byte[], Put> entry: dataKeyToDataPutMap.entrySet()) { mutations.add(entry.getValue()); } rebuildIndexRows(mutations); } if (verifyType == IndexTool.IndexVerifyType.AFTER || verifyType == IndexTool.IndexVerifyType.BOTH) { doNotFail = false; indexKeyToDataPutMap.clear(); parallelizeIndexVerify(); } indexKeyToDataPutMap.clear(); }
Source:
public void flushCommits() throws IOException { BufferedMutator bufMutator = connection.getBufferedMutator(this.tableName); for (ConcurrentLinkedQueue<Mutation> buffer : bPool) { for (Mutation m: buffer) { bufMutator.mutate(m); bufMutator.flush(); } } bufMutator.close(); }

Target:
public void flushCommits() throws IOException { BufferedMutator bufMutator = connection.getBufferedMutator(this.tableName); for (ConcurrentLinkedQueue<Mutation> buffer : bPool) { while (!buffer.isEmpty()) { Mutation m = buffer.poll(); bufMutator.mutate(m); } } bufMutator.flush(); bufMutator.close(); }
Source:
public void testListPersonsLimit() { given().headers(getAuthHeaders()) .get("/persons/persons?firstResult=2&maxResults=3") .then() .statusCode(200) .body("id.size()", is(3)) .body("id[0]", is(3) ) .body("birthday[0]", is(getDate(1990, 1, 1).toString() )) .body("sex[0]", is("FEMALE") ) .body("socialSecurityNumber[0]", is("123456-7890") ) .body("secureInfo[0]", is(Boolean.FALSE) ) .body("id[1]", is(4) ) .body("birthday[1]", is(getDate(1990, 1, 1).toString() )) .body("sex[1]", is("MALE") ) .body("socialSecurityNumber[1]", is("01234567-8901") ) .body("secureInfo[1]", is(Boolean.FALSE) ); }

Target:
public void testListPersonsLimit() { given().headers(getAuthHeaders()) .get("/persons/persons?firstResult=2&maxResults=3") .then() .statusCode(200) .body("id.size()", is(3)) .body("id[0]", is(3) ) .body("birthday[0]", is(getDate(1990, 1, 1).toString() )) .body("sex[0]", is( Sex.FEMALE.name() ) ) .body("socialSecurityNumber[0]", is("123456-7890") ) .body("secureInfo[0]", is(Boolean.FALSE) ) .body("id[1]", is(4) ) .body("birthday[1]", is(getDate(1990, 1, 1).toString() )) .body("sex[1]", is( Sex.MALE.name() ) ) .body("socialSecurityNumber[1]", is("01234567-8901") ) .body("secureInfo[1]", is(Boolean.FALSE) ); }
Source:
public Mono<T> cancelOperation() throws UnsupportedOperationException { if (this.cancelOperation == null) { throw logger.logExceptionAsError(new UnsupportedOperationException( "Cancel operation is not supported on this service/resource.")); } final PollResponse<T> response = this.pollResponse; if (response != null && response.getStatus() != OperationStatus.IN_PROGRESS) { return Mono.empty(); } return this.cancelOperation.apply(this); }

Target:
public Mono<T> cancelOperation() { if (this.cancelOperation == null) { return Mono.error(logger.logExceptionAsError(new UnsupportedOperationException( "Cancel operation is not supported on this service/resource."))); } final PollResponse<T> response = this.pollResponse; if (response != null && response.getStatus() != OperationStatus.IN_PROGRESS) { return Mono.empty(); } return this.cancelOperation.apply(this); }
Source:
public int hashCode() { int prime = 31; int result = 1; result = prime * result + (isCall ? 1231 : 1237); long temp; temp = Double.doubleToLongBits(strike); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(timeToExpiry); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; }

Target:
public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + JodaBeanUtils.hashCode(getStrike()); hash = hash * 31 + JodaBeanUtils.hashCode(getTimeToExpiry()); hash = hash * 31 + JodaBeanUtils.hashCode(getPutCall()); return hash; }
Source:
private String generateDockerCfg(Map<String, AuthConfig> authConfigs) throws InfrastructureException { try (StringWriter strWriter = new StringWriter(); JsonWriter jsonWriter = new Gson().newJsonWriter(strWriter)) { Base64.Encoder encoder = Base64.getEncoder(); jsonWriter.beginObject(); for (Map.Entry<String, AuthConfig> entry : authConfigs.entrySet()) { String name = entry.getKey(); AuthConfig authConfig = entry.getValue(); try { if (!name.startsWith("https://") && !name.startsWith("http://")) { name = "https://" + name; } jsonWriter.name(name); jsonWriter.beginObject(); jsonWriter.name("username"); jsonWriter.value(authConfig.getUsername()); jsonWriter.name("password"); jsonWriter.value(authConfig.getPassword()); jsonWriter.name("email"); jsonWriter.value("email@email"); String auth = new StringBuilder(authConfig.getUsername()) .append(':') .append(authConfig.getPassword()) .toString(); jsonWriter.name("auth"); jsonWriter.value(encoder.encodeToString(auth.getBytes())); jsonWriter.endObject(); } catch (IOException e) { throw new InfrastructureException(e); } } jsonWriter.endObject(); jsonWriter.flush(); return strWriter.toString(); } catch (IOException e) { throw new InfrastructureException(e); } }

Target:
private String generateDockerCfg(Map<String, AuthConfig> authConfigs) throws InfrastructureException { try (StringWriter strWriter = new StringWriter(); JsonWriter jsonWriter = new Gson().newJsonWriter(strWriter)) { Base64.Encoder encoder = Base64.getEncoder(); jsonWriter.beginObject(); for (Map.Entry<String, AuthConfig> entry : authConfigs.entrySet()) { String name = entry.getKey(); AuthConfig authConfig = entry.getValue(); try { if (!name.startsWith("https://") && !name.startsWith("http://")) { name = "https://" + name; } jsonWriter.name(name); jsonWriter.beginObject(); jsonWriter.name("username"); jsonWriter.value(authConfig.getUsername()); jsonWriter.name("password"); jsonWriter.value(authConfig.getPassword()); jsonWriter.name("email"); jsonWriter.value("email@email"); String auth = new StringBuilder(authConfig.getUsername()) .append(':') .append(authConfig.getPassword()) .toString(); jsonWriter.name("auth"); jsonWriter.value(encoder.encodeToString(auth.getBytes())); jsonWriter.endObject(); } catch (IOException e) { throw new InfrastructureException( "Unexpected exception occured while building the 'ImagePullSecret' from private docker registry user preferences", e); } } jsonWriter.endObject(); jsonWriter.flush(); return strWriter.toString(); } catch (IOException e) { throw new InfrastructureException(e); } }
Source:
public boolean isScanMarkerRow(FlatRow row) { return row.getCells() == null || row.getCells().isEmpty(); }

Target:
public boolean isScanMarkerRow(FlatRow row) { return row.getCells().isEmpty(); }
Source:
public E next() { if (Graph.this.modcount != expectedModCount) { throw new ConcurrentModificationException(); } if (iteratorStack.isEmpty()) { throw new NoSuchElementException(); } Node<E> resultNode = iteratorStack.getLast().next(); if (consumedNodes.add(resultNode)) { iteratorStack.add(Iterators.filter(resultNode.getChildren().iterator(), new Predicate<Node<E>>() { public boolean apply(Node<E> input) { return !consumedNodes.contains(input); } })); } ListIterator<Iterator<Node<E>>> reverseStackIterator = iteratorStack.listIterator(iteratorStack .size()); while (reverseStackIterator.hasPrevious() && !reverseStackIterator.previous().hasNext()) { reverseStackIterator.remove(); } return resultNode.getElement(); }

Target:
public E next() { if (Graph.this.modcount != expectedModCount) { throw new ConcurrentModificationException(); } if (iteratorStack.isEmpty()) { throw new NoSuchElementException(); } Node<E> resultNode = iteratorStack.getLast().next(); if (consumedNodes.add(resultNode)) { iteratorStack.add(Iterators.filter(resultNode.getChildren().iterator(), this)); } ListIterator<Iterator<Node<E>>> reverseStackIterator = iteratorStack.listIterator(iteratorStack .size()); while (reverseStackIterator.hasPrevious() && !reverseStackIterator.previous().hasNext()) { reverseStackIterator.remove(); } return resultNode.getElement(); }
Source:
public String getMessage() { StringBuilder message = new StringBuilder(); message.append("Error ").append(errorCode); message.append(" for user ").append(user); if (!tableInfo.isEmpty()) { message.append(" on table ").append(tableInfo); } message.append(" - ").append(super.getMessage()); return message.toString(); }

Target:
public String getMessage() { StringBuilder message = new StringBuilder(); message.append("Error ").append(errorCode); message.append(" for user ").append(user); if (!StringUtils.isEmpty(tableInfo)) { message.append(" on table ").append(tableInfo); } message.append(" - ").append(super.getMessage()); return message.toString(); }
Source:
public boolean isAllowTagsPropagation() { try { return this.getAnalysisEnvironment().getSkylarkSemantics().experimentalAllowTagsPropagation(); } catch (InterruptedException e) { return false; } }

Target:
public boolean isAllowTagsPropagation() throws InterruptedException { return this.getAnalysisEnvironment().getSkylarkSemantics().experimentalAllowTagsPropagation(); }
Source:
private String response(StatementResult result) { StringBuilder response = new StringBuilder(); response.append("\nSummary:"); ResultSummary summary = result.summary(); response.append("\nConstraints Added: ") .append(summary.counters().constraintsAdded()) .append("\nConstraints Removed: ") .append(summary.counters().constraintsRemoved()) .append("\nContains Updates: ") .append(summary.counters().containsUpdates()) .append("\nIndexes Added: ") .append(summary.counters().indexesAdded()) .append("\nIndexes Removed: ") .append(summary.counters().indexesRemoved()) .append("\nLabels Added: ") .append(summary.counters().labelsAdded()) .append("\nLabels Removed: ") .append(summary.counters().labelsRemoved()) .append("\nNodes Created: ") .append(summary.counters().nodesCreated()) .append("\nNodes Deleted: ") .append(summary.counters().nodesDeleted()) .append("\nRelationships Created: ") .append(summary.counters().relationshipsCreated()) .append("\nRelationships Deleted: ") .append(summary.counters().relationshipsDeleted()); response.append("\n\nRecords: "); if (isRecordQueryResults()) { result.stream().forEach(record -> response.append("\n") .append(record) ); } else { response.append("Skipped"); result.consume(); } return response.toString(); }

Target:
private String response(StatementResult result) { StringBuilder response = new StringBuilder(); response.append("\nSummary:"); ResultSummary summary = result.summary(); response.append("\nConstraints Added: ") .append(summary.counters().constraintsAdded()) .append("\nConstraints Removed: ") .append(summary.counters().constraintsRemoved()) .append("\nContains Updates: ") .append(summary.counters().containsUpdates()) .append("\nIndexes Added: ") .append(summary.counters().indexesAdded()) .append("\nIndexes Removed: ") .append(summary.counters().indexesRemoved()) .append("\nLabels Added: ") .append(summary.counters().labelsAdded()) .append("\nLabels Removed: ") .append(summary.counters().labelsRemoved()) .append("\nNodes Created: ") .append(summary.counters().nodesCreated()) .append("\nNodes Deleted: ") .append(summary.counters().nodesDeleted()) .append("\nRelationships Created: ") .append(summary.counters().relationshipsCreated()) .append("\nRelationships Deleted: ") .append(summary.counters().relationshipsDeleted()); response.append("\n\nRecords: "); if (isRecordQueryResults()) { for (Record record : result.list()) { response.append("\n").append(record); } } else { response.append("Skipped"); result.consume(); } return response.toString(); }
Source:
public Optional<PlanNode> apply(PlanNode node, Captures captures, Context context) { PlanNodeMatcher planNodeMatcher = new PlanNodeMatcher(context.getLookup()); Set<Rule> matching = ruleSet.rules().stream() .filter(rule -> matches(rule.getPattern(), node, planNodeMatcher)) .collect(toSet()); if (matching.size() == 0) { return empty(); } return apply(node, getOnlyElement(matching), context); }

Target:
public Optional<PlanNode> apply(PlanNode node, Captures captures, Context context) { PlanNodeMatcher planNodeMatcher = new PlanNodeMatcher(context.getLookup()); Set<RuleMatch> matching = ruleSet.rules().stream() .map(rule -> new RuleMatch(rule, planNodeMatcher.match(rule.getPattern(), node))) .filter(ruleMatch -> ruleMatch.match.isPresent()) .collect(toSet()); if (matching.size() == 0) { return empty(); } return getOnlyElement(matching).apply(context); }
Source:
protected List<Member> addIndirectMembers(PerunSession sess, Group group, List<Member> members, int sourceGroupId) throws InternalErrorException, AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException { List<Member> oldMembers = this.getGroupMembers(sess, group); for(Member member: members) { groupsManagerImpl.addMember(sess, group, member, MembershipType.INDIRECT, sourceGroupId); getPerunBl().getAuditer().log(sess, "{} added to as INDIRECT.", member, group); } List<Member> newMembers = this.getGroupMembers(sess, group); newMembers.removeAll(oldMembers); return newMembers; }

Target:
protected List<Member> addIndirectMembers(PerunSession sess, Group group, List<Member> members, int sourceGroupId) throws InternalErrorException, AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException { List<Member> oldMembers = this.getGroupActiveMembers(sess, group); for(Member member: members) { groupsManagerImpl.addMember(sess, group, member, MembershipType.INDIRECT, sourceGroupId); User user = getPerunBl().getUsersManagerBl().getUserByMember(sess, member); List<Resource> resources = getPerunBl().getResourcesManagerBl().getAssignedResources(sess, group); for (Resource resource : resources) { Facility facility = getPerunBl().getResourcesManagerBl().getFacility(sess, resource); try { getPerunBl().getAttributesManagerBl().setRequiredAttributes(sess, facility, resource, user, member); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } catch(AttributeNotExistsException ex) { throw new ConsistencyErrorException(ex); } } } List<Member> newMembers = this.getGroupActiveMembers(sess, group); newMembers.removeAll(oldMembers); return newMembers; }
Source:
public static void authenticate(HadoopDruidIndexerConfig config) { String principal = config.getSchema().getTuningConfig().getPrincipal(); String keytab = config.getSchema().getTuningConfig().getKeytab(); if (Strings.isNullOrEmpty(principal) || Strings.isNullOrEmpty(keytab)) { return; } Configuration conf = new Configuration(); UserGroupInformation.setConfiguration(conf); if (UserGroupInformation.isSecurityEnabled()) { try { if (UserGroupInformation.getCurrentUser().hasKerberosCredentials() == false || UserGroupInformation.getCurrentUser().getUserName() != principal) { log.info("trying to authenticate user [%s] with keytab [%s]", principal, keytab); UserGroupInformation.loginUserFromKeytab(principal, keytab); } } catch (IOException e) { log.error(e, "Failed to authenticate user principal [%s] with keytab [%s]", principal, keytab); } } }

Target:
public static void authenticate(HadoopDruidIndexerConfig config) { String principal = config.HADOOP_KERBEROS_CONFIG.getPrincipal(); String keytab = config.HADOOP_KERBEROS_CONFIG.getKeytab(); if (!Strings.isNullOrEmpty(principal) && !Strings.isNullOrEmpty(keytab)) { Configuration conf = new Configuration(); UserGroupInformation.setConfiguration(conf); if (UserGroupInformation.isSecurityEnabled()) { try { if (UserGroupInformation.getCurrentUser().hasKerberosCredentials() == false || !UserGroupInformation.getCurrentUser().getUserName().equals(principal)) { log.info("trying to authenticate user [%s] with keytab [%s]", principal, keytab); UserGroupInformation.loginUserFromKeytab(principal, keytab); } } catch (IOException e) { throw new ISE(e, "Failed to authenticate user principal [%s] with keytab [%s]", principal, keytab); } } } }
Source:
public boolean visible() { switch (state_) { case HIDE: return false; case MINIMIZE: return false; default: return true; } }

Target:
public boolean visible() { switch (state_) { case HIDE: case MINIMIZE: return false; default: return true; } }
Source:
public String getValidCidr (ClaudiaData claudiaData, String region,int subNetElement) throws InfrastructureException{ String cidr = String.format(NETWORK_CIDR, NET_ELEMENT, subNetElement); if (checkCidrValid(claudiaData, region, cidr)) { return cidr; } else { return getValidCidr (claudiaData, region,subNetElement+1); } }

Target:
private String getValidCidr (ClaudiaData claudiaData, String region, int subNetElement) throws InfrastructureException { String cidr = String.format(NETWORK_CIDR, NET_ELEMENT, subNetElement); if (checkCidrValid(claudiaData, region, cidr)) { return cidr; } else { return getValidCidr (claudiaData, region,subNetElement+1); } }
Source:
public void onAuthStateChanged(@NonNull FirebaseAuth auth) { mSendButton.setEnabled(isSignedIn()); mMessageEdit.setEnabled(isSignedIn()); if (isSignedIn()) { attachRecyclerViewAdapter(); } else { Toast.makeText(this, R.string.signing_in, Toast.LENGTH_SHORT).show(); auth.signInAnonymously() .addOnSuccessListener(this, new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult result) { attachRecyclerViewAdapter(); } }) .addOnCompleteListener(new SignInResultNotifier(this)); } }

Target:
public void onAuthStateChanged(@NonNull FirebaseAuth auth) { mSendButton.setEnabled(isSignedIn()); mMessageEdit.setEnabled(isSignedIn()); if (isSignedIn()) { attachRecyclerViewAdapter(); } else { Toast.makeText(this, R.string.signing_in, Toast.LENGTH_SHORT).show(); auth.signInAnonymously().addOnCompleteListener(new SignInResultNotifier(this)); } }
Source:
private void initFirewallType() { ListModel<FirewallType> firewallType = getFirewallType(); firewallType.setItems(Arrays.asList(FirewallType.values())); firewallType.setIsChangeable(false); firewallType.setSelectedItem(FirewallType.FIREWALLD); }

Target:
private void initFirewallType() { ListModel<FirewallType> firewallType = getFirewallType(); firewallType.setItems(Arrays.asList(FirewallType.values())); firewallType.setIsChangeable(true); firewallType.setSelectedItem(FirewallType.FIREWALLD); }
Source:
protected AuroraController getController() { String klass = config.getStringValue(Key.AURORA_CONTROLLER_CLASS); Config localConfig = Config.toLocalMode(this.config); switch (klass) { case "com.twitter.heron.scheduler.aurora.AuroraCLIController": return new AuroraCLIController( Runtime.topologyName(runtime), Context.cluster(localConfig), Context.role(localConfig), Context.environ(localConfig), AuroraContext.getHeronAuroraPath(localConfig), Context.verbose(localConfig)); case "com.twitter.heron.scheduler.aurora.AuroraHeronShellController": return new AuroraHeronShellController( Runtime.topologyName(runtime), Context.cluster(localConfig), Context.role(localConfig), Context.environ(localConfig), AuroraContext.getHeronAuroraPath(localConfig), Context.verbose(localConfig)); default: throw new RuntimeException("aurora controller class not found " + klass); } }

Target:
protected AuroraController getController() throws ClassNotFoundException, InstantiationException, IllegalAccessException { Boolean cliController = config.getBooleanValue(Key.AURORA_CONTROLLER_CLASS); Config localConfig = Config.toLocalMode(this.config); if (cliController) { return new AuroraCLIController( Runtime.topologyName(runtime), Context.cluster(localConfig), Context.role(localConfig), Context.environ(localConfig), AuroraContext.getHeronAuroraPath(localConfig), Context.verbose(localConfig)); } else { return new AuroraHeronShellController( Runtime.topologyName(runtime), Context.cluster(localConfig), Context.role(localConfig), Context.environ(localConfig), AuroraContext.getHeronAuroraPath(localConfig), Context.verbose(localConfig)); } }
Source:
public String toHtml(Map<String, String> dynamicUpdateModes) { boolean hasUpdateModes = !dynamicUpdateModes.isEmpty(); List<ConfigKey> configs = sortedConfigs(); StringBuilder b = new StringBuilder(); b.append("<ul class=\"config-list\">\n"); for (ConfigKey key : configs) { if (key.internalConfig) { continue; } b.append("<li>\n"); b.append(String.format("<h4>" + "<a id=\"%1$s\" href=\"#%1$s\">%1$s</a>" + "</h4>\n", key.name)); b.append("<p>"); b.append(key.documentation.replaceAll("\n", "<br>")); b.append("</p>\n"); b.append("<table>" + "<tbody>\n"); for (String detail : headers()) { if (detail.equals("Name") || detail.equals("Description")) continue; addConfigDetail(b, detail, getConfigValue(key, detail)); } if (hasUpdateModes) { String updateMode = dynamicUpdateModes.get(key.name); if (updateMode == null) updateMode = "read-only"; addConfigDetail(b, "Update Mode:", updateMode); } b.append("</tbody></table>\n"); b.append("</li>\n"); } b.append("</ul>\n"); return b.toString(); }

Target:
public String toHtml(Map<String, String> dynamicUpdateModes) { boolean hasUpdateModes = !dynamicUpdateModes.isEmpty(); List<ConfigKey> configs = sortedConfigs(); StringBuilder b = new StringBuilder(); b.append("<ul class=\"config-list\">\n"); for (ConfigKey key : configs) { if (key.internalConfig) { continue; } b.append("<li>\n"); b.append(String.format("<h4>" + "<a id=\"%1$s\" href=\"#%1$s\">%1$s</a>" + "</h4>%n", key.name)); b.append("<p>"); b.append(key.documentation.replaceAll("\n", "<br>")); b.append("</p>\n"); b.append("<table>" + "<tbody>\n"); for (String detail : headers()) { if (detail.equals("Name") || detail.equals("Description")) continue; addConfigDetail(b, detail, getConfigValue(key, detail)); } if (hasUpdateModes) { String updateMode = dynamicUpdateModes.get(key.name); if (updateMode == null) updateMode = "read-only"; addConfigDetail(b, "Update Mode", updateMode); } b.append("</tbody></table>\n"); b.append("</li>\n"); } b.append("</ul>\n"); return b.toString(); }
Source:
public MBeanServer getMBeanServer() { return MBeanServerFactory.createMBeanServer(); }

Target:
public MBeanServer getMBeanServer() { return ManagementFactory.getPlatformMBeanServer(); }
Source:
public void rollback() { if (!sortedWriteToTmpPathEnabled) { for (TempFile file : tempFiles) { cleanupFile(file.getPath()); } } outputWriter.rollback(); }

Target:
public void rollback() { if (!sortedWriteToTempPathEnabled) { for (TempFile file : tempFiles) { cleanupFile(file.getPath()); } } outputWriter.rollback(); }
Source:
public void testMinimalWidthOneCellInEachRowWithPadding() throws Exception { gridData.appendColumn(column); gridData.appendRow(new DMNGridRow()); gridData.appendRow(new DMNGridRow()); gridData.appendRow(new DMNGridRow()); mockCellsWithPadding(0, 0, PADDING, 100d); mockCellsWithPadding(1, 0, PADDING, 150); mockCellsWithPadding(2, 0, PADDING, 125); Assertions.assertThat(column.getMinimumWidth()).isEqualTo(170); }

Target:
public void testMinimalWidthOneCellInEachRowWithPadding() throws Exception { gridData.appendColumn(column); gridData.appendRow(new DMNGridRow()); gridData.appendRow(new DMNGridRow()); gridData.appendRow(new DMNGridRow()); mockCellsWithPadding(0, 0, PADDING, 100); mockCellsWithPadding(1, 0, PADDING, 150); mockCellsWithPadding(2, 0, PADDING, 125); Assertions.assertThat(column.getMinimumWidth()).isEqualTo(170); }