auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ValidationResult isRunningVmsOrVmLeasesForBackupDomain() { List<String> invalidVmsForBackupStorageDomain = new ArrayList<>(); QueryReturnValue ret = getEntitiesWithLeaseIdForStorageDomain(storageDomain.getId()); if (!ret.getSucceeded()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_RETRIEVE_VMS_FOR_WITH_LEASES); } if (!ret.<List<VmBase>> getReturnValue().isEmpty()) { ret.<List<VmBase>>getReturnValue() .stream() .forEach(vmBase -> invalidVmsForBackupStorageDomain.add(vmBase.getName())); } List<VM> vms = getVmDao().getAllActiveForStorageDomain(storageDomain.getId()); invalidVmsForBackupStorageDomain.addAll(vms.stream() .filter(vm -> vm.getDiskMap() .values() .stream() .filter(DisksFilter.ONLY_IMAGES) .filter(DisksFilter.ONLY_PLUGGED) .map(DiskImage.class::cast) .anyMatch(vmDisk -> vmDisk.getStorageIds().get(0).equals(storageDomain.getId()))) .map(vm -> vm.getName()) .collect(Collectors.toList())); if (!invalidVmsForBackupStorageDomain.isEmpty()) { log.warn("The storage domain could not become backup storage domain since it " + "contains VMs with leases or active disks which are attached to running VMs." + "The following VMs list are: '{}'", invalidVmsForBackupStorageDomain); return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_OR_VM_LEASES_PRESENT_ON_STORAGE_DOMAIN); } return ValidationResult.VALID; }

Target:
public ValidationResult isRunningVmsOrVmLeasesForBackupDomain() { List<String> invalidVmsForBackupStorageDomain = new ArrayList<>(); QueryReturnValue ret = getEntitiesWithLeaseIdForStorageDomain(storageDomain.getId()); if (!ret.getSucceeded()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_RETRIEVE_VMS_FOR_WITH_LEASES); } if (!getRetVal(ret).isEmpty()) { getRetVal(ret).stream().forEach(vmBase -> invalidVmsForBackupStorageDomain.add(vmBase.getName())); } List<VM> vms = getVmDao().getAllActiveForStorageDomain(storageDomain.getId()); invalidVmsForBackupStorageDomain.addAll(vms.stream() .filter(vm -> vm.getDiskMap() .values() .stream() .filter(DisksFilter.ONLY_IMAGES) .filter(DisksFilter.ONLY_PLUGGED) .map(DiskImage.class::cast) .anyMatch(vmDisk -> vmDisk.getStorageIds().get(0).equals(storageDomain.getId()))) .map(vm -> vm.getName()) .collect(Collectors.toList())); if (!invalidVmsForBackupStorageDomain.isEmpty()) { log.warn("Can't update the backup property of the storage domain since it contains VMs with " + "leases or active disks which are attached to running VMs." + "The following VMs list are: '{}'", invalidVmsForBackupStorageDomain); return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_OR_VM_LEASES_PRESENT_ON_STORAGE_DOMAIN); } return ValidationResult.VALID; }
Source:
public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); arFactoryDecorator.setEnabled(true); algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); algoDecorators.add(arFactoryDecorator); }

Target:
public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); arFactoryDecorator.setEnabled(false); algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); algoDecorators.add(arFactoryDecorator); }
Source:
private void loadApns(SQLiteDatabase db, XmlPullParser parser) { if (parser != null) { try { db.beginTransaction(); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { try { XmlUtils.nextElement(parser); } catch (XmlPullParserException e) { Log.e(TAG, "Got parser execption while getting next element", e); continue; } ContentValues row = getRow(parser); if (row == null) { continue; } insertAddingDefaults(db, CARRIERS_TABLE, row); } db.setTransactionSuccessful(); } catch (XmlPullParserException e) { Log.e(TAG, "Got XmlPullParserException while loading apns.", e); } catch (IOException e) { Log.e(TAG, "Got IOException while loading apns.", e); } catch (SQLException e) { Log.e(TAG, "Got SQLException while loading apns.", e); } finally { db.endTransaction(); } } }

Target:
private void loadApns(SQLiteDatabase db, XmlPullParser parser) { if (parser != null) { try { db.beginTransaction(); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { XmlUtils.nextElement(parser); ContentValues row = getRow(parser); if (row == null) { continue; } insertAddingDefaults(db, CARRIERS_TABLE, row); } db.setTransactionSuccessful(); } catch (XmlPullParserException e) { Log.e(TAG, "Got XmlPullParserException while loading apns.", e); } catch (IOException e) { Log.e(TAG, "Got IOException while loading apns.", e); } catch (SQLException e) { Log.e(TAG, "Got SQLException while loading apns.", e); } finally { db.endTransaction(); } } }
Source:
private <R> FusionTask(final String desc, final FusionTask<S, R> predecessor, final PromisePropagator<R, T> propagator) { super(desc); _asyncTask = predecessor._asyncTask; _source = predecessor._source; _predecessor = predecessor.getShallowTraceBuilder(); _propagator = completing(compose(predecessor._propagator, adaptToAcceptTraceContext(propagator))); }

Target:
private <R> FusionTask(final String desc, final FusionTask<S, R> predecessor, final PromisePropagator<R, T> propagator) { super(desc); _asyncTask = predecessor._asyncTask; _predecessorShallowTraceBuilder = predecessor.getShallowTraceBuilder(); _propagator = completing(compose(predecessor._propagator, adaptToAcceptTraceContext(propagator))); }
Source:
public ChildReferences getChildReferences( WorkspaceCache cache, Document document ) { Name primaryType = getPrimaryType(document); NodeTypes nodeTypes = getNodeTypes(cache); boolean isUnorderedCollection = nodeTypes != null && nodeTypes.isUnorderedCollection(primaryType); boolean hasChildren = document.containsField(CHILDREN); boolean hasFederatedSegments = document.containsField(FEDERATED_SEGMENTS); if (!hasChildren && !hasFederatedSegments && !isUnorderedCollection) { return ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } if (isUnorderedCollection) { return document.containsField(PRB) ? new BucketedChildReferences(document, this) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } Set<Name> mixinTypes = getMixinTypes(document); boolean allowsSNS = nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); ChildReferences internalChildRefs = hasChildren ? ImmutableChildReferences.create(this, document, CHILDREN, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferences externalChildRefs = hasFederatedSegments ? ImmutableChildReferences.create(this, document, FEDERATED_SEGMENTS, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferencesInfo info = getChildReferencesInfo(document); if (!hasChildren) { return ImmutableChildReferences.create(externalChildRefs, info, cache, allowsSNS); } else if (!hasFederatedSegments) { return ImmutableChildReferences.create(internalChildRefs, info, cache, allowsSNS); } else { return ImmutableChildReferences.create(internalChildRefs, info, externalChildRefs, cache, allowsSNS); } }

Target:
public ChildReferences getChildReferences( WorkspaceCache cache, Document document ) { Name primaryType = getPrimaryType(document); Set<Name> mixinTypes = getMixinTypes(document); NodeTypes nodeTypes = getNodeTypes(cache); boolean isUnorderedCollection = nodeTypes != null && nodeTypes.isUnorderedCollection(primaryType, mixinTypes); if (isUnorderedCollection) { return new BucketedChildReferences(document, this); } boolean hasChildren = document.containsField(CHILDREN); boolean hasFederatedSegments = document.containsField(FEDERATED_SEGMENTS); if (!hasChildren && !hasFederatedSegments) { return ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } boolean allowsSNS = nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); ChildReferences internalChildRefs = hasChildren ? ImmutableChildReferences.create(this, document, CHILDREN, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferences externalChildRefs = hasFederatedSegments ? ImmutableChildReferences.create(this, document, FEDERATED_SEGMENTS, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferencesInfo info = getChildReferencesInfo(document); if (!hasChildren) { return ImmutableChildReferences.create(externalChildRefs, info, cache, allowsSNS); } else if (!hasFederatedSegments) { return ImmutableChildReferences.create(internalChildRefs, info, cache, allowsSNS); } else { return ImmutableChildReferences.create(internalChildRefs, info, externalChildRefs, cache, allowsSNS); } }
Source:
public AggregateCombiner makeAggregateCombiner() { throw new UOE("[%s] is not supported during ingestion for rollup", getClass().getSimpleName()); }

Target:
public AggregateCombiner makeAggregateCombiner() { return new LongAggregateCombiner() { private long result; @Override public void reset(ColumnValueSelector selector) { result = getTimestamp(selector); } private long getTimestamp(ColumnValueSelector selector) { if (selector instanceof ObjectColumnSelector) { Object input = ((ObjectColumnSelector) selector).get(); return convertLong(timestampSpec, input); } else { return selector.getLong(); } } @Override public void fold(ColumnValueSelector selector) { long other = getTimestamp(selector); if (comparator.compare(result, other) <= 0) { result = other; } } @Override public long getLong() { return result; } }; }
Source:
private boolean isVmDown(VM vm) { return vm != null && vm.getStatus() == VMStatus.Down; }

Target:
private boolean isVmDown(VM vm) { return vm.getStatus() == VMStatus.Down; }
Source:
private void setTabAndViewPagerSynchronisation() { viewPager.setFocusableInTouchMode(true); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { switch (position) { case CONTRIBUTIONS_TAB_POSITION: Timber.d("Contributions tab selected"); tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); isContributionsFragmentVisible = true; ((NearbyParentFragment)contributionsActivityPagerAdapter.getItem(NEARBY_TAB_POSITION)).hideKeyboard(); updateMenuItem(); break; case NEARBY_TAB_POSITION: Timber.d("Nearby tab selected"); tabLayout.getTabAt(NEARBY_TAB_POSITION).select(); isContributionsFragmentVisible = false; updateMenuItem(); NearbyParentFragmentPresenter.getInstance().onTabSelected(); break; default: tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); break; } } @Override public void onPageScrollStateChanged(int state) { } }); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); }

Target:
private void setTabAndViewPagerSynchronisation() { viewPager.setFocusableInTouchMode(true); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { switch (position) { case CONTRIBUTIONS_TAB_POSITION: Timber.d("Contributions tab selected"); tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); isContributionsFragmentVisible = true; ViewUtil.hideKeyboard(tabLayout.getRootView()); updateMenuItem(); break; case NEARBY_TAB_POSITION: Timber.d("Nearby tab selected"); tabLayout.getTabAt(NEARBY_TAB_POSITION).select(); isContributionsFragmentVisible = false; updateMenuItem(); NearbyParentFragmentPresenter.getInstance().onTabSelected(); break; default: tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); break; } } @Override public void onPageScrollStateChanged(int state) { } }); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); }
Source:
private boolean checkQuota() { if (source.overallController.getTotalBufferUsed().get() > source.overallController .getTotalBufferLimit()) { LOG.warn("peer={}, can't read more edits from WAL as buffer usage {}B exceeds limit {}B", this.source.getPeerId(), source.overallController.getTotalBufferUsed().get(), source.overallController.getTotalBufferLimit()); Threads.sleep(sleepForRetries); return false; } return true; }

Target:
private boolean checkQuota() { if (source.controller.getTotalBufferUsed().get() > source.controller .getTotalBufferLimit()) { LOG.warn("peer={}, can't read more edits from WAL as buffer usage {}B exceeds limit {}B", this.source.getPeerId(), source.controller.getTotalBufferUsed().get(), source.controller.getTotalBufferLimit()); Threads.sleep(sleepForRetries); return false; } return true; }
Source:
public SolenoidSet(SolenoidSubsystem system, SolenoidState state, BooleanSupplier... booleanSuppliers) { this.system = system; this.state = state; this.booleanSuppliers = booleanSuppliers; requirements = Set.of((Subsystem) system); }

Target:
public SolenoidSet(SolenoidSubsystem system, SolenoidState state, BooleanSupplier... booleanSuppliers) { this("SolenoidSet", system, state, booleanSuppliers); }
Source:
public TransientStore getTransientStore() { TransientStoreService tss = Framework.getService(TransientStoreService.class); return tss.getStore(StringUtils.isNotBlank(this.storeName) ? storeName : CACHE_NAME); }

Target:
public TransientStore getTransientStore() { TransientStoreService tss = Framework.getService(TransientStoreService.class); return tss.getStore(storeName != null ? storeName : CACHE_NAME); }
Source:
public void updateEntry(@RequestBody EntryDTO entryDTO) { Entry entry = entryService.getEntryById(entryDTO.getId()); entry.updateEntry(entryDTO); if (UserUtil.hasRole(0)) { smtpMailSender.sendToUsers(trainingService.getTrainingById(entry.getTraining().getId()).getParticipants(), "Trainings", emailMessages.modifyEntry(entry)); } else { entry.getTraining().setStatus(TrainingStatus.DRAFTED); trainingService.updateTraining(entry.getTraining()); trainingEventService.addEvent(new TrainingEvent(entryDTO)); List<EventDTO> list = new ArrayList<>(); List<Event> events = new ArrayList<>(); events.addAll(trainingEventService.getUnwatchedEvents()); events.addAll(trainingFeedbackEventService.getUnwatchedEvents()); events.addAll(userFeedbackEventService.getUnwatchedEvents()); for (Event event: events){ list.add(event.toEventDTO()); } for (Map.Entry<DeferredResult<List<EventDTO>>, Integer> mapEntry : EventController.eventRequests.entrySet()) { mapEntry.getKey().setResult(list); } smtpMailSender.sendToUsers(userService.getUsersByRole(UserRole.ADMIN), "Changes in training", entryDTO.getEventDescription()); } }

Target:
public void updateEntry(@RequestBody EntryDTO entryDTO) { Entry entry = entryService.getEntryById(entryDTO.getId()); entry.updateEntry(entryDTO); if (UserUtil.hasRole(0)) { smtpMailSender.sendToUsers(trainingService.getTrainingById(entry.getTraining().getId()).getParticipants(), "Trainings", emailMessages.modifyEntry(entry)); } else { entry.getTraining().setStatus(TrainingStatus.DRAFTED); trainingService.updateTraining(entry.getTraining()); trainingEventService.addEvent(new TrainingEvent(entryDTO)); for (Map.Entry<DeferredResult<List<EventDTO>>, Integer> mapEntry : EventController.eventRequests.entrySet()) { mapEntry.getKey().setResult(getEvents()); } smtpMailSender.sendToUsers(userService.getUsersByRole(UserRole.ADMIN), "Changes in training", entryDTO.getEventDescription()); } }
Source:
public void setHashedPassword(String hashedPassword) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); editor.commit(); }

Target:
public void setHashedPassword(String hashedPassword) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); editor.apply(); }
Source:
protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState scmrs) throws IOException, InterruptedException { if(skipNextPoll) { return PollingResult.NO_CHANGES; } AbstractModeDelegate delegate = AccurevMode.findDelegate(this); return delegate.compareRemoteRevisionWith(project, launcher, workspace, listener, scmrs); }

Target:
protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState scmrs) throws IOException, InterruptedException { if (activeProject == null) { activeProject = project; } else { return PollingResult.NO_CHANGES; } AbstractModeDelegate delegate = AccurevMode.findDelegate(this); return delegate.compareRemoteRevisionWith(project, launcher, workspace, listener, scmrs); }
Source:
public void delete() { final String confirmedName = view.getConfirmedName(); if (!project.getProjectName().equals(confirmedName)) { view.showError(view.getWrongConfirmedNameValidationMessage()); return; } view.showBusyIndicator(view.getDeletingMessage()); projectService.call(v -> { deleteProjectEvent.fire(new DeleteProjectEvent(project)); view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getDeleteSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); libraryPlaces.goToOrganizationalUnits(); }, new HasBusyIndicatorDefaultErrorCallback(view)).delete(project.getPomXMLPath(), PROJECT_DELETED); }

Target:
public void delete() { final String confirmedName = view.getConfirmedName(); if (!project.getMainModule().getModuleName().equals(confirmedName)) { view.showError(view.getWrongConfirmedNameValidationMessage()); return; } view.showBusyIndicator(view.getDeletingMessage()); projectService.call(v -> { view.hideBusyIndicator(); view.hide(); }, new HasBusyIndicatorDefaultErrorCallback(view)).delete(project.getMainModule().getPomXMLPath(), PROJECT_DELETED); }
Source:
protected static void performOnElement(final GoIntroduceOperation operation) { final GoExpression expression = operation.getExpression(); PsiElement statement = PsiTreeUtil.getParentOfType(expression, GoStatement.class); if (statement == null) { showCannotPerform(operation, RefactoringBundle.message("refactoring.introduce.context.error")); return; } LinkedHashSet<String> suggestedNames = getSuggestedNames(expression); operation.setSuggestedNames(suggestedNames); operation.setOccurrences(getOccurrences(expression, PsiTreeUtil.getParentOfType(statement, GoBlock.class))); final Editor editor = operation.getEditor(); if (editor.getSettings().isVariableInplaceRenameEnabled()) { operation.setName(ContainerUtil.getFirstItem(suggestedNames)); if (ApplicationManager.getApplication().isUnitTestMode()) { operation.setReplaceAll(true); performInplaceIntroduce(operation); return; } OccurrencesChooser.simpleChooser(editor) .showChooser(expression, operation.getOccurrences(), new Pass<OccurrencesChooser.ReplaceChoice>() { @Override public void pass(OccurrencesChooser.ReplaceChoice choice) { operation.setReplaceAll(choice == OccurrencesChooser.ReplaceChoice.ALL); performInplaceIntroduce(operation); } }); } }

Target:
protected static void performOnElement(final GoIntroduceOperation operation) { final GoExpression expression = operation.getExpression(); PsiElement statement = PsiTreeUtil.getParentOfType(expression, GoStatement.class); LinkedHashSet<String> suggestedNames = getSuggestedNames(expression); operation.setSuggestedNames(suggestedNames); operation.setOccurrences(getOccurrences(expression, PsiTreeUtil.getTopmostParentOfType(statement, GoBlock.class))); final Editor editor = operation.getEditor(); if (editor.getSettings().isVariableInplaceRenameEnabled()) { operation.setName(ContainerUtil.getFirstItem(suggestedNames)); if (ApplicationManager.getApplication().isUnitTestMode()) { performInplaceIntroduce(operation); return; } OccurrencesChooser.simpleChooser(editor) .showChooser(expression, operation.getOccurrences(), new Pass<OccurrencesChooser.ReplaceChoice>() { @Override public void pass(OccurrencesChooser.ReplaceChoice choice) { operation.setReplaceAll(choice == OccurrencesChooser.ReplaceChoice.ALL); performInplaceIntroduce(operation); } }); } }
Source:
public Collection<CraftingRecipe> getRecipes() { return Collections.unmodifiableList((List<CraftingRecipe>) (List<?>) recipes); }

Target:
public Collection<CraftingRecipe> getRecipes() { return Collections.unmodifiableList((List<CraftingRecipe>) (List<?>) this.recipes); }
Source:
public Boolean squashChangeRequest(final String spaceName, final String repositoryAlias, final Long changeRequestId, final String commitMessage) { final Repository repository = resolveRepository(spaceName, repositoryAlias); final ChangeRequest changeRequest = getChangeRequestById(spaceName, repositoryAlias, false, changeRequestId); final Git git = getGitFromBranch(repository, changeRequest.getSourceBranch()); final String startCommit = changeRequest.getStartCommitId(); git.squash(changeRequest.getSourceBranch(), startCommit, commitMessage); return mergeChangeRequest(spaceName, repositoryAlias, changeRequestId); }

Target:
public Boolean squashChangeRequest(final String spaceName, final String repositoryAlias, final Long changeRequestId, final String commitMessage) { final Repository repository = resolveRepository(spaceName, repositoryAlias); final ChangeRequest changeRequest = getChangeRequestById(spaceName, repositoryAlias, false, changeRequestId); final Git git = getGitFromBranch(repository, changeRequest.getSourceBranch()); final String startCommit = changeRequest.getStartCommitId(); final boolean result = mergeChangeRequest(spaceName, repositoryAlias, changeRequestId); git.squash(changeRequest.getTargetBranch(), startCommit, commitMessage); return result; }
Source:
public void createCheckRunNoAnnotations() throws Exception { GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") .createCheckRun("quick", "4a929d464a2fae7ee899ce603250f7dab304bc4b") .withConclusion(GHCheckRun.Conclusion.NEUTRAL) .withOutput("Quick note", "nothing more to see here") .done() .create(); assertEquals("completed", checkRun.getStatus()); assertEquals(0, checkRun.getOutput().getAnnotationsCount()); assertEquals(538002758, checkRun.id); }

Target:
public void createCheckRunNoAnnotations() throws Exception { GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") .createCheckRun("quick", "4a929d464a2fae7ee899ce603250f7dab304bc4b") .withConclusion(GHCheckRun.Conclusion.NEUTRAL) .add(new GHCheckRunBuilder.Output("Quick note", "nothing more to see here")) .create(); assertEquals("completed", checkRun.getStatus()); assertEquals(0, checkRun.getOutput().getAnnotationsCount()); assertEquals(546384705, checkRun.id); }
Source:
public void topologyVersion() { System.out.println("test with event type: " + testLabel); System.out.println("event = " + evt); System.out.println("topology version = " + topVer); AffinityTopologyVersion topVer = evt instanceof DiscoveryCustomEvent ? null : this.topVer; assertEquals(topVer, sut.topologyVersion()); }

Target:
public void topologyVersion() { LOG.info("test with event type: " + testLabel); LOG.info("event = " + evt); LOG.info("topology version = " + topVer); AffinityTopologyVersion topVer = evt instanceof DiscoveryCustomEvent ? null : this.topVer; assertEquals(topVer, sut.topologyVersion()); }
Source:
protected void updateExternalVnicProfilesPerTargetCluster() { final Map<Cluster, Set<VnicProfileMappingEntity>> result = new HashMap<>(); getEntities().getItems().stream().forEach( importTemplateData -> updateExternalVnicProfilesPerTargetCluster( importTemplateData.getEntity().getInterfaces(), importTemplateData.getCluster().getSelectedItem(), result)); setExternalVnicProfilesPerTargetCluster(result); }

Target:
protected void updateExternalVnicProfilesPerTargetCluster() { final Map<Cluster, Set<VnicProfileMappingEntity>> result = new HashMap<>(); getEntities().getItems().forEach( importTemplateData -> updateExternalVnicProfilesPerTargetCluster( importTemplateData.getEntity().getInterfaces(), importTemplateData.getCluster().getSelectedItem(), result)); setExternalVnicProfilesPerTargetCluster(result); }
Source:
public static Date convertLocalDateToUtc(Date localDate, double localTimeZone) { Calendar localCal = dateToCalendar(localDate); localCal.add(Calendar.MILLISECOND, (int) (60 * 60 * 1000 * (-localTimeZone))); return localCal.getTime(); }

Target:
public static Date convertLocalDateToUtc(Date localDate, double localTimeZone) { Calendar localCal = dateToCalendar(localDate); localCal.add(Calendar.MINUTE, (int) (60 * (-localTimeZone))); return localCal.getTime(); }
Source:
public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps) throws ProjectManagerException { log.info("Uploading files to " + project.getName()); final Map<String, ValidationReport> reports; final Props prop = new Props(this.props); prop.putAll(additionalProps); File file = null; try { file = unzipProject(archive, fileType); reports = validateProject(project, archive, file, prop); final FlowLoader loader = this.flowLoaderFactory.createFlowLoader(file); loader.loadProjectFlow(project, file); final ValidationReport report = generateFlowLoaderReport(project); reports.put(DIRECTORY_FLOW_REPORT_KEY, report); } finally { cleanUpProjectTempDir(file); } if (!isReportStatusValid(reports, project)) { return reports; } persistProject(project, archive, uploader); cleanUpProjectOldInstallations(project); return reports; }

Target:
public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps) throws ProjectManagerException { log.info("Uploading files to " + project.getName()); final Map<String, ValidationReport> reports; final Props prop = new Props(this.props); prop.putAll(additionalProps); File file = null; final FlowLoader loader; try { file = unzipProject(archive, fileType); reports = validateProject(project, archive, file, prop); loader = this.flowLoaderFactory.createFlowLoader(file); reports.put(DIRECTORY_FLOW_REPORT_KEY, loader.loadProjectFlow(project, file)); } finally { cleanUpProjectTempDir(file); } if (!isReportStatusValid(reports, project)) { return reports; } persistProject(project, loader, archive, uploader); cleanUpProjectOldInstallations(project); return reports; }
Source:
private LogicalType determineTimestampSpecLogicalType(Schema schema, String timestampSpecField) { for (Schema.Field field : schema.getFields()) { if (field.name().equals(timestampSpecField)) { this.timestampSpecLogicalType = field.schema().getLogicalType(); return this.timestampSpecLogicalType; } } return null; }

Target:
private LogicalType determineTimestampSpecLogicalType(Schema schema, String timestampSpecField) { for (Schema.Field field : schema.getFields()) { if (field.name().equals(timestampSpecField)) { return field.schema().getLogicalType(); } } return null; }
Source:
public PeriodSegmentGranularity( @JsonProperty("period") Period period, @JsonProperty("origin") DateTime origin, @JsonProperty("timeZone") DateTimeZone tz ) { this.periodGranularity = new PeriodGranularity(period, origin, tz); this.granularityType = GranularityType.estimatedGranularityType(period); }

Target:
public PeriodSegmentGranularity( @JsonProperty("period") Period period, @JsonProperty("origin") DateTime origin, @JsonProperty("timeZone") DateTimeZone tz ) { this.periodGranularity = new PeriodGranularity(period, origin, tz); this.granularityType = GranularityType.fromPeriod(period); }
Source:
public void callPublicMethodWithSeveralFloatParams() { Assert.assertNull(controller.getModel().getFloatValue()); float value1 = 1F; float value2 = 2F; float value3 = 3F; controller.invoke(PUBLIC_WITH_SEVERAL_FLOAT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3)); Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), value1 + value2 + value3); }

Target:
public void callPublicMethodWithSeveralFloatParams() { Assert.assertNull(controller.getModel().getFloatValue()); final float value1 = 1F; final float value2 = 2F; final float value3 = 3F; controller.invoke(PUBLIC_WITH_SEVERAL_FLOAT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3)); Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), value1 + value2 + value3); }
Source:
public void describe(StreamApplicationDescriptor appDescriptor) { EventHubsSystemDescriptor systemDescriptor = new EventHubsSystemDescriptor("eventhubs") .withDefaultStreamOffsetDefault(SystemStreamMetadata.OffsetType.OLDEST); StringSerde serde = new StringSerde(); EventHubsInputDescriptor<KV<String, String>> inputDescriptor = systemDescriptor.getInputDescriptor(INPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_INPUT_ENTITY, serde) .withSasKeyName(EVENTHUBS_SAS_KEY_NAME) .withSasKey(EVENTHUBS_SAS_KEY_TOKEN); EventHubsOutputDescriptor<KV<String, String>> outputDescriptor = systemDescriptor.getOutputDescriptor(OUTPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_OUTPUT_ENTITY, serde) .withSasKeyName(EVENTHUBS_SAS_KEY_NAME) .withSasKey(EVENTHUBS_SAS_KEY_TOKEN); MessageStream<KV<String, String>> eventhubInput = appDescriptor.getInputStream(inputDescriptor); OutputStream<KV<String, String>> eventhubOutput = appDescriptor.getOutputStream(outputDescriptor); eventhubInput .map((message) -> { System.out.println("Sending: "); System.out.println("Received Key: " + message.getKey()); System.out.println("Received Message: " + message.getValue()); return message; }) .sendTo(eventhubOutput); }

Target:
public void describe(StreamApplicationDescriptor appDescriptor) { EventHubsSystemDescriptor systemDescriptor = new EventHubsSystemDescriptor("eventhubs"); StringSerde serde = new StringSerde(); EventHubsInputDescriptor<KV<String, String>> inputDescriptor = systemDescriptor.getInputDescriptor(INPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_INPUT_ENTITY, serde) .withSasKeyName(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_NAME_CONFIG)) .withSasKey(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_TOKEN_CONFIG)); EventHubsOutputDescriptor<KV<String, String>> outputDescriptor = systemDescriptor.getOutputDescriptor(OUTPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_OUTPUT_ENTITY, serde) .withSasKeyName(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_NAME_CONFIG)) .withSasKey(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_TOKEN_CONFIG)); MessageStream<KV<String, String>> eventhubInput = appDescriptor.getInputStream(inputDescriptor); OutputStream<KV<String, String>> eventhubOutput = appDescriptor.getOutputStream(outputDescriptor); eventhubInput .map((message) -> { System.out.println("Sending: "); System.out.println("Received Key: " + message.getKey()); System.out.println("Received Message: " + message.getValue()); return message; }) .sendTo(eventhubOutput); }
Source:
public String createStyledText() { if (!StringUtility.hasText(m_text)) { return ""; } String styledText = m_text; if (htmlPattern.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "html"); } if (bodyPattern.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "body"); } String align = "left"; String valign = "top"; if (m_horizontalAlignment == SwingConstants.HORIZONTAL) { align = "center"; } else if (m_horizontalAlignment == SwingConstants.RIGHT) { align = "right"; } else { align = "left"; } if (m_verticalAlignment == SwingConstants.CENTER) { valign = "middle"; } else if (m_verticalAlignment == SwingConstants.BOTTOM) { valign = "bottom"; } else { valign = "top"; } String wrapText = "normal"; if (!m_textWrap) { wrapText = "nowrap"; } String bodyStyle = ""; if (StringUtility.hasText(ColorUtility.createStringFromColor(m_backgroundColor))) { bodyStyle = "background-color: " + ColorUtility.createStringFromColor(m_backgroundColor) + ";"; } styledText = "<html><body style=\"" + bodyStyle + "\"><div align=\"" + align + "\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"" + valign + "\" height=\"" + m_height + "px\" style=\"white-space:" + wrapText + ";\">" + styledText + "</td></tr></table></div></body></html>"; return styledText; }

Target:
public String createStyledText() { if (!StringUtility.hasText(getText())) { return ""; } String styledText = getText(); if (HTML_PATTERN.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "html"); } if (BODY_PATTERN.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "body"); } String align = "left"; String valign = "top"; if (getHorizontalAlignment() == SwingConstants.HORIZONTAL) { align = "center"; } else if (getHorizontalAlignment() == SwingConstants.RIGHT) { align = "right"; } else { align = "left"; } if (getVerticalAlignment() == SwingConstants.CENTER) { valign = "middle"; } else if (getVerticalAlignment() == SwingConstants.BOTTOM) { valign = "bottom"; } else { valign = "top"; } String wrapText = "normal"; if (!isTextWrap()) { wrapText = "nowrap"; } String bodyStyle = ""; if (StringUtility.hasText(ColorUtility.createStringFromColor(getBackgroundColor()))) { bodyStyle = "background-color: " + ColorUtility.createStringFromColor(getBackgroundColor()) + ";"; } styledText = "<html><body style=\"" + bodyStyle + "\"><div align=\"" + align + "\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"" + valign + "\" height=\"" + getHeight() + "px\" style=\"white-space:" + wrapText + ";\">" + styledText + "</td></tr></table></div></body></html>"; return styledText; }
Source:
public int draw(GC gc, StyledText textWidget, Color color, int x, int y) { String title= getLabel() != null ? getLabel() : "no command"; gc.drawText(title, x, y); return gc.stringExtent(title).x; }

Target:
public Point draw(GC gc, StyledText textWidget, Color color, int x, int y) { String title= getLabel() != null ? getLabel() : "no command"; gc.drawText(title, x, y); return gc.stringExtent(title); }
Source:
public void updateItems(List<FatekPLCItem> items) throws FatekIOException, FatekException { Set<Reg> regsToUpdate = new HashSet<>(); for (FatekPLCItem item : items) { regsToUpdate.addAll(item.getRegs()); } Map<Reg, RegValue> response; synchronized (fatekPLC) { response = new FatekReadMixDataCmd(fatekPLC, regsToUpdate).send(); } for (FatekPLCItem fatekItem : items) { State newState = fatekItem.getState(response); State currentState; Item item; try { item = itemRegistry.getItem(fatekItem.getItemName()); currentState = item.getState(); } catch (ItemNotFoundException e) { logger.warn("", e); currentState = null; item = null; } logger.debug("new state: {}, current state: {}, item: {}", newState, currentState, item); if (!newState.equals(currentState)) { eventPublisher.postUpdate(fatekItem.getItemName(), newState); } } }

Target:
public void updateItems(List<FatekPLCItem> items) throws FatekIOException, FatekException { Set<Reg> regsToUpdate = new HashSet<>(); for (FatekPLCItem item : items) { regsToUpdate.addAll(item.getRegs()); } Map<Reg, RegValue> response; synchronized (fatekPLC) { response = new FatekReadMixDataCmd(fatekPLC, regsToUpdate).send(); } for (FatekPLCItem fatekItem : items) { State newState = fatekItem.getState(response); if (stateCache.isStateChange(fatekItem, newState)) { eventPublisher.postUpdate(fatekItem.getItemName(), newState); } } }
Source:
public String createQuestion(@Valid @ModelAttribute TopicDto topicDto, BindingResult result, Model model, @RequestParam(BRANCH_ID) Long branchId, HttpServletRequest request) throws NotFoundException{ VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); Branch branch = getPluginBranchService().get(branchId); Map<String, Object> data = getDefaultModel(request); topicDto.getTopic().setBranch(branch); if (result.hasErrors()) { data.put(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(topicDto.getTopic())); data.put(TOPIC_DTO, topicDto); data.put(RESULT, result); model.addAttribute(CONTENT, getMergedTemplate(engine, QUESTION_FORM_TEMPLATE_PATH, "UTF-8", data)); return PLUGIN_VIEW_NAME; } topicDto.getTopic().setType(QuestionsAndAnswersPlugin.TOPIC_TYPE); Topic createdQuestion = getTypeAwarePluginTopicService().createTopic(topicDto.getTopic(), topicDto.getBodyText()); return "redirect:" + QuestionsAndAnswersPlugin.CONTEXT + "/" + createdQuestion.getId(); }

Target:
public String createQuestion(@Valid @ModelAttribute TopicDto topicDto, BindingResult result, Model model, @RequestParam(BRANCH_ID) Long branchId, HttpServletRequest request) throws NotFoundException{ VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); Branch branch = getPluginBranchService().get(branchId); Map<String, Object> data = getDefaultModel(request); topicDto.getTopic().setBranch(branch); if (result.hasErrors()) { data.put(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(branch)); data.put(TOPIC_DTO, topicDto); data.put(RESULT, result); model.addAttribute(CONTENT, getMergedTemplate(engine, QUESTION_FORM_TEMPLATE_PATH, "UTF-8", data)); return PLUGIN_VIEW_NAME; } topicDto.getTopic().setType(QuestionsAndAnswersPlugin.TOPIC_TYPE); Topic createdQuestion = getTypeAwarePluginTopicService().createTopic(topicDto.getTopic(), topicDto.getBodyText()); return "redirect:" + QuestionsAndAnswersPlugin.CONTEXT + "/" + createdQuestion.getId(); }
Source:
private RequestFuture<ByteBuffer> onJoinLeader(JoinGroupResponse joinResponse) { try { Map<String, ByteBuffer> groupAssignment = performAssignment(joinResponse.data().leader(), joinResponse.data().protocolName(), joinResponse.data().members()); List<SyncGroupRequestData.SyncGroupRequestAssignment> groupAssignmentList = new ArrayList<>(); for (Map.Entry<String, ByteBuffer> assignment : groupAssignment.entrySet()) { groupAssignmentList.add(new SyncGroupRequestData.SyncGroupRequestAssignment() .setMemberId(assignment.getKey()) .setAssignment(assignment.getValue().array()) ); } SyncGroupRequest.Builder requestBuilder = new SyncGroupRequest.Builder( new SyncGroupRequestData() .setGroupId(groupId) .setMemberId(generation.memberId) .setGenerationId(generation.generationId) .setAssignments(groupAssignmentList) ); log.debug("Sending leader SyncGroup to coordinator {}: {}", this.coordinator, requestBuilder); return sendSyncGroupRequest(requestBuilder); } catch (RuntimeException e) { return RequestFuture.failure(e); } }

Target:
private RequestFuture<ByteBuffer> onJoinLeader(JoinGroupResponse joinResponse) { try { Map<String, ByteBuffer> groupAssignment = performAssignment(joinResponse.data().leader(), joinResponse.data().protocolName(), joinResponse.data().members()); List<SyncGroupRequestData.SyncGroupRequestAssignment> groupAssignmentList = new ArrayList<>(); for (Map.Entry<String, ByteBuffer> assignment : groupAssignment.entrySet()) { groupAssignmentList.add(new SyncGroupRequestData.SyncGroupRequestAssignment() .setMemberId(assignment.getKey()) .setAssignment(Utils.toArray(assignment.getValue())) ); } SyncGroupRequest.Builder requestBuilder = new SyncGroupRequest.Builder( new SyncGroupRequestData() .setGroupId(groupId) .setMemberId(generation.memberId) .setGenerationId(generation.generationId) .setAssignments(groupAssignmentList) ); log.debug("Sending leader SyncGroup to coordinator {}: {}", this.coordinator, requestBuilder); return sendSyncGroupRequest(requestBuilder); } catch (RuntimeException e) { return RequestFuture.failure(e); } }
Source:
public Level getAntLogLevel() { Class<?> clazz; int maxLevel = Project.MSG_ERR; for (final BuildListener l : project.getBuildListeners()) { clazz = l.getClass(); Field declaredField = null; try { while (BuildListener.class.isAssignableFrom(clazz)) { try { declaredField = l.getClass().getDeclaredField("msgOutputLevel"); } catch (final NoSuchFieldException ignored) { try { declaredField = l.getClass().getDeclaredField("logLevel"); } catch (final NoSuchFieldException expected) { } } if (declaredField != null) { break; } clazz = clazz.getSuperclass(); } if (declaredField != null) { declaredField.setAccessible(true); final int level = declaredField.getInt(l); if (maxLevel < level) { maxLevel = level; } } } catch (final IllegalArgumentException | IllegalAccessException ignored) { } } return LOG_LEVELS[maxLevel]; }

Target:
public Level getAntLogLevel() { for (final BuildListener l : project.getBuildListeners()) { Field declaredField = null; try { if (l instanceof DefaultLogger) { declaredField = DefaultLogger.class.getDeclaredField("msgOutputLevel"); } else if (l instanceof XmlLogger) { declaredField = XmlLogger.class.getDeclaredField("msgOutputLevel"); } else if (l instanceof RecorderEntry) { declaredField = RecorderEntry.class.getDeclaredField("loglevel"); } else { try { declaredField = l.getClass().getDeclaredField("logLevel"); } catch (final NoSuchFieldException e) { project.log("Unsupported build listener: " + l.getClass(), Project.MSG_WARN); } } if (declaredField != null) { declaredField.setAccessible(true); return LOG_LEVELS[declaredField.getInt(l)]; } } catch (final NoSuchFieldException | IllegalArgumentException | IllegalAccessException ignored) { } } return Level.FINEST; }
Source:
private void handlePing(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { log.info("handlePing[{}]: Ping message received from {}", req.getHeader().getRequestId(), req.getHeader().getClientId().getMsb(), req.getHeader().getClientId().getLsb()); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getPingResponseMsg()); r.sendResponse(response, ctx); }

Target:
public void handlePing(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { log.trace("handlePing[{}]: Ping message received from {}", req.getHeader().getRequestId(), req.getHeader().getClientId().getMsb(), req.getHeader().getClientId().getLsb()); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getPingResponseMsg()); r.sendResponse(response, ctx); }
Source:
public String toString() { return "ControlFlowEvent start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " value=" + fValue; }

Target:
public String toString() { return getClass().getSimpleName() + " start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " value=" + fValue; }
Source:
public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException { try { injectionContainer.newInstance(instance); } catch (Exception e) { throw new InjectionProviderException(e); } }

Target:
public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException { if (injectionContainer != null) { try { injectionContainer.newInstance(instance); } catch (Exception e) { throw new InjectionProviderException(e); } } }
Source:
private String search(SearchRequest searchRequest, Model model, HttpServletRequest request) { SearchResultResponse resultResponse = doSearch(searchRequest, model, request); String queryText = formatQueryText(request); model.addAttribute("resultType", "searchResults"); model.addAttribute("pageSubtitle", "Search results for <span class=\"query-request\">\"" + queryText + "\"</span>"); return "searchResults"; }

Target:
private String search(SearchRequest searchRequest, Model model, HttpServletRequest request) { SearchResultResponse resultResponse = doSearch(searchRequest, model, request); String queryText = formatQueryText(request); model.addAttribute("resultType", "searchResults"); model.addAttribute("pageSubtitle", queryText); return "searchResults"; }
Source:
public IQueryBackend create(IQueryBackendContext context) { return new LocalSearchBackend(context) { @Override protected AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints) throws QueryProcessingException { return new GenericLocalSearchResultProvider(this, context, query, planProvider, hints); } }; }

Target:
public IQueryBackend create(IQueryBackendContext context) { return new LocalSearchBackend(context) { @Override protected AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints) throws QueryProcessingException { return new GenericLocalSearchResultProvider(this, context, query, planProvider, hints); } @Override public Table<EDataType, EClass, Set<EAttribute>> geteAttributesByTypeForEClass() { throw new UnsupportedOperationException("geteAttributesByTypeForEClass() is a legacy call not supported by the generic LS backend."); } }; }
Source:
public static Response buildChangePasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException { UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager(); ResponsePayload responsePayload = new ResponsePayload(); try { byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword()); byte[] decodedOldPassword = Base64.decodeBase64(credentials.getOldPassword()); userStoreManager.updateCredential(credentials.getUsername(), new String( decodedNewPassword, "UTF-8"), new String(decodedOldPassword, "UTF-8")); responsePayload.setStatusCode(HttpStatus.SC_CREATED); responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() + " was successfully changed."); return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build(); } catch (UserStoreException e) { String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername(); log.error(errorMsg, e); responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer("Old password does not match."); return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build(); } catch (UnsupportedEncodingException e) { String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername(); log.error(errorMsg, e); throw new MDMAPIException(errorMsg, e); } }

Target:
public static Response buildChangePasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException { UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager(); ResponsePayload responsePayload = new ResponsePayload(); try { byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword()); byte[] decodedOldPassword = Base64.decodeBase64(credentials.getOldPassword()); userStoreManager.updateCredential(credentials.getUsername(), new String( decodedNewPassword, "UTF-8"), new String(decodedOldPassword, "UTF-8")); responsePayload.setStatusCode(HttpStatus.SC_CREATED); responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() + " was successfully changed."); return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build(); } catch (UserStoreException e) { log.error(e.getMessage(), e); responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer("Old password does not match."); return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build(); } catch (UnsupportedEncodingException e) { String errorMsg = "Could not change the password of the user: " + credentials.getUsername() + ". The Character Encoding is not supported."; log.error(errorMsg, e); throw new MDMAPIException(errorMsg, e); } }
Source:
protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (duration == 0) { return; } listener.onVideoDetached(duration); }

Target:
protected void onDetachedFromWindow() { super.onDetachedFromWindow(); listener.onVideoDetached(duration); }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); if(!sconfig.isAsync.equalsIgnoreCase("true") && !sconfig.isAsync.equalsIgnoreCase("false")) { throw new IllegalArgumentException("Async flag has to be either TRUE or FALSE."); } }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); isAsync = Boolean.parseBoolean(producerConfig.async); if (!producerConfig.async.equalsIgnoreCase("true") && !producerConfig.async.equalsIgnoreCase("false")) { throw new IllegalArgumentException("Async flag has to be either TRUE or FALSE."); } }