auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<Serializable> query, QueryParameters queryParameters, TupleContext tupleContext) { List<String> queryHints = queryParameters.getQueryHints(); if ( queryHints.isEmpty() ) { throw new HibernateException( "The query must have a hints!" ); } else { if ( !queryHints.contains( DIALECT_SPECIFIED_HINT ) ) { throw new HibernateException( "The query not contains required hint! The query must contains hint \"" + DIALECT_SPECIFIED_HINT + "\"!" ); } } Tuple tuple = new Tuple(); tuple.put( "id", UUID.randomUUID().toString() ); tuple.put( "frequency", 1.0d ); return CollectionHelper.newClosableIterator( Collections.singletonList( tuple ) ); }

Target:
public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<Serializable> query, QueryParameters queryParameters, TupleContext tupleContext) { List<String> queryHints = queryParameters.getQueryHints(); if ( queryHints.isEmpty() ) { throw new HibernateException( "The query must have at least one hint!" ); } else { if ( !queryHints.contains( DIALECT_SPECIFIED_HINT ) ) { throw new HibernateException( "The query does not contain the required hint \"" + DIALECT_SPECIFIED_HINT + "\"!" ); } } Tuple tuple = new Tuple(); tuple.put( "id", UUID.randomUUID().toString() ); tuple.put( "frequency", 1.0d ); return CollectionHelper.newClosableIterator( Collections.singletonList( tuple ) ); }
Source:
public Set<String> getFreeVariables() { Set<String> freeVars = body.getFreeVariables(); freeVars.remove(this.getName()); for (FormalArg farg : formalArgs) { freeVars.remove(farg.getName()); } return freeVars; }

Target:
public Set<String> getFreeVariables() { Set<String> freeVars = body.getFreeVariables(); for (FormalArg farg : formalArgs) { freeVars.remove(farg.getName()); } return freeVars; }
Source:
private void testAutoCompleteUpstreamProjectName( String expectedValues, String value, AbstractProject project, DownstreamBuildSelector.DescriptorImpl d) { assertArrayEquals(expectedValues, d.doAutoCompleteUpstreamProjectName(value, project).getValues().toArray()); assertArrayEquals(expectedValues, d.doAutoCompleteUpstreamProjectName(value, null).getValues().toArray()); }

Target:
private void testAutoCompleteUpstreamProjectName( String expectedValues, String value, AbstractProject project, DownstreamBuildSelector.DescriptorImpl d) { Set<String> actualValues = new TreeSet<String>(d.doAutoCompleteUpstreamProjectName(value, project).getValues()); assertArrayEquals(expectedValues, actualValues.toArray(new String [actualValues.size()])); actualValues = new TreeSet<String>(d.doAutoCompleteUpstreamProjectName(value, null).getValues()); assertArrayEquals(new String[] {}, actualValues.toArray(new String [actualValues.size()])); }
Source:
private void verifyStringParameterQueryInvocations() { Map<String, String> stringQueryParameters = getCompleteStringQueryParameters(); verify(mockedQuery).activityInstanceId(stringQueryParameters.get("activityInstanceId")); verify(mockedQuery).processInstanceId(stringQueryParameters.get("processInstanceId")); verify(mockedQuery).processDefinitionId(stringQueryParameters.get("processDefinitionId")); verify(mockedQuery).executionId(stringQueryParameters.get("executionId")); verify(mockedQuery).activityId(stringQueryParameters.get("activityId")); verify(mockedQuery).activityName(stringQueryParameters.get("activityName")); verify(mockedQuery).activityName(stringQueryParameters.get("activityNameLike")); verify(mockedQuery).activityType(stringQueryParameters.get("activityType")); verify(mockedQuery).taskAssignee(stringQueryParameters.get("taskAssignee")); verify(mockedQuery).list(); }

Target:
private void verifyStringParameterQueryInvocations() { Map<String, String> stringQueryParameters = getCompleteStringQueryParameters(); verify(mockedQuery).activityInstanceId(stringQueryParameters.get("activityInstanceId")); verify(mockedQuery).processInstanceId(stringQueryParameters.get("processInstanceId")); verify(mockedQuery).processDefinitionId(stringQueryParameters.get("processDefinitionId")); verify(mockedQuery).executionId(stringQueryParameters.get("executionId")); verify(mockedQuery).activityId(stringQueryParameters.get("activityId")); verify(mockedQuery).activityName(stringQueryParameters.get("activityName")); verify(mockedQuery).activityNameLike(stringQueryParameters.get("activityNameLike")); verify(mockedQuery).activityType(stringQueryParameters.get("activityType")); verify(mockedQuery).taskAssignee(stringQueryParameters.get("taskAssignee")); verify(mockedQuery).list(); }
Source:
private void recvWants() throws IOException { boolean isFirst = true; for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (isFirst) break; throw eof; } if (line == PacketLineIn.END) break; if (line.startsWith("deepen ")) { depth = Integer.parseInt(line.substring(7)); if (depth <= 0) { throw new PackProtocolException( MessageFormat.format(JGitText.get().invalidDepth, Integer.valueOf(depth))); } continue; } if (line.startsWith("shallow ")) { clientShallowCommits.add(ObjectId.fromString(line.substring(8))); continue; } if (line.startsWith(OPTION_BLOB_MAX_BYTES + " ")) { blobMaxBytes = Long.parseLong(line.substring(OPTION_BLOB_MAX_BYTES.length() + 1)); continue; } if (!line.startsWith("want ") || line.length() < 45) throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedGot, "want", line)); if (isFirst) { if (line.length() > 45) { FirstLine firstLine = new FirstLine(line); options = firstLine.getOptions(); line = firstLine.getLine(); } else options = Collections.emptySet(); } wantIds.add(ObjectId.fromString(line.substring(5))); isFirst = false; } }

Target:
private void recvWants() throws IOException { boolean isFirst = true; for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (isFirst) break; throw eof; } if (line == PacketLineIn.END) break; if (line.startsWith("deepen ")) { depth = Integer.parseInt(line.substring(7)); if (depth <= 0) { throw new PackProtocolException( MessageFormat.format(JGitText.get().invalidDepth, Integer.valueOf(depth))); } continue; } if (line.startsWith("shallow ")) { clientShallowCommits.add(ObjectId.fromString(line.substring(8))); continue; } if (line.startsWith(OPTION_BLOB_MAX_BYTES + " ")) { String arg = line.substring(OPTION_BLOB_MAX_BYTES.length() + 1); try { blobMaxBytes = Long.parseLong(arg); } catch (NumberFormatException e) { throw new PackProtocolException( MessageFormat.format(JGitText.get().invalidBlobMaxBytes, arg)); } if (blobMaxBytes < 0) { throw new PackProtocolException( MessageFormat.format(JGitText.get().invalidBlobMaxBytes, arg)); } continue; } if (!line.startsWith("want ") || line.length() < 45) throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedGot, "want", line)); if (isFirst) { if (line.length() > 45) { FirstLine firstLine = new FirstLine(line); options = firstLine.getOptions(); line = firstLine.getLine(); } else options = Collections.emptySet(); } wantIds.add(ObjectId.fromString(line.substring(5))); isFirst = false; } }
Source:
public String getCurrentTaskTitles(ProcessDTO processDTO) { try { return ServiceManager.getProcessService().createProgressTooltip(processDTO); } catch (DAOException e) { Helper.setErrorMessage("Unable to retrieve process with process ID " + processDTO.getId()); return ""; } }

Target:
public String getCurrentTaskTitles(ProcessDTO processDTO) { try { return ServiceManager.getProcessService().createProgressTooltip(processDTO); } catch (DAOException e) { Helper.setErrorMessage(ERROR_LOADING_ONE, new Object[] {ObjectType.PROCESS.getTranslationSingular(), processDTO.getId()}); return ""; } }
Source:
public ValidationResult notManagementNetwork() { String managementNetwork = Config.<String> GetValue(ConfigValues.ManagementNetwork); return managementNetwork.equalsIgnoreCase(network.getName()) ? new ValidationResult(VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK) : ValidationResult.VALID; }

Target:
public ValidationResult notManagementNetwork() { return NetworkUtils.isManagementNetwork(network) ? new ValidationResult(VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK) : ValidationResult.VALID; }
Source:
private boolean needsClosing(Type type) { if (type.isSubtypeOf(STREAM_TOP_HIERARCHY)) { return false; } for (String ignoredTypes : IGNORED_CLOSEABLE_SUBTYPES) { if (type.isSubtypeOf(ignoredTypes)) { return false; } } for (String excludedType : excludedTypesList) { if (type.is(excludedType)) { return false; } } return isCloseable(type); }

Target:
private boolean needsClosing(Type type) { if (type.isSubtypeOf(STREAM_TOP_HIERARCHY)) { return false; } for (String ignoredTypes : IGNORED_CLOSEABLE_SUBTYPES) { if (type.isSubtypeOf(ignoredTypes)) { return false; } } for (String excludedType : loadExcludedTypesList()) { if (type.is(excludedType)) { return false; } } return isCloseable(type); }
Source:
public List<StudyEntryDto> createStudyEntries(final Integer studyId, final Integer germplasmListId) { final GermplasmList germplasmList = this.germplasmListService.getGermplasmList(germplasmListId); this.germplasmListValidator.validateGermplasmList(germplasmListId); this.studyEntryValidator.validateStudyAlreadyHasStudyEntries(studyId); this.studyValidator.validate(studyId, true); final ModelMapper mapper = StudyEntryMapper.getInstance(); final List<StudyEntryDto> studyEntryDtoList = germplasmList.getListData().stream().map(l -> mapper.map(l, StudyEntryDto.class)).collect(Collectors.toList()); final Map<Integer, GermplasmListData> germplasmListDataMap = germplasmList.getListData().stream().collect(Collectors.toMap(GermplasmListData::getGermplasmId, g -> g, (g1, g2) -> g1)); final List<Integer> germplasmDescriptorIds = this.getEntryDescriptorColumns(studyId).stream() .map(measurementVariable -> measurementVariable.getTermId()).collect(Collectors.toList()); for(final StudyEntryDto studyEntryDto: studyEntryDtoList) { studyEntryDto.setProperties( StudyEntryPropertiesMapper.map(germplasmListDataMap.get(studyEntryDto.getGid()), germplasmDescriptorIds)); } return this.middlewareStudyEntryService.saveStudyEntries(studyId, studyEntryDtoList); }

Target:
public List<StudyEntryDto> createStudyEntries(final Integer studyId, final Integer germplasmListId) { final GermplasmList germplasmList = this.germplasmListService.getGermplasmList(germplasmListId); this.germplasmListValidator.validateGermplasmList(germplasmListId); this.studyEntryValidator.validateStudyAlreadyHasStudyEntries(studyId); this.studyValidator.validate(studyId, true); final ModelMapper mapper = StudyEntryMapper.getInstance(); final List<StudyEntryDto> studyEntryDtoList = germplasmList.getListData().stream().map(l -> mapper.map(l, StudyEntryDto.class)).collect(Collectors.toList()); final Map<Integer, GermplasmListData> germplasmListDataMap = germplasmList.getListData().stream().collect(Collectors.toMap(GermplasmListData::getEntryId, g -> g)); final List<Integer> germplasmDescriptorIds = this.getEntryDescriptorColumns(studyId).stream() .map(measurementVariable -> measurementVariable.getTermId()).collect(Collectors.toList()); for(final StudyEntryDto studyEntryDto: studyEntryDtoList) { studyEntryDto.setProperties( StudyEntryPropertiesMapper.map(germplasmListDataMap.get(studyEntryDto.getEntryId()), germplasmDescriptorIds)); } return this.middlewareStudyEntryService.saveStudyEntries(studyId, studyEntryDtoList); }
Source:
public TradeOffer.Builder secondBuyingItem(final ItemStack item) { Preconditions.checkNotNull(item, "Second buying item cannot be null"); this.secondItem = item.createSnapshot(); return this; }

Target:
public TradeOffer.Builder secondBuyingItem(final ItemStack item) { this.secondItem = item != null ? item.createSnapshot() : ItemStackSnapshot.empty(); return this; }
Source:
CloseDriverCommand(WebDriver webDriver, SelenideProxyServer selenideProxyServer) { this.webDriver = webDriver; this.selenideProxyServer = selenideProxyServer; this.closeBrowserTimeoutMs = 5000; }

Target:
CloseDriverCommand(WebDriver webDriver, SelenideProxyServer selenideProxyServer) { this.webDriver = webDriver; this.selenideProxyServer = selenideProxyServer; }
Source:
private AddBacklogMessage getAddBacklogMessage() { int backlog = subpartitionView.getAndResetUnannouncedBacklog(); if (backlog > 0) { return new AddBacklogMessage(receiverId, backlog, false); } return null; }

Target:
private AddBacklogMessage getAddBacklogMessage() { int backlog = subpartitionView.getAndResetUnannouncedBacklog(); if (backlog > 0) { return new AddBacklogMessage(receiverId, backlog); } return null; }
Source:
public void checkMainTools() { int sectionInsertTools = 17; for (int i = 1; i < sectionInsertTools; i++) { clearSource(); clickMore(); String content = driver.findElement( By.xpath(" .getText(); driver.findElement( By.xpath(" .click(); waitForElementNotVisibleByElement(editorModal); waitForElementNotVisibleByElement(focusedMode); checkSourceContent(content); } }

Target:
public void checkMainTools() { int wikitextShortcutsInsertSection = 17; for (int i = 1; i < wikitextShortcutsInsertSection; i++) { clearSource(); clickMore(); String content = driver.findElement( By.xpath(" .getText(); driver.findElement( By.xpath(" .click(); waitForElementNotVisibleByElement(editorModal); waitForElementNotVisibleByElement(focusedMode); checkSourceContent(content); } }
Source:
public boolean equals(Object obj) { if(obj instanceof EnumValue) { return enumIdentifier.equals(((EnumValue) obj).enumIdentifier); } return getValue().equals(obj); }

Target:
public boolean equals(Object obj) { if(obj instanceof EnumValue) { EnumValue otherEnum = (EnumValue) obj; if(type.equals(otherEnum.type) && identifier.equals(otherEnum.identifier)) { return true; } } return getValue().equals(obj); }
Source:
public File build() { File tmpFile = serializeRateMeterDefinitions(); File configFile = new File("/tmp/ratemeters.json"); try { deleteFileIfExists(configFile); renameFile(tmpFile, configFile); } catch (IOException ex) { throw new IllegalStateException(format("Could not create config file %s.", configFile.getAbsolutePath()), ex); } return configFile; }

Target:
public File build() { File tmpFile = serializeRateMeterDefinitions(); File configFile = Paths.get(getProperty("java.io.tmpdir"), "ratemeters.json").toFile(); try { deleteFileIfExists(configFile); renameFile(tmpFile, configFile); } catch (IOException ex) { throw new IllegalStateException(format("Could not create config file %s.", configFile.getAbsolutePath()), ex); } return configFile; }
Source:
public SortedSet<String> getDependenciesAndSelf() { List<String> affectedCodeSystems = CoreTerminologyBroker.getInstance().getAffectedCodeSystemsForTeminology(terminologyComponentId); affectedCodeSystems.add(shortName); return new TreeSet<String>(affectedCodeSystems); }

Target:
public SortedSet<String> getDependenciesAndSelf() { ImmutableSortedSet.Builder<String> affectedCodeSystems = ImmutableSortedSet.naturalOrder(); affectedCodeSystems.addAll(CoreTerminologyBroker.getInstance().getAffectedCodeSystemsForTeminology(terminologyComponentId)); affectedCodeSystems.add(shortName); return affectedCodeSystems.build(); }
Source:
public static String getFirstSelectedChineseVariant() { if (FIRST_SELECTED_ZH_LANG_CODE == null) { for (String langCode : WikipediaApp.getInstance().language().getAppLanguageCodes()) { if (langCode.startsWith(AppLanguageLookUpTable.CHINESE_LANGUAGE_CODE)) { FIRST_SELECTED_ZH_LANG_CODE = langCode; break; } } FIRST_SELECTED_ZH_LANG_CODE = StringUtils.defaultString(FIRST_SELECTED_ZH_LANG_CODE, AppLanguageLookUpTable.TRADITIONAL_CHINESE_LANGUAGE_CODE); } return FIRST_SELECTED_ZH_LANG_CODE; }

Target:
public static String getFirstSelectedChineseVariant() { String firstSelectedChineseLangCode = null; for (String langCode : WikipediaApp.getInstance().language().getAppLanguageCodes()) { if (langCode.startsWith(AppLanguageLookUpTable.CHINESE_LANGUAGE_CODE)) { firstSelectedChineseLangCode = langCode; break; } } return StringUtils.defaultString(firstSelectedChineseLangCode, AppLanguageLookUpTable.TRADITIONAL_CHINESE_LANGUAGE_CODE); }
Source:
public static String setFeedACL(String feed, String... ownerGroup) { FeedMerlin feedObject = null; try { feedObject = new FeedMerlin(feed); } catch (JAXBException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } ACL acl = feedObject.getACL(); if(ownerGroup.length > 0) { aclOwner = ownerGroup[0]; if (ownerGroup.length == 2) aclGroup = ownerGroup[1]; } acl.setOwner(aclOwner); acl.setGroup(aclGroup); feedObject.setACL(acl); return feedObject.toString(); }

Target:
public static String setFeedACL(String feed, String... ownerGroup) { FeedMerlin feedObject = null; try { feedObject = new FeedMerlin(feed); } catch (JAXBException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } ACL acl = feedObject.getACL(); acl.setOwner(MerlinConstants.aclOwner); acl.setGroup(MerlinConstants.aclGroup); if(ownerGroup.length > 0) { acl.setOwner(ownerGroup[0]); if (ownerGroup.length == 2) acl.setGroup(ownerGroup[1]); } feedObject.setACL(acl); return feedObject.toString(); }
Source:
public void convertGroupsToRichGroupsWithAttributesWithListOfNamesTest() throws Exception { System.out.println("groupsManagerBl.convertGroupsToRichGroupsWithAttributes"); vo = setUpVo(); attributesList = setUpGroupAttributes(); this.groupsManager.createGroup(sess, vo, group); attributesManager.setAttributes(sess, group, attributesList); this.groupsManager.createGroup(sess, vo, group2); attributesManager.setAttributes(sess, group2, attributesList); List<String> attrNames = new ArrayList<>(); RichGroup richGroup1 = new RichGroup(group, attributesList); RichGroup richGroup2 = new RichGroup(group2, attributesList); for (Attribute a : attributesList) { attrNames.add(a.getName()); } assertEquals("Both lists should be same", Arrays.asList(richGroup1, richGroup2), groupsManagerBl.convertGroupsToRichGroupsWithAttributes(sess, Arrays.asList(group, group2), attrNames)); }

Target:
public void convertGroupsToRichGroupsWithAttributesWithListOfNamesTest() throws Exception { System.out.println("groupsManagerBl.convertGroupsToRichGroupsWithAttributesWithListOfNamesTest"); vo = setUpVo(); attributesList = setUpGroupAttributes(); this.groupsManager.createGroup(sess, vo, group); attributesManager.setAttributes(sess, group, attributesList); this.groupsManager.createGroup(sess, vo, group2); attributesManager.setAttributes(sess, group2, attributesList); List<String> attrNames = new ArrayList<>(); RichGroup richGroup1 = new RichGroup(group, attributesList); RichGroup richGroup2 = new RichGroup(group2, attributesList); for (Attribute a : attributesList) { attrNames.add(a.getName()); } assertEquals("Both lists should be same", Arrays.asList(richGroup1, richGroup2), groupsManagerBl.convertGroupsToRichGroupsWithAttributes(sess, Arrays.asList(group, group2), attrNames)); }
Source:
private List<VariantEntity> findByComplexFiltersHelper(Query query, List<VariantEntityRepositoryFilter> filters, List<String> exclude, Pageable pageable) { if (filters.size() > 0){ List<Criteria> criteriaList = getFiltersCriteria(filters); for (Criteria criteria : criteriaList) { query.addCriteria(criteria); } } ArrayList<String> sortProperties = new ArrayList<String>(); sortProperties.add("chr"); sortProperties.add("start"); query.with(new Sort(Sort.Direction.ASC, sortProperties)); Pageable pageable1 = (pageable != null) ? pageable : new PageRequest(0, 10); query.with(pageable1); if (exclude != null && !exclude.isEmpty()) { exclude.forEach(e -> query.fields().exclude(e)); } return mongoTemplate.find(query, VariantEntity.class); }

Target:
private List<VariantEntity> findByComplexFiltersHelper(Query query, List<VariantEntityRepositoryFilter> filters, List<String> exclude, Pageable pageable) { addFilterCriteriaToQuery(query, filters); ArrayList<String> sortProperties = new ArrayList<String>(); sortProperties.add("chr"); sortProperties.add("start"); query.with(new Sort(Sort.Direction.ASC, sortProperties)); Pageable pageable1 = (pageable != null) ? pageable : new PageRequest(0, 10); query.with(pageable1); if (exclude != null && !exclude.isEmpty()) { exclude.forEach(e -> query.fields().exclude(e)); } return mongoTemplate.find(query, VariantEntity.class); }
Source:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); boolean succeeded = true; boolean hasAsyncTasks = false; if (getImagesList().size() > 0) { for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); VdcReturnValueBase returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); if (!returnValue.getSucceeded()) { succeeded = false; getReturnValue().setFault(returnValue.getFault()); } } } hasAsyncTasks = !getTaskIdList().isEmpty(); } removeSnapshotsFromDB(); if (hasAsyncTasks) { deleteOrphanedImages(); } else { EndVmCommand(); } setSucceeded(succeeded); }

Target:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); boolean succeeded = true; boolean hasAsyncTasks = false; if (getImagesList().size() > 0) { for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); VdcReturnValueBase returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); if (!returnValue.getSucceeded()) { succeeded = false; getReturnValue().setFault(returnValue.getFault()); } } } hasAsyncTasks = !getTaskIdList().isEmpty(); } removeSnapshotsFromDB(); if (hasAsyncTasks) { deleteOrphanedImages(); } else { endActionOnVmConfiguration(); } setSucceeded(succeeded); }
Source:
private void initDBMaps(boolean firstAttempt) { close(); try { recordManager = createRecordManager(storeFile.getCanonicalPath()); persistedJobsLicenses = recordManager.hashMap(JOBS_LICENSES); persistedTasksLicenses = recordManager.hashMap(TASKS_LICENSES); remainingTokens = recordManager.hashMap(REMAINING_TOKENS); recordManager.commit(); if (!firstAttempt) { logger.info("Loading of job database successful after clean."); } } catch (Throwable e) { if (firstAttempt) { logger.error("Error occurred when loading the database " + storeFile.getAbsolutePath() + ", now cleaning it and retrying.", e); cleanDataBase(); initDBMaps(false); } else { close(); throw new IllegalStateException("Error when loading database (even after cleaning it): " + storeFile.getAbsolutePath(), e); } } }

Target:
private void initDBMaps(boolean firstAttempt) { close(); try { recordManager = createRecordManager(storeFile.getCanonicalPath()); persistedJobsLicenses = recordManager.hashMap(JOBS_LICENSES); persistedTasksLicenses = recordManager.hashMap(TASKS_LICENSES); remainingTokens = recordManager.hashMap(REMAINING_TOKENS); recordManager.commit(); if (!firstAttempt) { logger.info("Loading of job database successful after clean."); } } catch (Exception e) { if (firstAttempt) { logger.error("Error occurred when loading the database " + storeFile.getAbsolutePath() + ", now cleaning it and retrying.", e); cleanDataBase(); initDBMaps(false); } else { close(); throw new IllegalStateException("Error when loading database (even after cleaning it): " + storeFile.getAbsolutePath(), e); } } }
Source:
public void testCancellationWhileWaitingOnRule() throws Exception { final Semaphore mainThreadSemaphore = new Semaphore(0); final Semaphore lockSemaphore = new Semaphore(0); final PathRule rule = new PathRule("testBeginRuleNoEnd"); final NullProgressMonitor rootMonitor = new NullProgressMonitor(); IProgressMonitor nestedMonitor = SubMonitor.convert(rootMonitor); nestedMonitor.setCanceled(false); Job job = Job.create("", monitor -> { mainThreadSemaphore.release(); try { lockSemaphore.acquire(); } catch (InterruptedException e) { } }); job.setRule(rule); job.schedule(); mainThreadSemaphore.acquire(); Job cancellationJob = Job.create("", monitor -> { rootMonitor.setCanceled(true); }); cancellationJob.schedule(100); boolean canceledExceptionThrown = false; try { manager.beginRule(rule, nestedMonitor); } catch (OperationCanceledException e) { canceledExceptionThrown = true; } manager.endRule(rule); lockSemaphore.release(); boolean interrupted = Thread.interrupted(); assertTrue("An OperationCancelledException was thrown", canceledExceptionThrown); assertFalse("The thread was not interrupted", interrupted); }

Target:
public void testCancellationWhileWaitingOnRule() throws Exception { final Semaphore mainThreadSemaphore = new Semaphore(0); final Semaphore lockSemaphore = new Semaphore(0); final PathRule rule = new PathRule("testBeginRuleNoEnd"); final NullProgressMonitor rootMonitor = new NullProgressMonitor(); IProgressMonitor nestedMonitor = SubMonitor.convert(rootMonitor); nestedMonitor.setCanceled(false); Job job = Job.create("", monitor -> { mainThreadSemaphore.release(); try { lockSemaphore.acquire(); } catch (InterruptedException e) { } }); job.setRule(rule); job.schedule(); mainThreadSemaphore.acquire(); Job cancellationJob = Job.create("", monitor -> { rootMonitor.setCanceled(true); }); cancellationJob.schedule(100); boolean canceledExceptionThrown = false; try { manager.beginRule(rule, nestedMonitor); } catch (OperationCanceledException e) { canceledExceptionThrown = true; } finally { manager.endRule(rule); } lockSemaphore.release(); boolean interrupted = Thread.interrupted(); assertTrue("An OperationCancelledException should have been thrown", canceledExceptionThrown); assertFalse("The THread.interrupted() state leaked", interrupted); }
Source:
protected boolean authenticate(String realmName, String username, char[] password) throws HttpAuthenticationException { RealmCallback realmCallback = realmName != null ? new RealmCallback("User realm", realmName) : null; NameCallback nameCallback = new NameCallback("Remote Authentication Name", username); nameCallback.setName(username); final PasswordGuessEvidence evidence = new PasswordGuessEvidence(password); EvidenceVerifyCallback evidenceVerifyCallback = new EvidenceVerifyCallback(evidence); if (log.isDebugEnabled()) { log.debug("Using UsernamePasswordAuthenticationMechanism for username authentication..."); log.debugf("Realm => %s", realmName); log.debugf("Username => %s", username); } try { final Callback[] callbacks; if (realmCallback != null) { callbacks = new Callback[] { realmCallback, nameCallback, evidenceVerifyCallback }; } else { callbacks = new Callback[] { nameCallback, evidenceVerifyCallback }; } callbackHandler.handle(callbacks); return evidenceVerifyCallback.isVerified(); } catch (UnsupportedCallbackException e) { return false; } catch (IOException e) { throw new HttpAuthenticationException(e); } finally { evidence.destroy(); } }

Target:
protected boolean authenticate(String realmName, String username, char[] password) throws HttpAuthenticationException { RealmCallback realmCallback = realmName != null ? new RealmCallback("User realm", realmName) : null; NameCallback nameCallback = new NameCallback("Remote Authentication Name", username); nameCallback.setName(username); final PasswordGuessEvidence evidence = new PasswordGuessEvidence(password); EvidenceVerifyCallback evidenceVerifyCallback = new EvidenceVerifyCallback(evidence); log.debugf("Using UsernamePasswordAuthenticationMechanism for username authentication. Realm: [%s], Username: [%s].", realmName, username); try { final Callback[] callbacks; if (realmCallback != null) { callbacks = new Callback[] { realmCallback, nameCallback, evidenceVerifyCallback }; } else { callbacks = new Callback[] { nameCallback, evidenceVerifyCallback }; } callbackHandler.handle(callbacks); return evidenceVerifyCallback.isVerified(); } catch (UnsupportedCallbackException e) { return false; } catch (IOException e) { throw new HttpAuthenticationException(e); } finally { evidence.destroy(); } }
Source:
private static int upgradeBarcodeScannerProperties(Map<String, JSONValue> componentProperties, int srcCompVersion) { if (srcCompVersion < 2) { srcCompVersion = 2; } if (srcCompVersion < 3) { if (componentProperties.containsKey("UseExternalScanner")){ String value = ((ClientJsonString)componentProperties.get("UseExternalScanner")).getString(); if (value.equals("True")){ componentProperties.remove("UseExternalScanner"); } } else { componentProperties.put("UseExternalScanner", new ClientJsonString("False")); } srcCompVersion = 3; } return srcCompVersion; }

Target:
private static int upgradeBarcodeScannerProperties(Map<String, JSONValue> componentProperties, int srcCompVersion) { if (srcCompVersion < 2) { srcCompVersion = 2; } return srcCompVersion; }
Source:
public String name() { String name = ""; if (job instanceof hudson.matrix.MatrixConfiguration) { name += ((hudson.matrix.MatrixProject) job.getParent()).getName(); name += ' ' + job.getDisplayName(); } else { name += (null != job.getDisplayNameOrNull()) ? job.getDisplayName() : job.getName(); } return name; }

Target:
public String name() { if (job instanceof hudson.matrix.MatrixConfiguration) { return ((hudson.matrix.MatrixProject) job.getParent()).getDisplayName() + ' ' + job.getDisplayName(); } else { return (null != job.getDisplayNameOrNull()) ? job.getDisplayName() : job.getName(); } }
Source:
private void parse() throws IOException, InterruptedException { try (InputStream is = dockerfilePath.read()) { try (BufferedReader r = new BufferedReader(new InputStreamReader(is, "ISO-8859-1"))) { String line; while ((line = r.readLine()) != null) { line = line.trim(); if (line.startsWith("#")) { continue; } if (line.startsWith(ARG)) { String[] keyVal = parseDockerfileArg(line.substring(4)); args.put(keyVal[0], keyVal[1]); continue; } if (line.startsWith(FROM)) { froms.add(line.substring(5)); continue; } } } } }

Target:
private void parse() throws IOException, InterruptedException { try (InputStream is = dockerfilePath.read(); BufferedReader r = new BufferedReader(new InputStreamReader(is, "ISO-8859-1"))) { String line; while ((line = r.readLine()) != null) { line = line.trim(); if (line.startsWith("#")) { continue; } if (line.startsWith(ARG)) { String[] keyVal = parseDockerfileArg(line.substring(4)); args.put(keyVal[0], keyVal[1]); continue; } if (line.startsWith(FROM)) { froms.add(line.substring(5)); continue; } } } }
Source:
public Visit getVisitByUuid(String configName, String uuid) { try { Config config = configService.getConfigByName(configName); return visitResource.getVisitById(config, uuid); } catch (HttpClientErrorException e) { return null; } }

Target:
public Visit getVisitByUuid(String configName, String uuid) { try { Config config = configService.getConfigByName(configName); return visitResource.getVisitById(config, uuid); } catch (HttpClientErrorException e) { LOGGER.error("Error while fetching visit with UUID: " + uuid); return null; } }
Source:
private VersionNumber versionOfPlugin(File p) throws IOException { if (!p.isFile()) { return new VersionNumber("0.0"); } JarFile j = null; try { try { j = new JarFile(p); } catch (IOException x) { throw new IOException("not a valid JarFile: " + p, x); } String v = j.getManifest().getMainAttributes().getValue("Plugin-Version"); if (v == null) { throw new IOException("no Plugin-Version in " + p); } try { return new VersionNumber(v); } catch (IllegalArgumentException x) { throw new IOException("malformed Plugin-Version in " + p + ": " + x, x); } } finally { if (j != null) { j.close(); } } }

Target:
private VersionNumber versionOfPlugin(File p) throws IOException { if (!p.isFile()) { return new VersionNumber("0.0"); } JarFile j; try { j = new JarFile(p); } catch (IOException x) { throw new IOException("not a valid JarFile: " + p, x); } try { String v = j.getManifest().getMainAttributes().getValue("Plugin-Version"); if (v == null) { throw new IOException("no Plugin-Version in " + p); } try { return new VersionNumber(v); } catch (IllegalArgumentException x) { throw new IOException("malformed Plugin-Version in " + p + ": " + x, x); } } finally { j.close(); } }
Source:
LRESULT WM_CHAR (long wParam, long lParam) { if (ignoreCharacter) return null; LRESULT result = super.WM_CHAR (wParam, lParam); if (result != null) return result; switch ((int) wParam) { case SWT.DEL: if (OS.GetKeyState (OS.VK_CONTROL) < 0) { if ((style & SWT.READ_ONLY) != 0) return LRESULT.ZERO; Point selection = getSelection (); int x = selection.x; int y = selection.y; if (x == y) { String actText = getText (0, getCaretPosition ()); java.util.regex.Matcher m = CTRL_BS_PATTERN.matcher (actText); if (m.find ()) { x = m.start (); y = m.end (); OS.SendMessage (handle, OS.EM_SETSEL, x, y); } } if (x < y) { OS.SendMessage (handle, OS.EM_REPLACESEL, 1, 0); } return LRESULT.ZERO; } } if ((style & SWT.SINGLE) != 0) { switch ((int) wParam) { case SWT.CR: sendSelectionEvent (SWT.DefaultSelection); case SWT.TAB: case SWT.ESC: return LRESULT.ZERO; } } return result; }

Target:
LRESULT WM_CHAR (long wParam, long lParam) { if (ignoreCharacter) return null; LRESULT result = super.WM_CHAR (wParam, lParam); if (result != null) return result; switch ((int) wParam) { case SWT.DEL: if (OS.GetKeyState (OS.VK_CONTROL) < 0) { if ((style & SWT.READ_ONLY) != 0 || (style & SWT.PASSWORD) != 0) return LRESULT.ZERO; Point selection = getSelection (); int x = selection.x; int y = selection.y; if (x == y) { String actText = getText (0, x - 1); java.util.regex.Matcher m = CTRL_BS_PATTERN.matcher (actText); if (m.find ()) { x = m.start (); y = m.end (); OS.SendMessage (handle, OS.EM_SETSEL, x, y); } } if (x < y) { OS.SendMessage (handle, OS.EM_REPLACESEL, 1, 0); } return LRESULT.ZERO; } } if ((style & SWT.SINGLE) != 0) { switch ((int) wParam) { case SWT.CR: sendSelectionEvent (SWT.DefaultSelection); case SWT.TAB: case SWT.ESC: return LRESULT.ZERO; } } return result; }
Source:
public static String getUnoccupiedWorkspaceLocation(String name) { String stringPath = getDefaultWorkspaceLocation(name); try { if (isLocked(stringPath)) { int i = 1; String newStringPath; do { i++; newStringPath = getDefaultWorkspaceLocation(name + "-" + i); } while (isLocked(newStringPath)); stringPath = newStringPath; } } catch (IOException e) { Q7UIPlugin.log(e); return stringPath; } return stringPath; }

Target:
private String getUnoccupiedWorkspaceLocation(String name) { String stringPath = getDefaultWorkspaceLocation(name); try { if (isLocationExists(stringPath)) { int i = 1; String newStringPath; do { i++; newStringPath = getDefaultWorkspaceLocation(name + "-" + i); } while (isLocationExists(newStringPath)); stringPath = newStringPath; } } catch (CoreException e) { Q7UIPlugin.log(e); } return stringPath; }
Source:
private void printProgress(final ProgressMessage message) { final String id = message.id(); Integer line = idsToLines.get(id); int diff = 0; if (line == null) { line = idsToLines.size(); idsToLines.put(id, line); } else { diff = idsToLines.size() - line; } if (diff > 0) { out.printf("%c[%dA", ESC_CODE, diff); out.printf("%c[2K\r", ESC_CODE); } String progress = message.progress(); if (progress == null) { progress = ""; } out.printf("%s: %s %s\r\n", id, message.status(), progress); if (diff > 0) { out.printf("%c[%dB", ESC_CODE, diff - 1); } }

Target:
private void printProgress(final ProgressMessage message) { final String id = message.id(); Integer line = idsToLines.get(id); int diff = 0; if (line == null) { line = idsToLines.size(); idsToLines.put(id, line); } else { diff = idsToLines.size() - line; } if (diff > 0) { out.printf("%c[%dA", ESC_CODE, diff); out.printf("%c[2K\r", ESC_CODE); } String progress = message.progress(); if (progress == null) { progress = ""; } out.printf("%s: %s %s%n", id, message.status(), progress); if (diff > 0) { out.printf("%c[%dB", ESC_CODE, diff - 1); } }
Source:
public void theSetPushSetupSmsRequestIsReceived(final Map<String, String> settings) throws Throwable { final SetPushSetupSmsRequest smsrequest = SetPushSetupSmsRequestFactory.fromParameterMap(settings); final SetPushSetupSmsAsyncResponse smsasyncResponse = this.smartMeteringConfigurationClient .setPushSetupSms(smsrequest); LOGGER.info("Set special days response is received {}", smsasyncResponse); assertNotNull("Set special days response should not be null", smsasyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, smsasyncResponse.getCorrelationUid()); ScenarioContext.current().put(PlatformSmartmeteringKeys.HOSTNAME, settings.get(PlatformSmartmeteringKeys.HOSTNAME)); ScenarioContext.current().put(PlatformSmartmeteringKeys.PORT, settings.get(PlatformSmartmeteringKeys.PORT)); }

Target:
public void theSetPushSetupSmsRequestIsReceived(final Map<String, String> settings) throws Throwable { final SetPushSetupSmsRequest setPushSetupSmsRequest = SetPushSetupSmsRequestFactory.fromParameterMap(settings); final SetPushSetupSmsAsyncResponse setPushSetupSmsAsyncResponse = this.smartMeteringConfigurationClient .setPushSetupSms(setPushSetupSmsRequest); LOGGER.info("Set push setup sms response is received {}", setPushSetupSmsAsyncResponse); assertNotNull("Set push setup sms response should not be null", setPushSetupSmsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setPushSetupSmsAsyncResponse.getCorrelationUid()); ScenarioContext.current().put(PlatformSmartmeteringKeys.HOSTNAME, settings.get(PlatformSmartmeteringKeys.HOSTNAME)); ScenarioContext.current().put(PlatformSmartmeteringKeys.PORT, settings.get(PlatformSmartmeteringKeys.PORT)); }
Source:
public void testRawQuery() throws ErrnoException { for (Network network : getTestableNetworks()) { CountDownLatch latch = new CountDownLatch(1); final int TIMEOUT_MS = 12_000; final String dname = "www.google.com"; mDns.query(network, dname, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, mHandler, answer -> { try { new DnsRawAnswer(answer); Log.d(TAG, "Reported blob:" + byteArrayToHexString(answer)); latch.countDown(); } catch (DnsPacket.ParseException e) { Log.d(TAG, e.getMessage()); } } ); String msg = "Raw query " + dname + " but no valid answer after " + TIMEOUT_MS + "ms."; try { assertTrue(msg, latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { } } }

Target:
public void testRawQuery() throws ErrnoException { for (Network network : getTestableNetworks()) { CountDownLatch latch = new CountDownLatch(1); final int TIMEOUT_MS = 12_000; final String dname = "www.google.com"; String msg = "Raw query " + dname; mDns.query(network, dname, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, mHandler, answer -> { if (answer == null) { fail(msg + " no answer returned"); } try { new CheckedDnsPacket(answer); Log.d(TAG, "Reported blob:" + byteArrayToHexString(answer)); latch.countDown(); } catch (DnsPacket.ParseException e) { Log.d(TAG, e.getMessage()); fail(msg + " no valid answer"); } } ); try { assertTrue(msg + " but no answer after " + TIMEOUT_MS + "ms.", latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { } } }
Source:
public static void main(String[] args) { DefaultCacheManager cacheManager = new DefaultCacheManager(); MultimapCacheManager multimapCacheManager = EmbeddedMultimapCacheManagerFactory.from(cacheManager); multimapCacheManager.defineConfiguration("multimap", new ConfigurationBuilder().build()); MultimapCache<String, String> multimap = multimapCacheManager.get("multimap"); multimap.put("key", "value1"); multimap.put("key", "value2"); multimap.put("key", "value3"); multimap.get("key").whenComplete((values, ex) -> { System.out.println(values); cacheManager.stop(); }); }

Target:
public static void main(String[] args) { DefaultCacheManager cacheManager = new DefaultCacheManager(); MultimapCacheManager multimapCacheManager = EmbeddedMultimapCacheManagerFactory.from(cacheManager); multimapCacheManager.defineConfiguration("multimap", new ConfigurationBuilder().build()); MultimapCache<String, String> multimap = multimapCacheManager.get("multimap"); CompletableFuture.allOf( multimap.put("key", "value1"), multimap.put("key", "value2"), multimap.put("key", "value3")) .whenComplete((nil, ex) -> { multimap.get("key").whenComplete((values, ex2) -> { System.out.println(values); cacheManager.stop(); }); }); }
Source:
private boolean transitionToWithWorkingBranchRuleExists(IAtsStateDefinition toStateDef) { return (toStateDef.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())); }

Target:
private boolean transitionToWithWorkingBranchRuleExists(IAtsStateDefinition toStateDef) { return toStateDef.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name()); }
Source:
public void set(byte[] utf8) { if(utf8.length == 0){ bytes = EMPTY_BYTES; length = 0; textLength = -1; return; } set(utf8, 0, utf8.length); }

Target:
public void set(byte[] utf8) { if (utf8.length == 0) { bytes = EMPTY_BYTES; length = 0; textLength = -1; } else { set(utf8, 0, utf8.length); } }
Source:
public void testWindowsCount() { System.out.println("java.vendor: " + System.getProperty("java.vendor")); System.out.println("java.version: " + System.getProperty("java.version")); System.out.println("os.version: " + System.getProperty("os.version")); System.out.println("os.arch: " + System.getProperty("os.arch")); System.out.println("os.name: " + System.getProperty("os.name")); ShellApplication sa = new ShellApplication(); System.out.println("Shell.Application.Windows found: " + sa.Windows().Count()); assertTrue(sa.Windows().Count() > 0); for (InternetExplorer ie : sa.Windows()) { System.out.println(); System.out.println("============================================"); if (ie != null) { System.out.println("Title: " + ie.getTitle()); System.out.println("URL: " + ie.getURL()); System.out.println("App Name: " + ie.getName()); System.out.println("Window Handle: " + ie.getWindowHandle()); } else { System.out.println("Null encountered."); } System.out.println("============================================"); System.out.println(); } }

Target:
public void testWindowsCount() { ShellApplication sa = new ShellApplication(); assertTrue(sa.Windows().Count() > 0); boolean pageFound = false; for (InternetExplorer ie : sa.Windows()) { if (ie != null && "about:blank".equals(ie.getURL())) { pageFound = true; } } assertTrue(pageFound); }
Source:
private static Path installForm(Path formDir, final String formName) { Path sourceForm = getPath(formName + ".xml"); Path targetForm = formDir.resolve("form.xml"); copy(sourceForm, targetForm); Path instancesDir = formDir.resolve("instances"); createDirectories(instancesDir); maybeGetPath(formName + "_submission.xml") .filter(Files::exists) .ifPresent(path -> { String instanceId = readInstanceId(path); Path submissionDir = instancesDir.resolve(instanceId.replace(":", "")); createDirectories(submissionDir); walk(path.getParent()) .filter(file -> file.getFileName().toString().startsWith(formName + "_")) .filter(file -> !file.getFileName().toString().endsWith(".pem")) .filter(file -> !file.getFileName().toString().endsWith(".tpl")) .forEach(file -> { Path target = submissionDir.resolve(file.getFileName().toString().substring(formName.length() + 1)); log.debug("Install " + submissionDir.getFileName() + "/" + target.getFileName()); copy(file, target); }); }); return targetForm; }

Target:
private static Path installForm(Path formDir, final String formName) { Path sourceForm = getPath(formName + ".xml"); Path targetForm = formDir.resolve("form.xml"); copy(sourceForm, targetForm); Path instancesDir = formDir.resolve("instances"); createDirectories(instancesDir); maybeGetPath(formName + "-submission.xml") .filter(Files::exists) .ifPresent(path -> { String instanceId = readInstanceId(path); Path submissionDir = instancesDir.resolve(instanceId.replace(":", "")); createDirectories(submissionDir); walk(path.getParent()) .filter(isRelatedToForm(formName)) .filter(isPemFile().negate()) .filter(isTemplateFile().negate()) .filter(isExpectedContentsFile().negate()) .forEach(file -> { Path target = submissionDir.resolve(file.getFileName().toString().substring(formName.length() + 1)); log.debug("Install " + submissionDir.getFileName() + "/" + target.getFileName()); copy(file, target); }); }); return targetForm; }
Source:
public AbstractMailer(Props props) { this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailPort = props.getString("mail.port", Emailer.DEFAULT_SMTP_PORT); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); long maxAttachmentSizeInMB = props.getInt("mail.max.attachment.size.mb", 100); attachmentMazSizeInByte = maxAttachmentSizeInMB * MB_IN_BYTES; this.mailSender = props.getString("mail.sender", ""); this.usesAuth = props.getBoolean("mail.useAuth", true); this.clientHostname = props.get("server.hostname"); this.clientPort = props.getInt("server.port"); this.usesSSL = props.getBoolean("server.useSSL"); if (usesSSL) { referenceURL = "https://" + clientHostname + (clientPort == 443 ? "/" : ":" + clientPort + "/"); } else { referenceURL = "http://" + clientHostname + (clientPort == 80 ? "/" : ":" + clientPort + "/"); } }

Target:
public AbstractMailer(Props props) { this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailPort = props.getInt("mail.port", DEFAULT_SMTP_PORT); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); this.tls = props.getString("mail.tls", "false"); long maxAttachmentSizeInMB = props.getInt("mail.max.attachment.size.mb", 100); attachmentMazSizeInByte = maxAttachmentSizeInMB * MB_IN_BYTES; this.mailSender = props.getString("mail.sender", ""); this.usesAuth = props.getBoolean("mail.useAuth", true); this.clientHostname = props.get("server.hostname"); this.clientPort = props.getInt("server.port"); this.usesSSL = props.getBoolean("server.useSSL"); if (usesSSL) { referenceURL = "https://" + clientHostname + (clientPort == 443 ? "/" : ":" + clientPort + "/"); } else { referenceURL = "http://" + clientHostname + (clientPort == 80 ? "/" : ":" + clientPort + "/"); } }
Source:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.isEmpty()) { return ExprEval.of(null); } ExprAnalysis exprAnalysis = analyzeExprs(args, bindings); if (exprAnalysis == null) { return ExprEval.of(null); } Stream<ExprEval<?>> exprEvalStream = exprAnalysis.exprEvals.stream(); switch (exprAnalysis.comparisonType) { case DOUBLE: return ExprEval.of(exprEvalStream.mapToDouble(ExprEval::asDouble).reduce(doubleReducer).getAsDouble()); case LONG: return ExprEval.of(exprEvalStream.mapToLong(ExprEval::asLong).reduce(longReducer).getAsLong()); default: return ExprEval.of(exprEvalStream.map(ExprEval::asString).reduce(stringReducer).get()); } }

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.isEmpty()) { return ExprEval.of(null); } ExprAnalysis exprAnalysis = analyzeExprs(args, bindings); if (exprAnalysis.exprEvals.isEmpty()) { return ExprEval.of(null); } Stream<ExprEval<?>> exprEvalStream = exprAnalysis.exprEvals.stream(); switch (exprAnalysis.comparisonType) { case DOUBLE: return ExprEval.of(exprEvalStream.mapToDouble(ExprEval::asDouble).reduce(doubleReducer).getAsDouble()); case LONG: return ExprEval.of(exprEvalStream.mapToLong(ExprEval::asLong).reduce(longReducer).getAsLong()); default: return ExprEval.of(exprEvalStream.map(ExprEval::asString).reduce(stringReducer).get()); } }
Source:
@Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); for (IgniteConfiguration cfg : configurations()) Ignition.start(cfg); node().cluster().state(ClusterState.ACTIVE); }

Target:
@Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); for (IgniteConfiguration cfg : configurations()) startGrid(cfg); node().cluster().state(ClusterState.ACTIVE); }
Source:
public AzureClientRegistrationRepository clientRegistrationRepository() { return new AzureClientRegistrationRepository( createDefaultClient(), createAuthzClients(), properties.getAuthorization()); }

Target:
public AzureClientRegistrationRepository clientRegistrationRepository() { return new AzureClientRegistrationRepository( createDefaultClient(), createAuthzClients(), properties); }