auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void validateNewCommits(RefControl ctl, ReceiveCommand cmd) { final RevWalk walk = rp.getRevWalk(); walk.reset(); walk.sort(RevSort.NONE); ObjectInserter inserter = null; try { walk.markStart(walk.parseCommit(cmd.getNewId())); for (ObjectId id : existingObjects()) { try { walk.markUninteresting(walk.parseCommit(id)); } catch (IOException e) { continue; } } RevCommit c; boolean forReview = MagicBranch.isMagicBranch(cmd.getRefName()) || NEW_PATCHSET.matcher(cmd.getRefName()).matches(); while ((c = walk.next()) != null) { if (!validCommit(ctl, cmd, c)) { break; } if (!forReview) { if (inserter == null) { inserter = repo.newObjectInserter(); bypassReviewCommitMsg = new StringBuilder("Update notes for bypassed code-review\n\n"); } bypassReviewNotes.set(c, noReviewNoteContent(c, ctl.getRefName()), inserter); bypassReviewCommitMsg.append("* ").append(c.getShortMessage()) .append("\n"); } } } catch (IOException err) { cmd.setResult(Result.REJECTED_MISSING_OBJECT); log.error("Invalid pack upload; one or more objects weren't sent", err); } finally { if (inserter != null) { inserter.release(); } } }

Target:
private void validateNewCommits(RefControl ctl, ReceiveCommand cmd) { final RevWalk walk = rp.getRevWalk(); walk.reset(); walk.sort(RevSort.NONE); ObjectInserter inserter = null; try { walk.markStart(walk.parseCommit(cmd.getNewId())); for (ObjectId id : existingObjects()) { try { walk.markUninteresting(walk.parseCommit(id)); } catch (IOException e) { continue; } } RevCommit c; boolean forReview = MagicBranch.isMagicBranch(cmd.getRefName()) || NEW_PATCHSET.matcher(cmd.getRefName()).matches(); while ((c = walk.next()) != null) { if (!validCommit(ctl, cmd, c)) { break; } if (!forReview) { if (inserter == null) { inserter = repo.newObjectInserter(); bypassReviewCommitMsg = new StringBuilder("Update notes for bypassed code-review\n\n"); } bypassReviewNotes.set(c, noReviewNoteContent(c, ctl.getRefName()), inserter); bypassReviewCommitMsg.append("* ").append(c.getShortMessage()) .append("\n"); } } if (inserter != null) { inserter.flush(); } } catch (IOException err) { cmd.setResult(REJECTED_MISSING_OBJECT); log.error("Invalid pack upload; one or more objects weren't sent", err); } finally { if (inserter != null) { inserter.release(); } } }
Source:
public void copyToAndFromRealm() { AllJavaTypes unmanagedChild = new AllJavaTypes(1); assertNull(unmanagedChild.getObjectParents()); realm.beginTransaction(); AllJavaTypes parent = realm.createObject(AllJavaTypes.class, 2); AllJavaTypes child = realm.copyToRealm(unmanagedChild); parent.setFieldObject(child); realm.commitTransaction(); RealmResults<AllJavaTypes> parents = child.getObjectParents(); assertNotNull(parents); assertEquals(1, parents.size()); assertEquals(parent, parents.first()); unmanagedChild = realm.copyFromRealm(child); assertEquals(unmanagedChild.getFieldId(), 1); assertNull(unmanagedChild.getObjectParents()); RealmResults<AllJavaTypes> queryResults = realm.where(AllJavaTypes.class).equalTo("fieldId", 1).findAll(); assertEquals(1, queryResults.size()); child = queryResults.first(); parents = child.getObjectParents(); assertNotNull(parents); assertEquals(1, parents.size()); assertEquals(parent, parents.first()); }

Target:
public void copyToAndFromRealm() { AllJavaTypes unmanagedChild = new AllJavaTypes(1); assertNull(unmanagedChild.getObjectParents()); realm.beginTransaction(); AllJavaTypes parent = realm.createObject(AllJavaTypes.class, 2); AllJavaTypes child = realm.copyToRealm(unmanagedChild); parent.setFieldObject(child); realm.commitTransaction(); RealmResults<AllJavaTypes> parents = child.getObjectParents(); assertNotNull(parents); assertEquals(1, parents.size()); assertEquals(parent, parents.first()); unmanagedChild = realm.copyFromRealm(child); assertEquals(unmanagedChild.getFieldId(), 1); assertEquals(new AllJavaTypes().getObjectParents(), unmanagedChild.getObjectParents()); RealmResults<AllJavaTypes> queryResults = realm.where(AllJavaTypes.class).equalTo("fieldId", 1).findAll(); assertEquals(1, queryResults.size()); child = queryResults.first(); parents = child.getObjectParents(); assertNotNull(parents); assertEquals(1, parents.size()); assertEquals(parent, parents.first()); }
Source:
private Semaphore getSemaphore(int maxSize) { if (maxSize < 0) { return new LimitlessSemaphore(); } return new Semaphore(maxSize, true); }

Target:
private Semaphore getSemaphore(int maxSize) { if (maxSize <= LIMITLESS) { return new LimitlessSemaphore(); } return new Semaphore(maxSize, true); }
Source:
private boolean hasInvalidAnswers(boolean markCompleted, boolean fireTriggerables) { FormIndex i = FormEntryActivity.mFormController.getFormIndex(); FormEntryActivity.mFormController.jumpToIndex(FormIndex.createBeginningOfFormIndex()); int event; if (!fireTriggerables) { Logger.log(AndroidLogger.TYPE_FORM_ENTRY, "Saving form without firing triggers."); } while ((event = FormEntryActivity.mFormController.stepToNextEvent(FormController.STEP_INTO_GROUP)) != FormEntryController.EVENT_END_OF_FORM) { if (event == FormEntryController.EVENT_QUESTION) { int saveStatus; if (fireTriggerables) { saveStatus = FormEntryActivity.mFormController .answerQuestion(FormEntryActivity.mFormController.getQuestionPrompt() .getAnswerValue()); } else { saveStatus = FormEntryActivity.mFormController.checkCurrentQuestionConstraint(); } if (markCompleted && saveStatus != FormEntryController.ANSWER_OK && (saveStatus == FormEntryController.ANSWER_REQUIRED_BUT_EMPTY || saveStatus == FormEntryController.ANSWER_CONSTRAINT_VIOLATED)) { return true; } } } FormEntryActivity.mFormController.jumpToIndex(i); return false; }

Target:
private boolean hasInvalidAnswers(boolean markCompleted, boolean fireTriggerables) { FormIndex i = FormEntryActivity.mFormController.getFormIndex(); FormEntryActivity.mFormController.jumpToIndex(FormIndex.createBeginningOfFormIndex()); int event; if (!fireTriggerables) { Logger.log(AndroidLogger.TYPE_FORM_ENTRY, "Saving form without firing triggers."); } while ((event = FormEntryActivity.mFormController.stepToNextEvent(FormController.STEP_INTO_GROUP)) != FormEntryController.EVENT_END_OF_FORM) { if (event == FormEntryController.EVENT_QUESTION) { int saveStatus; if (fireTriggerables) { saveStatus = FormEntryActivity.mFormController .answerQuestion(FormEntryActivity.mFormController.getQuestionPrompt() .getAnswerValue()); } else { saveStatus = FormEntryActivity.mFormController.checkCurrentQuestionConstraint(); } if (markCompleted && (saveStatus == FormEntryController.ANSWER_REQUIRED_BUT_EMPTY || saveStatus == FormEntryController.ANSWER_CONSTRAINT_VIOLATED)) { return true; } } } FormEntryActivity.mFormController.jumpToIndex(i); return false; }
Source:
public Slice next() throws IOException { do { if (inputStream == null) { inputStream = getInputStream(currentPointer); } if (inputStream != null && !fileContext.util().exists(currentOpenPath)) { close(); inputStream = getInputStream(currentPointer); } if (inputStream != null && currentPointer.offset < fileContext.getFileStatus(currentOpenPath).getLen()) { int len = inputStream.readInt(); Preconditions.checkState(len >= 0, "negative length"); byte[] data = new byte[len]; inputStream.readFully(data); currentPointer.offset += data.length + 4; return new Slice(data); } } while (nextSegment()); return null; }

Target:
public Slice next() throws IOException { do { if (inputStream == null) { inputStream = getInputStream(currentPointer); } if (inputStream != null && isOpenPathTmp && !fileSystemWAL.tempPartFiles.containsKey(currentPointer.partNum)) { close(); inputStream = getInputStream(currentPointer); } if (inputStream != null && currentPointer.offset < fileContext.getFileStatus(currentOpenPath).getLen()) { int len = inputStream.readInt(); Preconditions.checkState(len >= 0, "negative length"); byte[] data = new byte[len]; inputStream.readFully(data); currentPointer.offset += data.length + 4; return new Slice(data); } } while (nextSegment()); close(); return null; }
Source:
public Contact getContact(ObjectNode node, String location, ParseResult result) { if (node == null) return null; Contact contact = new Contact(); String value = getString("name", node, false, location + ".name", result); contact.setName(value); value = getString("url", node, false, location + ".url", result); contact.setUrl(value); value = getString("email", node, false, location + ".email", result); contact.setEmail(value); contact.setExtensions(new LinkedHashMap<>()); Set<String> keys = getKeys(node); for(String key : keys) { if(key.startsWith("x-")) { contact.getExtensions().put(key, Json.mapper().convertValue(node.get(key), Object.class)); } else if (!CONTACT_KEYS.contains(key)) { result.extra(location + ".contact", key, node.get(key)); } } return contact; }

Target:
public Contact getContact(ObjectNode node, String location, ParseResult result) { if (node == null) return null; Contact contact = new Contact(); String value = getString("name", node, false, location + ".name", result); if(StringUtils.isNotBlank(value)) { contact.setName(value); } value = getString("url", node, false, location + ".url", result); if(StringUtils.isNotBlank(value)) { contact.setUrl(value); } value = getString("email", node, false, location + ".email", result); if(StringUtils.isNotBlank(value)) { contact.setEmail(value); } Map <String,Object> extensions = getExtensions(node,location,result); if(extensions != null && extensions.size() > 0) { contact.setExtensions(extensions); } return contact; }
Source:
public void init() { service = new TransformationEngineService(); EKBModelGraph graph = EKBModelGraph.getInstance(); ModelRegistryService registry = ModelRegistryService.getInstance(null); registry.setEkbClassLoader(new EKBTestClassLoader()); registry.setGraphDb(graph); service.setModelRegistry(registry); service.setGraphDb(graph); graph.addModel(getModelADescription()); graph.addModel(getModelBDescription()); graph.addModel(getModelCDescription()); }

Target:
public void init() { service = new TransformationEngineService(); EKBModelGraph graph = EKBModelGraph.getInstance(); ModelRegistryService registry = ModelRegistryService.getInstance(context); registry.setEkbClassLoader(new EKBTestClassLoader()); registry.setGraphDb(graph); service.setModelRegistry(registry); service.setGraphDb(graph); graph.addModel(getModelADescription()); graph.addModel(getModelBDescription()); graph.addModel(getModelCDescription()); }
Source:
public MapExpressionMethods() { context = new StandardEvaluationContext(); context.addMethodResolver(new PartitionKeyMethodResolver()); context.addPropertyAccessor(new MapPartitionKeyPropertyAccessor()); }

Target:
public MapExpressionMethods() { this(null); }
Source:
protected void executeVmCommand() { super.executeVmCommand(); if (getReturnValue().getSucceeded() && getParameters().isEdited()) { editedVM.setId(getVmId()); editedVM.setStoragePoolId(getParameters().getStorageDomainId()); editedVM.setVmCreationDate(getVm().getVmCreationDate()); editedVM.setCreatedByUserId(getVm().getCreatedByUserId()); getParameters().setVm(editedVM); getParameters().setVmId(editedVM.getId()); ActionReturnValue returnValue = runInternalAction( ActionType.UpdateVm, getParameters()); returnValue.setActionReturnValue(getReturnValue().getActionReturnValue()); setReturnValue(returnValue); } }

Target:
protected void executeVmCommand() { super.executeVmCommand(); if (getReturnValue().getSucceeded() && getParameters().isEdited()) { editedVM.setId(getVmId()); editedVM.setVmCreationDate(getVm().getVmCreationDate()); editedVM.setCreatedByUserId(getVm().getCreatedByUserId()); getParameters().setVm(editedVM); getParameters().setVmId(editedVM.getId()); ActionReturnValue returnValue = runInternalAction( ActionType.UpdateVm, getParameters()); returnValue.setActionReturnValue(getReturnValue().getActionReturnValue()); setReturnValue(returnValue); } }
Source:
public void serialize(CassandraStreamHeader header, DataOutputPlus out, int version) throws IOException { out.writeUTF(header.version.toString()); out.writeUTF(header.format.name); out.writeLong(header.estimatedKeys); out.writeInt(header.sections.size()); for (SSTableReader.PartitionPositionBounds section : header.sections) { out.writeLong(section.lowerPosition); out.writeLong(section.upperPosition); } header.calculateCompressionInfo(); CompressionInfo.serializer.serialize(header.compressionInfo, out, version); out.writeInt(header.sstableLevel); SerializationHeader.serializer.serialize(header.version, header.header, out); header.tableId.serialize(out); out.writeBoolean(header.fullStream); if (header.fullStream) { out.writeInt(header.components.size()); for (ComponentInfo info : header.components) ComponentInfo.serializer.serialize(info, out, version); ByteBufferUtil.writeWithShortLength(header.firstKey.getKey(), out); } }

Target:
public void serialize(CassandraStreamHeader header, DataOutputPlus out, int version) throws IOException { out.writeUTF(header.version.toString()); out.writeUTF(header.format.name); out.writeLong(header.estimatedKeys); out.writeInt(header.sections.size()); for (SSTableReader.PartitionPositionBounds section : header.sections) { out.writeLong(section.lowerPosition); out.writeLong(section.upperPosition); } header.calculateCompressionInfo(); CompressionInfo.serializer.serialize(header.compressionInfo, out, version); out.writeInt(header.sstableLevel); SerializationHeader.serializer.serialize(header.version, header.serializationHeader, out); header.tableId.serialize(out); out.writeBoolean(header.isEntireSSTable); if (header.isEntireSSTable) { ComponentManifest.serializer.serialize(header.componentManifest, out, version); ByteBufferUtil.writeWithVIntLength(header.firstKey.getKey(), out); } }
Source:
public void testGetRequiredResources() { DefaultResourceTracker tracker = new DefaultResourceTracker(); JobID jobId1 = JobID.generate(); JobID jobId2 = JobID.generate(); ResourceRequirement requirement1 = ResourceRequirement.create(ResourceProfile.ANY, 1); ResourceRequirement requirement2 = ResourceRequirement.create(ResourceProfile.ANY, 2); tracker.notifyResourceRequirements(jobId1, Collections.singletonList(requirement1)); tracker.notifyResourceRequirements(jobId2, Collections.singletonList(requirement2)); Map<JobID, Collection<ResourceRequirement>> requiredResources = tracker.getRequiredResources(); assertThat(requiredResources, IsMapContaining.hasEntry(is(jobId1), contains(requirement1))); assertThat(requiredResources, IsMapContaining.hasEntry(is(jobId2), contains(requirement2))); }

Target:
public void testGetRequiredResources() { DefaultResourceTracker tracker = new DefaultResourceTracker(); ResourceRequirement requirement1 = ResourceRequirement.create(ResourceProfile.ANY, 1); ResourceRequirement requirement2 = ResourceRequirement.create(ResourceProfile.ANY, 2); tracker.notifyResourceRequirements(JOB_ID_1, Collections.singletonList(requirement1)); tracker.notifyResourceRequirements(JOB_ID_2, Collections.singletonList(requirement2)); Map<JobID, Collection<ResourceRequirement>> requiredResources = tracker.getMissingResources(); assertThat(requiredResources, IsMapContaining.hasEntry(is(JOB_ID_1), contains(requirement1))); assertThat(requiredResources, IsMapContaining.hasEntry(is(JOB_ID_2), contains(requirement2))); }
Source:
private static Glide initGlide(Context context) { Context applicationContext = context.getApplicationContext(); List<GlideModule> manifestModules = new ManifestParser(applicationContext).parse(); if (Log.isLoggable(TAG, Log.DEBUG)) { for (GlideModule glideModule : manifestModules) { Log.d(TAG, "Discovered GlideModule from manifest: " + glideModule.getClass()); } } RootGlideModule annotationGeneratedModule = getAnnotationGeneratedGlideModules(); if (annotationGeneratedModule != null) { if (Log.isLoggable(TAG, Log.DEBUG)) { for (Class<? extends GlideModule> glideModuleClazz : annotationGeneratedModule.getAnnotatedGlideModuleClasses()) { Log.d(TAG, "Discovered GlideModule from annotation: " + glideModuleClazz); } } validateGlideModulesRegisteredOnce(annotationGeneratedModule, manifestModules); manifestModules.add(annotationGeneratedModule); } GlideBuilder builder = new GlideBuilder(applicationContext); for (GlideModule module : manifestModules) { module.applyOptions(applicationContext, builder); } Glide glide = builder.createGlide(); for (GlideModule module : manifestModules) { module.registerComponents(applicationContext, glide.registry); } return glide; }

Target:
private static Glide initGlide(Context context) { Context applicationContext = context.getApplicationContext(); GeneratedRootGlideModule annotationGeneratedModule = getAnnotationGeneratedGlideModules(); List<GlideModule> manifestModules = Collections.emptyList(); if (annotationGeneratedModule == null || annotationGeneratedModule.isManifestParsingEnabled()) { manifestModules = new ManifestParser(applicationContext).parse(); } if (annotationGeneratedModule != null && !annotationGeneratedModule.getExcludedModuleClasses().isEmpty()) { Set<Class<?>> excludedModuleClasses = annotationGeneratedModule.getExcludedModuleClasses(); for (Iterator<GlideModule> iterator = manifestModules.iterator(); iterator.hasNext();) { GlideModule current = iterator.next(); if (!excludedModuleClasses.contains(current.getClass())) { continue; } if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "RootGlideModule excludes manifest GlideModule: " + current); } iterator.remove(); } } if (Log.isLoggable(TAG, Log.DEBUG)) { for (GlideModule glideModule : manifestModules) { Log.d(TAG, "Discovered GlideModule from manifest: " + glideModule.getClass()); } } GlideBuilder builder = new GlideBuilder(); for (GlideModule module : manifestModules) { module.applyOptions(applicationContext, builder); } if (annotationGeneratedModule != null) { annotationGeneratedModule.applyOptions(applicationContext, builder); } Glide glide = builder.createGlide(applicationContext); for (GlideModule module : manifestModules) { module.registerComponents(applicationContext, glide.registry); } if (annotationGeneratedModule != null) { annotationGeneratedModule.registerComponents(applicationContext, glide.registry); } return glide; }
Source:
public String getActingUserName() { try { return Objects.requireNonNull(Crn.fromString(new String(Base64.getDecoder().decode(getActingUserAccessKey())))).getUserId(); } catch (Exception e) { if (Crn.isCrn(getActingUser().getCrn())) { return Objects.requireNonNull(Crn.fromString(getActingUser().getCrn())).getUserId(); } if (!testParameter.get(CloudbreakTest.USER_NAME).isEmpty() || testParameter.get(CloudbreakTest.USER_NAME) != null) { return testParameter.get(CloudbreakTest.USER_NAME); } LOGGER.error("Cannot find acting user: '{}' - Name, because of: '{}'", getActingUserAccessKey(), e.getMessage(), e); throw new TestFailException(String.format("Cannot find acting user: '%s' - Name, because of: '%s'", getActingUserAccessKey(), e.getMessage()), e); } }

Target:
public String getActingUserName() { return getMockUserName() .or(this::getRealUMSUserName) .or(this::getUserParameterName) .orElseThrow(() -> new TestFailException(String.format("Cannot find acting user: '%s' - Name", getActingUserAccessKey()))); }
Source:
public void setupMainPanel() { preferences = BasePanelPreferences.from(Globals.prefs); splitPane = new SplitPane(); splitPane.setOrientation(Orientation.VERTICAL); adjustSplitter(); createMainTable(); ScrollPane pane = mainTable.getPane(); pane.setFitToHeight(true); pane.setFitToWidth(true); splitPane.getItems().add(pane); executorService.execute(() -> { instantiateSearchAutoCompleter(); this.getDatabase().registerListener(new SearchAutoCompleteListener()); setupAutoCompletion(); }); dividerPositionSubscription = EasyBind.monadic(Bindings.valueAt(splitPane.getDividers(), 0)) .flatMap(SplitPane.Divider::positionProperty) .subscribe((observable, oldValue, newValue) -> saveDividerLocation(newValue)); Optional<Path> file = bibDatabaseContext.getDatabasePath(); if (file.isPresent()) { resetChangeMonitorAndChangePane(); } else { if (bibDatabaseContext.getDatabase().hasEntries()) { this.baseChanged = true; } changePane = null; getChildren().add(splitPane); } }

Target:
public void setupMainPanel() { preferences = BasePanelPreferences.from(Globals.prefs); splitPane = new SplitPane(); splitPane.setOrientation(Orientation.VERTICAL); adjustSplitter(); createMainTable(); ScrollPane pane = mainTable.getPane(); pane.setFitToHeight(true); pane.setFitToWidth(true); splitPane.getItems().add(pane); executorService.execute(() -> { instantiateSearchAutoCompleter(); setupAutoCompletion(); }); this.getDatabase().registerListener(new SearchAutoCompleteListener()); dividerPositionSubscription = EasyBind.monadic(Bindings.valueAt(splitPane.getDividers(), 0)) .flatMap(SplitPane.Divider::positionProperty) .subscribe((observable, oldValue, newValue) -> saveDividerLocation(newValue)); Optional<Path> file = bibDatabaseContext.getDatabasePath(); if (file.isPresent()) { resetChangeMonitorAndChangePane(); } else { if (bibDatabaseContext.getDatabase().hasEntries()) { this.baseChanged = true; } changePane = null; getChildren().add(splitPane); } }
Source:
public ConventionTableDefinitionDescriptor(Path ddlFile) { checkArgument(exists(ddlFile) && isRegularFile(ddlFile), "Invalid file: %s", ddlFile); this.name = getFilenameWithoutExtension(ddlFile); this.ddlFile = ddlFile; Path dataFile = changeExtension(ddlFile, "data"); Path dataGeneratorFile = changeExtension(ddlFile, "data-generator"); if (exists(dataGeneratorFile)) { checkArgument(!exists(dataFile), "Expected no data file when data-generator file is present"); makeExecutable(dataGeneratorFile); ProcessUtils.execute(process -> copy(dataFile, process), dataGeneratorFile.toString()); } if (exists(dataFile) && isRegularFile(dataFile)) { Path revisionFile = changeExtension(ddlFile, "data-revision"); checkArgument(exists(revisionFile) && isRegularFile(revisionFile), "No revision file found: %s", revisionFile); this.dataFile = Optional.of(dataFile); this.revisionFile = Optional.of(revisionFile); } else { this.dataFile = Optional.empty(); this.revisionFile = Optional.empty(); } }

Target:
public ConventionTableDefinitionDescriptor(Path ddlFile) { checkArgument(exists(ddlFile) && isRegularFile(ddlFile), "Invalid file: %s", ddlFile); this.name = getFilenameWithoutExtension(ddlFile); this.ddlFile = ddlFile; Path dataFile = changeExtension(ddlFile, "data"); Path dataGeneratorFile = changeExtension(ddlFile, "data-generator"); if (exists(dataGeneratorFile)) { checkArgument(!exists(dataFile), "Expected no data file when data-generator file is present"); makeExecutable(dataGeneratorFile); ProcessUtils.execute(process -> feed(dataFile, process), dataGeneratorFile.toString()); } if (exists(dataFile) && isRegularFile(dataFile)) { Path revisionFile = changeExtension(ddlFile, "data-revision"); checkArgument(exists(revisionFile) && isRegularFile(revisionFile), "No revision file found: %s", revisionFile); this.dataFile = Optional.of(dataFile); this.revisionFile = Optional.of(revisionFile); } else { this.dataFile = Optional.empty(); this.revisionFile = Optional.empty(); } }
Source:
private void deleteRoutingDataPath() throws Exception { TestHelper.verify(() -> { _zkList.forEach(zk -> ZK_SERVER_MAP.get(zk).getZkClient() .deleteRecursively(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)); for (String zk : _zkList) { if (ZK_SERVER_MAP.get(zk).getZkClient() .exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) { return false; } } return true; }, TestHelper.WAIT_DURATION); }

Target:
private void deleteRoutingDataPath() throws Exception { Assert.assertTrue(TestHelper.verify(() -> { _zkList.forEach(zk -> ZK_SERVER_MAP.get(zk).getZkClient() .deleteRecursively(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)); for (String zk : _zkList) { if (ZK_SERVER_MAP.get(zk).getZkClient() .exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) { return false; } } return true; }, TestHelper.WAIT_DURATION), "Routing data path should be deleted after the tests."); }
Source:
private void initVisibilities() { errorMsg.setVisible(false); actionConfirmationMessage.setVisible(false); geoRepForceHelpIcon.setVisible(false); }

Target:
private void initVisibilities() { errorMsg.setVisible(false); geoRepForceHelpIcon.setVisible(false); }
Source:
private void setupActivityFromState(final Bundle state) { if (state != null) { if (!shouldShowDualPane) { toggleNavigationDrawer(state.getBoolean(STATE_DRAWER_OPENED, false)); } } }

Target:
private void setupActivityFromState(final Bundle state) { if (state != null && !shouldShowDualPane) { toggleNavigationDrawer(state.getBoolean(STATE_DRAWER_OPENED, false)); } }
Source:
public boolean accept( Method<?, ?> method ) { return !method.isConstructor() && method.getAnnotation( Generated.class ) != null; }

Target:
public boolean accept( Method<?, ?> method ) { return !method.isConstructor() && method.getAnnotation( Generated.class ) != null && ( isGetScoreMethod( method ) || isSetScoreMethod( method ) || isCompareMethod( method ) ); }
Source:
private EntityView(Context context, Detail d, String[] columnTitles, boolean hasCalloutResponseData) { super(context); DetailField calloutResponseDetailField = null; if (hasCalloutResponseData && d.getCallout() != null) { calloutResponseDetailField = d.getCallout().getResponseDetail(); String[] headerTextWithCalloutResponse = new String[columnTitles.length + 1]; System.arraycopy(columnTitles, 0, headerTextWithCalloutResponse, 0, columnTitles.length); columnTitles = headerTextWithCalloutResponse; columnTitles[columnTitles.length - 1] = calloutResponseDetailField.getHeader().evaluate(); } int columnCount = columnTitles.length; this.views = new ArrayList<>(columnCount); this.mHints = new ArrayList<>(columnCount); String[] headerForms = new String[columnCount]; int i = 0; for (DetailField field : d.getFields()) { mHints.add(field.getHeaderWidthHint()); headerForms[i] = field.getHeaderForm(); i++; } if (calloutResponseDetailField != null) { mHints.add(calloutResponseDetailField.getHeaderWidthHint()); headerForms[columnCount-1] = calloutResponseDetailField.getHeaderForm(); } int[] colors = AndroidUtil.getThemeColorIDs(getContext(), new int[]{R.attr.entity_view_header_background_color, R.attr.entity_view_header_text_color}); if (colors[0] != -1) { this.setBackgroundColor(colors[0]); } for (int col = 0; col < columnCount; ++col) { views.add(addCell(col, columnTitles[col], headerForms[col], mHints.get(col), null, colors[1], false)); } }

Target:
private EntityView(Context context, Detail d, String[] columnTitles, boolean hasCalloutResponseData) { super(context); DetailField calloutResponseDetailField = null; if (hasCalloutResponseData && d.getCallout() != null) { calloutResponseDetailField = d.getCallout().getResponseDetailField(); columnTitles = addColumnTitleForCalloutData(columnTitles, calloutResponseDetailField); } int columnCount = columnTitles.length; this.views = new ArrayList<>(columnCount); this.mHints = new ArrayList<>(columnCount); String[] headerForms = new String[columnCount]; int i = 0; for (DetailField field : d.getFields()) { mHints.add(field.getHeaderWidthHint()); headerForms[i] = field.getHeaderForm(); i++; } if (calloutResponseDetailField != null) { mHints.add(calloutResponseDetailField.getHeaderWidthHint()); headerForms[columnCount-1] = calloutResponseDetailField.getHeaderForm(); } int[] colors = AndroidUtil.getThemeColorIDs(getContext(), new int[]{R.attr.entity_view_header_background_color, R.attr.entity_view_header_text_color}); if (colors[0] != -1) { this.setBackgroundColor(colors[0]); } for (int col = 0; col < columnCount; ++col) { views.add(addCell(col, columnTitles[col], headerForms[col], mHints.get(col), null, colors[1], false)); } }
Source:
public final void execute(BlockingRunnable runnable) { if (shutdown) { throw new RejectedExecutionException("Executor Service is already shutdown"); } blockedTasks.offer(runnable); controllerThread.checkForReadyTask(); if (log.isTraceEnabled()) { log.tracef("Added a new task: %s task(s) are waiting", blockedTasks.size()); } }

Target:
public final void execute(BlockingRunnable runnable) { if (shutdown) { throw new RejectedExecutionException("Executor Service is already shutdown"); } if (runnable.isReady()) { doExecute(runnable); if (log.isTraceEnabled()) { log.tracef("Added a new task directly: %s task(s) are waiting", blockedTasks.size()); } } else { blockedTasks.offer(runnable); controllerThread.checkForReadyTask(); if (log.isTraceEnabled()) { log.tracef("Added a new task to the queue: %s task(s) are waiting", blockedTasks.size()); } } }
Source:
public boolean isAmphibious() { return hasWorkingMisc(MiscType.F_FULLY_AMPHIBIOUS) || hasWorkingMisc(MiscType.F_AMPHIBIOUS) || hasWorkingMisc(MiscType.F_FULLY_AMPHIBIOUS); }

Target:
public boolean isAmphibious() { return hasWorkingMisc(MiscType.F_FULLY_AMPHIBIOUS) || hasWorkingMisc(MiscType.F_AMPHIBIOUS) || hasWorkingMisc(MiscType.F_LIMITED_AMPHIBIOUS); }
Source:
private static HttpLoggingInterceptor getLoggingInterceptor() { final HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor() .setLevel(Level.BODY); httpLoggingInterceptor.redactHeader("Authorization"); httpLoggingInterceptor.redactHeader("Cookie"); return httpLoggingInterceptor; }

Target:
private static HttpLoggingInterceptor getLoggingInterceptor() { final HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor() .setLevel(Level.BASIC); httpLoggingInterceptor.redactHeader("Authorization"); httpLoggingInterceptor.redactHeader("Cookie"); return httpLoggingInterceptor; }
Source:
private JGitFileSystemLock createFSLock(Git git) { return new JGitFileSystemLock(git, 30000l); }

Target:
private JGitFileSystemLock createFSLock(Git git) { return new JGitFileSystemLock(git, TimeUnit.MILLISECONDS, 30_000L); }
Source:
private List<Tag> getRevTags() { Collection<Ref> revTags = repo.getTags().values(); List<Tag> tags = new ArrayList<Tag>(); for (Ref ref : revTags) { try { Tag tag = repo.mapTag(ref.getName()); tags.add(tag); } catch (IOException e) { MessageDialog.openError(getShell(), UIText.TagAction_errorDuringTagging, NLS.bind( UIText.TagAction_errorWhileMappingRevTag, ref .getName())); } } return tags; }

Target:
private List<Tag> getRevTags() { Collection<Ref> revTags = repo.getTags().values(); List<Tag> tags = new ArrayList<Tag>(); for (Ref ref : revTags) { try { Tag tag = repo.mapTag(ref.getName()); tags.add(tag); } catch (IOException e) { ErrorDialog.openError(getShell(), UIText.TagAction_errorDuringTagging, NLS.bind( UIText.TagAction_errorWhileMappingRevTag, ref .getName()), new Status(IStatus.ERROR, Activator.getPluginId(), e.getMessage(), e)); } } return tags; }
Source:
private void closeTailAndOffer(PBDSegment newSegment) throws IOException { PBDSegment last = peekLastSegment(); if (last != null) { if (!last.isBeingPolled()) { last.close(); } else { last.sync(); } last.setFinal(true); if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug("Segment " + last.file() + " (final: " + last.isFinal() + "), has been closed by offer to PBD"); } } m_segments.put(newSegment.segmentId(), newSegment); }

Target:
private void closeTailAndOffer(PBDSegment newSegment) throws IOException { PBDSegment last = peekLastSegment(); if (last != null) { if (!last.isBeingPolled()) { last.close(); } else { last.sync(); } last.setFinal(true); if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug("Segment " + last.file() + " (final: " + last.isFinal() + "), has been closed by offer to PBD"); } } m_segments.put(newSegment.segmentIndex(), newSegment); }
Source:
public void testGetIdentificationString() { AdminEmailAttributes adminEmail = createValidAdminEmailAttributesObject(); assertEquals(this.sendDate + "/" + this.subject, adminEmail.getIdentificationString()); }

Target:
public void testGetIdentificationString() { assertEquals(date + "/" + subject, adminEmailAttributes.getIdentificationString()); }
Source:
public EmailBuilder enableEmailLinkSignIn() { super.mProviderId = EMAIL_LINK_PROVIDER; return this; }

Target:
public EmailBuilder enableEmailLinkSignIn() { setProviderId(EMAIL_LINK_PROVIDER); return this; }
Source:
public void updateZkNode() { synchronized(status) { if (status == TrackerStatus.BUSY) { updateZkNode(getOldestActiveTimestamp()); } else if (status == TrackerStatus.IDLE) { closeZkNode(); } } }

Target:
synchronized void updateZkNode() { if (status == TrackerStatus.BUSY) { updateZkNode(getOldestActiveTimestamp()); } else if (status == TrackerStatus.IDLE) { closeZkNode(); } }
Source:
private Set<String> validateTools(Devfile devfile) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); Tool editorTool = null; for (Tool tool : devfile.getTools()) { if (!existingNames.add(tool.getName())) { throw new DevfileFormatException(format("Duplicate tool name found:'%s'", tool.getName())); } switch (tool.getType()) { case "cheEditor": if (editorTool != null) { throw new DevfileFormatException( format( "Multiple editor tools found: '%s', '%s'", editorTool.getName(), tool.getName())); } editorTool = tool; break; case "chePlugin": break; default: throw new DevfileFormatException( format("Unsupported tool '%s' type provided:'%s'", tool.getName(), tool.getType())); } } return existingNames; }

Target:
private Set<String> validateTools(Devfile devfile) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); Tool editorTool = null; for (Tool tool : devfile.getTools()) { if (!existingNames.add(tool.getName())) { throw new DevfileFormatException(format("Duplicate tool name found:'%s'", tool.getName())); } switch (tool.getType()) { case EDITOR_TOOL_TYPE: if (editorTool != null) { throw new DevfileFormatException( format( "Multiple editor tools found: '%s', '%s'", editorTool.getName(), tool.getName())); } editorTool = tool; break; case PLUGIN_TOOL_TYPE: break; default: throw new DevfileFormatException( format("Unsupported tool '%s' type provided:'%s'", tool.getName(), tool.getType())); } } return existingNames; }
Source:
public FieldVisitor visitField(int flags, String name, String desc, @Nullable String signature, @Nullable Object value) { Preconditions.checkNotNull(name); Preconditions.checkNotNull(desc); if (isNotSynthetic(flags)) { int filteredFlags = Flags.filterAccessBytecodeFlags(flags); JavaType type = convertAsmType(Type.getType(desc)); JavaSymbol.VariableJavaSymbol symbol = new JavaSymbol.VariableJavaSymbol(filteredFlags, name, type, classSymbol); if (Flags.isFlagged(flags, Flags.STATIC) && Flags.isFlagged(flags, Flags.FINAL)) { symbol = new JavaSymbol.ConstantJavaSymbol(filteredFlags, name, type, classSymbol, value); } classSymbol.members.enter(symbol); if (signature != null) { ReadType typeReader = new ReadType(); new SignatureReader(signature).accept(typeReader); symbol.type = typeReader.typeRead; } return new BytecodeFieldVisitor(symbol, this); } return null; }

Target:
public FieldVisitor visitField(int flags, String name, String desc, @Nullable String signature, @Nullable Object value) { Preconditions.checkNotNull(name); Preconditions.checkNotNull(desc); if (isNotSynthetic(flags)) { int filteredFlags = Flags.filterAccessBytecodeFlags(flags); JavaType type = convertAsmType(Type.getType(desc)); JavaSymbol.VariableJavaSymbol symbol = new JavaSymbol.VariableJavaSymbol(filteredFlags, name, type, classSymbol, value); classSymbol.members.enter(symbol); if (signature != null) { ReadType typeReader = new ReadType(); new SignatureReader(signature).accept(typeReader); symbol.type = typeReader.typeRead; } return new BytecodeFieldVisitor(symbol, this); } return null; }
Source:
OnheapIncrementalIndex( IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean concurrentEventAdd, boolean sortFacts, int maxRowCount, long maxBytesInMemory ) { super(incrementalIndexSchema, deserializeComplexMetrics, reportParseExceptions, concurrentEventAdd); this.maxRowCount = maxRowCount; this.maxBytesInMemory = maxBytesInMemory == 0 ? Runtime.getRuntime().maxMemory() / 6 : maxBytesInMemory; this.facts = incrementalIndexSchema.isRollup() ? new RollupFactsHolder(sortFacts, dimsComparator(), getDimensions()) : new PlainFactsHolder(sortFacts); maxBytesPerRowForAggregators = getMaxBytesPerRowForAggregators(incrementalIndexSchema); }

Target:
OnheapIncrementalIndex( IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean concurrentEventAdd, boolean sortFacts, int maxRowCount, long maxBytesInMemory ) { super(incrementalIndexSchema, deserializeComplexMetrics, reportParseExceptions, concurrentEventAdd); this.maxRowCount = maxRowCount; this.maxBytesInMemory = maxBytesInMemory == 0 ? Long.MAX_VALUE : maxBytesInMemory; this.facts = incrementalIndexSchema.isRollup() ? new RollupFactsHolder(sortFacts, dimsComparator(), getDimensions()) : new PlainFactsHolder(sortFacts); maxBytesPerRowForAggregators = getMaxBytesPerRowForAggregators(incrementalIndexSchema); }
Source:
private void initialize() { Set<Class<?>> annotatedClasses = ClassScanner.getAnnotatedClasses(Arrays.asList(Include.class, SecurityCheck.class)); annotatedClasses.forEach(cls -> { if (cls.getAnnotation(Include.class) != null) { dictionary.bindEntity(getType(cls)); staticModelDetails.add(dictionary, cls); } else { dictionary.addSecurityCheck(cls); } }); }

Target:
private void initialize() { Set<Class<?>> annotatedClasses = ClassScanner.getAnnotatedClasses(Arrays.asList(Include.class, SecurityCheck.class)); annotatedClasses.forEach(cls -> { if (cls.getAnnotation(Include.class) != null) { dictionary.bindEntity(cls); staticModelDetails.add(dictionary, getClassType(cls)); } else { dictionary.addSecurityCheck(cls); } }); }
Source:
public Integer getNfsVersion(long storeId) throws NumberFormatException { Integer nfsVersion; if (imageStoreDetailsDao.getDetails(storeId) != null){ Map<String, String> storeDetails = imageStoreDetailsDao.getDetails(storeId); if (storeDetails.containsKey(CapacityManager.ImageStoreNFSVersion.key())){ String val = storeDetails.get(CapacityManager.ImageStoreNFSVersion.key()); nfsVersion = (val != null ? Integer.valueOf(val) : null); } else { nfsVersion = getGlobalDefaultNfsVersion(); } } else { nfsVersion = getGlobalDefaultNfsVersion(); } return nfsVersion; }

Target:
public Integer getNfsVersion(long storeId) throws NumberFormatException { final Map<String, String> storeDetails = imageStoreDetailsDao.getDetails(storeId); if (storeDetails != null && storeDetails.containsKey(CapacityManager.ImageStoreNFSVersion.key())) { final String version = storeDetails.get(CapacityManager.ImageStoreNFSVersion.key()); return (version != null ? Integer.valueOf(version) : null); } return getGlobalDefaultNfsVersion(); }
Source:
private DocumentModel createDocumentModelFromTypeName(String typeName, Map<String, Serializable> options) { SchemaManager schemaManager = Framework.getService(SchemaManager.class); DocumentType docType = schemaManager.getDocumentType(typeName); if (docType == null) { throw new IllegalArgumentException(typeName + " is not a registered core type"); } DocumentModel docModel = DocumentModelFactory.createDocumentModel(getSessionId(), docType); if (options == null) { options = new HashMap<>(); } else if (options.containsKey(CoreEventConstants.DESTINATION_NAME)) { docModel.setPathInfo((String) options.get(CoreEventConstants.PARENT_PATH), (String) options.get(CoreEventConstants.DESTINATION_NAME)); } notifyEvent(DocumentEventTypes.EMPTY_DOCUMENTMODEL_CREATED, docModel, options, null, null, false, true); return docModel; }

Target:
private DocumentModel createDocumentModelFromTypeName(String typeName, Map<String, Serializable> options) { SchemaManager schemaManager = Framework.getService(SchemaManager.class); DocumentType docType = schemaManager.getDocumentType(typeName); if (docType == null) { throw new IllegalArgumentException(typeName + " is not a registered core type"); } DocumentModel docModel = DocumentModelFactory.createDocumentModel(getSessionId(), docType); if (options == null) { options = new HashMap<>(); } else if (options.containsKey(CoreEventConstants.PARENT_PATH) && options.containsKey(CoreEventConstants.DESTINATION_NAME)) { docModel.setPathInfo((String) options.get(CoreEventConstants.PARENT_PATH), (String) options.get(CoreEventConstants.DESTINATION_NAME)); } notifyEvent(DocumentEventTypes.EMPTY_DOCUMENTMODEL_CREATED, docModel, options, null, null, false, true); return docModel; }
Source:
public QueryObserver startTrace() { QueryObserver queryObserver = null; if (this.traceOn && this.cache != null) { QueryObserver qo = QueryObserverHolder.getInstance(); if (qo instanceof IndexTrackingQueryObserver) { queryObserver = qo; } else if (!QueryObserverHolder.hasObserver()) { queryObserver = new IndexTrackingQueryObserver(); QueryObserverHolder.setInstance(queryObserver); } else { queryObserver = qo; } this.cache.getLogger().info("Starting query: " + this.queryString); } return queryObserver; }

Target:
public QueryObserver startTrace() { QueryObserver queryObserver = null; if (this.traceOn && this.cache != null) { QueryObserver qo = QueryObserverHolder.getInstance(); if (qo instanceof IndexTrackingQueryObserver) { queryObserver = qo; } else if (!QueryObserverHolder.hasObserver()) { queryObserver = new IndexTrackingQueryObserver(); QueryObserverHolder.setInstance(queryObserver); } else { queryObserver = qo; } logger.info("Starting query: " + this.queryString); } return queryObserver; }
Source:
public void redraw() { composite.pack(true); Composite parent = composite.getParent(); if (parent != null) parent.layout(); }

Target:
public void redraw() { composite.pack(true); Composite parent = composite.getParent(); if (parent != null) parent.requestLayout(); }
Source:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { Codec<DataBucket> codec = BulkCodecs.getDataBucketCodec(); DataBucket in = codec.decode(record.getData()); String commandId = in.getCommandId(); Blob blob = getBlob(in.getDataAsString()); blob = sort(blob, commandId); File blobFile = blob.getFile(); try { BufferedReader br = new BufferedReader(new FileReader(blobFile)); String header = in.getHeaderAsString(); StringBuilder result = StringUtils.isNotEmpty(header) ? new StringBuilder(String.format("%s%n", header)) : new StringBuilder(); String line; while ((line = br.readLine()) != null) { result.append(String.format("%s%n", line)); } String footer = in.getFooterAsString(); if (StringUtils.isNotEmpty(footer)) { result.append(footer); } blobFile.delete(); FileOutputStream fos = new FileOutputStream(blobFile); fos.write(result.toString().getBytes()); fos.flush(); } catch (IOException e) { getLog().error(e, e); } storeBlob(blob, commandId); DataBucket out = new DataBucket(commandId, in.getCount(), getTransientStoreKey(commandId)); context.produceRecord(OUTPUT_1, Record.of(commandId, codec.encode(out))); context.askForCheckpoint(); }

Target:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { Codec<DataBucket> codec = BulkCodecs.getDataBucketCodec(); DataBucket in = codec.decode(record.getData()); String commandId = in.getCommandId(); Blob tmpBlob = getBlob(in.getDataAsString()); tmpBlob = sort(tmpBlob, commandId); Path path = createTemp(commandId); try (InputStream is = tmpBlob.getStream(); FileOutputStream os = new FileOutputStream(path.toFile(), true)) { os.write(in.getHeader()); IOUtils.copy(is, os); os.write(in.getFooter()); os.flush(); tmpBlob.getFile().delete(); } catch (IOException e) { getLog().error(e, e); } storeBlob(new FileBlob(path.toFile()), commandId); DataBucket out = new DataBucket(commandId, in.getCount(), getTransientStoreKey(commandId)); context.produceRecord(OUTPUT_1, Record.of(commandId, codec.encode(out))); context.askForCheckpoint(); }
Source:
public void execute(List<String> resources) { final DefaultInfinispanInsertionStrategy defaultInfinispanInsertionStrategy = new DefaultInfinispanInsertionStrategy(); resources.stream() .map(DataSetLoader::resolve) .forEach((InputStream dataset) -> { try { defaultInfinispanInsertionStrategy.insert(() -> infinispanBasicCache, dataset); } catch (Throwable e) { throw new IllegalStateException(e); } }); }

Target:
public void execute(List<String> resources) { final DefaultInfinispanInsertionStrategy defaultInfinispanInsertionStrategy = new DefaultInfinispanInsertionStrategy(); resources.stream() .map(DataSetLoader::resolve) .forEach((InputStream dataset) -> { try { defaultInfinispanInsertionStrategy.insert(() -> infinispanBasicCache, dataset); } catch (Throwable e) { throw new IllegalStateException(String.format("Error inserting %s resources.", resources), e); } }); }
Source:
protected Control createContents(Composite parent) { getWorkbench().getHelpSystem().setHelp(getControl(), ICDebugHelpContextIds.C_DEBUG_PREFERENCE_PAGE); Composite composite = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); GridData data = new GridData(); data.verticalAlignment = GridData.FILL; data.horizontalAlignment = GridData.FILL; composite.setLayoutData(data); createSpacer(composite, 1); createCharsetSettingPreferences(composite); createSpacer(composite, 1); createBinarySettings(composite); createShowSourceNotFoundEditor(composite); createShowSourceNotFoundAllTime(fButtonGroupForSourceNotFound); setValues(); return composite; }

Target:
protected Control createContents(Composite parent) { getWorkbench().getHelpSystem().setHelp(getControl(), ICDebugHelpContextIds.C_DEBUG_PREFERENCE_PAGE); Composite composite = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); GridData data = new GridData(); data.verticalAlignment = GridData.FILL; data.horizontalAlignment = GridData.FILL; composite.setLayoutData(data); createSpacer(composite, 1); createCharsetSettingPreferences(composite); createSpacer(composite, 1); createBinarySettings(composite); Group fButtonGroupForSourceNotFound = new Group(composite, SWT.SHADOW_ETCHED_IN); createShowSourceNotFoundEditor(fButtonGroupForSourceNotFound); setValues(); return composite; }
Source:
@Override public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (EP_BATCH_HANDLER.equalsIgnoreCase(extensionPoint)) { if (BatchHandlerDescriptor.class.isAssignableFrom(contribution.getClass())) { BatchHandlerDescriptor contributionDescriptor = (BatchHandlerDescriptor) contribution; handlers.remove(contributionDescriptor.getName()); } } }

Target:
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (EP_BATCH_HANDLER.equals(extensionPoint)) { if (BatchHandlerDescriptor.class.isAssignableFrom(contribution.getClass())) { BatchHandlerDescriptor contributionDescriptor = (BatchHandlerDescriptor) contribution; String name = contributionDescriptor.getName(); handlers.remove(name); } } }
Source:
public ClaimsParametersImpl( Principal principal, Set<Principal> roles, Map<String, Object> additionalProperties) { this.principal = principal; this.roles = roles; this.additionalProperties = additionalProperties; }

Target:
public ClaimsParametersImpl( Principal principal, Set<Principal> roles, Map<String, Object> additionalProperties) { this.principal = principal; this.roles = new HashSet<>(roles); this.additionalProperties = new HashMap<>(additionalProperties); }
Source:
public boolean supports(HandlerResult result) { Assert.notNull(result, "'result' must not be null"); Object handler = result.getHandler(); return handler instanceof HandlerMethod && WebFluxInboundEndpoint.class.isAssignableFrom(((HandlerMethod) handler).getBeanType()); }

Target:
public boolean supports(HandlerResult result) { Object handler = result.getHandler(); return handler instanceof HandlerMethod && WebFluxInboundEndpoint.class.isAssignableFrom(((HandlerMethod) handler).getBeanType()); }
Source:
public void updateOrganisation(final MetricOrganisation organisation) { if (organisation == null) { return; } final Company company = Company.find(organisation.id()); company.setName(organisation.name()); try { Company.update(company); } catch (final Exception e) { logger.warn("Error updating an Intercom company: - {}", company, e.getMessage()); } }

Target:
public void updateOrganisation(final MetricOrganisation organisation) { if (organisation == null) { return; } try { final Company company = Company.find(organisation.id()); company.setName(organisation.name()); Company.update(company); } catch (final Exception e) { logger.warn("Error updating an Intercom company: - {}", organisation.id(), e.getMessage()); } }