auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Artifact getJenkinsWarArtifact() throws MojoExecutionException { for( Artifact a : resolveDependencies("test") ) { boolean match; if (jenkinsWarId!=null) match = (a.getGroupId()+':'+a.getArtifactId()).equals(jenkinsWarId); else match = (a.getArtifactId().equals("jenkins-war") || a.getArtifactId().equals("hudson-war")) && a.getType().equals("executable-war"); if(match) return a; } if (jenkinsWarId!=null) { getLog().error("Unable to locate jenkins.war in '"+jenkinsWarId+"'"); } else { getLog().error( "Unable to locate jenkins.war. Add the following dependency in your POM:\n" + "\n" + "<dependency>\n" + " <groupId>org.jenkins-ci.main</groupId>\n" + " <artifactId>jenkins-war</artifactId>\n" + " <type>war</type>\n" + " <version>1.396<!-- replace this with the version you want--></version>\n" + " <scope>test</scope>\n" + "</dependency>" ); } throw new MojoExecutionException("Unable to find jenkins.war"); }

Target:
protected Artifact getJenkinsWarArtifact() throws MojoExecutionException { for( Artifact a : resolveDependencies("test") ) { boolean match; if (jenkinsWarId!=null) match = (a.getGroupId()+':'+a.getArtifactId()).equals(jenkinsWarId); else match = (a.getArtifactId().equals("jenkins-war") || a.getArtifactId().equals("hudson-war")) && (a.getType().equals("executable-war") || a.getType().equals("war")); if(match) return a; } if (jenkinsWarId!=null) { getLog().error("Unable to locate jenkins.war in '"+jenkinsWarId+"'"); } else { getLog().error( "Unable to locate jenkins.war. Add the following dependency in your POM:\n" + "\n" + "<dependency>\n" + " <groupId>org.jenkins-ci.main</groupId>\n" + " <artifactId>jenkins-war</artifactId>\n" + " <type>war</type>\n" + " <version>1.396<!-- replace this with the version you want--></version>\n" + " <scope>test</scope>\n" + "</dependency>" ); } throw new MojoExecutionException("Unable to find jenkins.war"); }
Source:
private void validate() { long currencyCount = amounts.stream() .map(ArgChecker::notNullItem) .map(CurrencyAmount::getCurrency) .distinct() .count(); if (currencyCount < amounts.size()) { throw new IllegalArgumentException("Duplicate currency not allowed"); } }

Target:
private void validate() { long currencyCount = amounts.stream() .map(ArgChecker::notNullItem) .map(CurrencyAmount::getCurrency) .distinct() .count(); if (currencyCount < amounts.size()) { throw new IllegalArgumentException("Duplicate currency not allowed: " + amounts); } }
Source:
private void validateInput() { if (getShell() == null) { return; } String tagNameMessage = tagNameValidator.isValid(tagNameText.getText()); setErrorMessage(tagNameMessage); String tagMessageVal = tagMessageText.getText().trim(); boolean isLightWeight = lightweightButton.getSelection(); Control button = getButton(IDialogConstants.OK_ID); if (button != null) { boolean containsTagNameAndMessage = (tagNameMessage == null || tagMessageVal .length() == 0) && tagMessageVal.length() != 0; boolean shouldOverwriteTag = (overwriteButton.getSelection() && Repository .isValidRefName(Constants.R_TAGS + tagNameText.getText())); boolean enabled = containsTagNameAndMessage || shouldOverwriteTag || (isLightWeight && tagNameMessage == null && !tagNameText.getText().isEmpty()); button.setEnabled(enabled); Button createTagAndStartPush = getButton(CREATE_AND_START_PUSH_ID); if (createTagAndStartPush != null) createTagAndStartPush.setEnabled(enabled); } boolean existingTagSelected = existingTag != null; boolean editable = (existingTagSelected && !overwriteButton.getSelection()) || isLightWeight; tagMessageText.getTextWidget().setEditable(editable); overwriteButton.setEnabled(existingTagSelected); if (!existingTagSelected) overwriteButton.setSelection(false); }

Target:
private void validateInput() { if (getShell() == null) { return; } String tagNameMessage = tagNameValidator.isValid(tagNameText.getText()); setErrorMessage(tagNameMessage); String tagMessageVal = tagMessageText.getText().trim(); boolean isLightWeight = tagMessageVal.isEmpty(); Control button = getButton(IDialogConstants.OK_ID); if (button != null) { boolean containsTagNameAndMessage = (tagNameMessage == null || tagMessageVal.length() == 0) && tagMessageVal.length() != 0; boolean shouldOverwriteTag = (overwriteButton.getSelection() && Repository.isValidRefName( Constants.R_TAGS + tagNameText.getText())); boolean enabled = containsTagNameAndMessage || shouldOverwriteTag || (isLightWeight && tagNameMessage == null && !tagNameText.getText().isEmpty()); button.setEnabled(enabled); Button createTagAndStartPush = getButton(CREATE_AND_START_PUSH_ID); if (createTagAndStartPush != null) createTagAndStartPush.setEnabled(enabled); } boolean existingTagSelected = existingTag != null; boolean readOnly = (existingTagSelected && !overwriteButton.getSelection()); tagMessageText.getTextWidget().setEditable(!readOnly); overwriteButton.setEnabled(existingTagSelected); if (!existingTagSelected) overwriteButton.setSelection(false); }
Source:
public Object execute(int idxInPartition, WindowFrameState currentFrame, List<? extends CollectExpression<Row, ?>> expressions, Input... args) { final int offset; if (args.length > 1) { offset = ((Number) args[1].value()).intValue(); } else { offset = 1; } if (offset <= idxInPartition) { int lagIdx = idxInPartition - offset; var lagRowCells = currentFrame.getRowInPartitionAtIndexOrNull(lagIdx); if (lagRowCells == null) { return null; } Row lagRow = new RowN(lagRowCells); for (CollectExpression<Row, ?> expression : expressions) { expression.setNextRow(lagRow); } return args[0].value(); } else { if (args.length == 3) { return args[2].value(); } else { return null; } } }

Target:
public Object execute(int idxInPartition, WindowFrameState currentFrame, List<? extends CollectExpression<Row, ?>> expressions, Input... args) { final int offset; if (args.length > 1) { Object offsetValue = args[1].value(); if (offsetValue == null) { return null; } else { offset = ((Number) offsetValue).intValue(); } } else { offset = 1; } var lagRowCells = currentFrame .getRowInPartitionAtIndexOrNull(idxInPartition - offset); if (lagRowCells != null) { var lagRow = new RowN(lagRowCells); for (CollectExpression<Row, ?> expression : expressions) { expression.setNextRow(lagRow); } return args[0].value(); } else { return getDefaultOrNull(args); } }
Source:
public Command getCommand() { return this.currentCommand; }

Target:
public Command getCommand() { return selectionPage.getComboSelection().getPatternCreationCommand(); }
Source:
private Launcher getTaskLauncher(String platformName) { Launcher launcherToUse = null; List<Launcher> launchers = getLaunchers(); for (Launcher launcher : launchers) { if (launcher.getName().equalsIgnoreCase(platformName)) { launcherToUse = launcher; break; } } if (launcherToUse == null && platformName != null) { throw new IllegalArgumentException(String.format("The platform %s does not exist", platformName)); } int launcherCount = 0; if (launcherToUse == null) { if(getPrimaryLauncher() != null) { return getPrimaryLauncher(); } for(Launcher launcher : launchers) { if(launcher.getScheduler() != null) { launcherToUse = launcher; launcherCount++; } } } if (launcherCount > 1 ) { throw new IllegalArgumentException("Must select a platform. " + "A default could not be determined because more than one platform" + " had an associated scheduler"); } if (platformName != null && launcherToUse == null) { throw new IllegalArgumentException(String.format("The platform %s does not support a scheduler service.", platformName)); } else if (platformName == null && launcherToUse == null) { throw new IllegalStateException("Could not find a default scheduler."); } return launcherToUse; }

Target:
private Launcher getTaskLauncher(String platformName) { Launcher launcherToUse = null; List<Launcher> launchers = getLaunchers(); for (Launcher launcher : launchers) { if (launcher.getName().equalsIgnoreCase(platformName)) { launcherToUse = launcher; break; } } if (launcherToUse == null && StringUtils.hasText(platformName)) { throw new IllegalArgumentException(String.format("The platform %s does not exist", platformName)); } int launcherCount = 0; if (launcherToUse == null) { if(getPrimaryLauncher() != null) { return getPrimaryLauncher(); } for(Launcher launcher : launchers) { if(launcher.getScheduler() != null) { launcherToUse = launcher; launcherCount++; } } } if (launcherCount > 1 ) { throw new IllegalArgumentException("Must select a platform. " + "A default could not be determined because more than one platform" + " had an associated scheduler"); } if (platformName != null && launcherToUse == null) { throw new IllegalArgumentException(String.format("The platform %s does not support a scheduler service.", platformName)); } else if (platformName == null && launcherToUse == null) { throw new IllegalStateException("Could not find a default scheduler."); } return launcherToUse; }
Source:
public Map<String, String> populateCustomClaims(TokenValidationContext validationContext) throws APIManagementException { Map<ClaimMapping, String> customClaimsWithMapping = new HashMap<>(); Map<String, String> customClaims; Map<String, Object> properties = new HashMap<String, Object>(); String accessToken = validationContext.getAccessToken(); String authCode = validationContext.getAuthorizationCode(); if (accessToken != null) { properties.put(APIConstants.KeyManager.ACCESS_TOKEN, accessToken); } else if (authCode != null) { properties.put(APIConstants.KeyManager.AUTH_CODE, authCode); } else { customClaimsWithMapping.putAll(validationContext.getUser().getUserAttributes()); } String username = validationContext.getValidationInfoDTO().getEndUserName(); int tenantId = APIUtil.getTenantId(username); customClaims = convertClaimMap(customClaimsWithMapping, username); String dialectURI = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService() .getAPIManagerConfiguration().getFirstProperty(APIConstants.CONSUMER_DIALECT_URI); if (!StringUtils.isEmpty(dialectURI)) { properties.put(APIConstants.KeyManager.CLAIM_DIALECT, dialectURI); } String keymanagerName = validationContext.getValidationInfoDTO().getKeyManager(); KeyManager keymanager = KeyManagerHolder.getKeyManagerInstance(APIUtil.getTenantDomainFromTenantId(tenantId), keymanagerName); Map<String, String> retreivedClaims = keymanager.getUserClaims(username, properties); if (log.isDebugEnabled()) { log.debug("Retrieved claims :" + retreivedClaims); } customClaims.putAll(retreivedClaims); ClaimsRetriever claimsRetriever = getClaimsRetriever(); if (claimsRetriever != null) { customClaims.putAll(claimsRetriever.getClaims(username)); } return customClaims; }

Target:
public Map<String, String> populateCustomClaims(TokenValidationContext validationContext) throws APIManagementException { Map<String, String> customClaims; Map<String, Object> properties = new HashMap<String, Object>(); String accessToken = validationContext.getAccessToken(); if (accessToken != null) { properties.put(APIConstants.KeyManager.ACCESS_TOKEN, accessToken); } String username = validationContext.getValidationInfoDTO().getEndUserName(); int tenantId = APIUtil.getTenantId(username); String dialectURI = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService() .getAPIManagerConfiguration().getFirstProperty(APIConstants.CONSUMER_DIALECT_URI); if (!StringUtils.isEmpty(dialectURI)) { properties.put(APIConstants.KeyManager.CLAIM_DIALECT, dialectURI); } String keymanagerName = validationContext.getValidationInfoDTO().getKeyManager(); KeyManager keymanager = KeyManagerHolder.getKeyManagerInstance(APIUtil.getTenantDomainFromTenantId(tenantId), keymanagerName); customClaims = keymanager.getUserClaims(username, properties); if (log.isDebugEnabled()) { log.debug("Retrieved claims :" + customClaims); } ClaimsRetriever claimsRetriever = getClaimsRetriever(); if (claimsRetriever != null) { customClaims.putAll(claimsRetriever.getClaims(username)); } return customClaims; }
Source:
private void saveIllegalDisk(final DiskImage diskImage) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { diskImage.setId(Guid.NewGuid()); diskImage.setimage_group_id(Guid.NewGuid()); diskImage.setParentId(Guid.Empty); diskImage.setit_guid(Guid.Empty); diskImage.setvm_guid(getVmId()); ImagesHandler.addDiskImage(diskImage); ImagesHandler.setDiskAlias(diskImage.getDisk(), getVm()); return null; } }); }

Target:
private void saveIllegalDisk(final DiskImage diskImage) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { diskImage.setId(Guid.NewGuid()); diskImage.setimage_group_id(Guid.NewGuid()); diskImage.setParentId(Guid.Empty); diskImage.setit_guid(Guid.Empty); diskImage.setvm_guid(getVmId()); ImagesHandler.setDiskAlias(diskImage.getDisk(), getVm()); ImagesHandler.addDiskImage(diskImage); return null; } }); }
Source:
public void execute(EObject object) { new ExtendedLoadResourceDialog(Display.getDefault().getActiveShell(), AdapterFactoryEditingDomain.getEditingDomainFor(object)).open(); }

Target:
public void execute(EObject object) { editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(object); new ExtendedLoadResourceDialog(Display.getDefault().getActiveShell(), editingDomain).open(); }
Source:
public void beginCreateSearch() { List<String> phonePlanIds = new ArrayList<>(); phonePlanIds.add("27b53eec-8ff4-4070-8900-fbeaabfd158a"); CreateSearchOptions createSearchOptions = new CreateSearchOptions(); createSearchOptions .setAreaCode(AREA_CODE_FOR_SEARCH) .setDescription("testsearch20200014") .setDisplayName("testsearch20200014") .setPhonePlanIds(phonePlanIds) .setQuantity(2); Duration duration = Duration.ofSeconds(5); PhoneNumberAsyncClient client = this.getClient(); PollerFlux<PhoneNumberSearch, PhoneNumberSearch> res = client.beginCreateSearch(createSearchOptions, duration); SyncPoller<PhoneNumberSearch, PhoneNumberSearch> sync = res.getSyncPoller(); sync.waitForCompletion(); PhoneNumberSearch testResult = sync.getFinalResult(); assertEquals(testResult.getPhoneNumbers().size(), 2); assertNotNull(testResult.getSearchId()); }

Target:
public void beginCreateSearch() { List<String> phonePlanIds = new ArrayList<>(); phonePlanIds.add(PHONE_PLAN_ID); CreateSearchOptions createSearchOptions = new CreateSearchOptions(); createSearchOptions .setAreaCode(AREA_CODE_FOR_SEARCH) .setDescription(SEARCH_OPTIONS_DESCRIPTION) .setDisplayName(SEARCH_OPTIONS_NAME) .setPhonePlanIds(phonePlanIds) .setQuantity(2); Duration duration = Duration.ofSeconds(1); PhoneNumberAsyncClient client = this.getClient(); PollerFlux<PhoneNumberSearch, PhoneNumberSearch> poller = client.beginCreateSearch(createSearchOptions, duration); AsyncPollResponse<PhoneNumberSearch, PhoneNumberSearch> asyncRes = poller.takeUntil(apr -> apr.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) .blockLast(); PhoneNumberSearch testResult = asyncRes.getValue(); assertEquals(testResult.getPhoneNumbers().size(), 2); assertNotNull(testResult.getSearchId()); }
Source:
public synchronized void postJobMessage(JobMessage jobMessage) throws JobMessageDispatchException { try { CPMSession session = this.getSession(); CPMMessage message = session.createMessage() .setDurable(true) .setProperty(JOB_KEY_MESSAGE_PROPERTY, jobMessage.getJobKey()); String serializedJobMessage = this.objMapper.writeValueAsString(jobMessage); message.setBody(serializedJobMessage); log.debug("Sending job message to {}: {}", JOB_MESSAGE_ADDRESS, serializedJobMessage); this.getProducer().send(JOB_MESSAGE_ADDRESS, message); } catch (Exception e) { throw new JobMessageDispatchException(e); } }

Target:
public void postJobMessage(JobMessage jobMessage) throws JobMessageDispatchException { try { CPMSession session = this.getSession(); CPMMessage message = session.createMessage() .setDurable(true) .setProperty(JOB_KEY_MESSAGE_PROPERTY, jobMessage.getJobKey()); String serializedJobMessage = this.objMapper.writeValueAsString(jobMessage); message.setBody(serializedJobMessage); log.debug("Sending job message to {}: {}", JOB_MESSAGE_ADDRESS, serializedJobMessage); this.getProducer().send(JOB_MESSAGE_ADDRESS, message); } catch (Exception e) { throw new JobMessageDispatchException(e); } }
Source:
public BlockingTaskAwareExecutorServiceImpl(String controllerThreadName, ExecutorService executorService, TimeService timeService) { this.blockedTasks = new LinkedBlockingQueue<>(); this.executorService = executorService; this.timeService = timeService; this.shutdown = false; this.controllerThread = new ControllerThread(controllerThreadName); controllerThread.start(); }

Target:
public BlockingTaskAwareExecutorServiceImpl(String controllerThreadName, ExecutorService executorService, TimeService timeService) { this.blockedTasks = new ConcurrentLinkedQueue<>(); this.executorService = executorService; this.timeService = timeService; this.shutdown = false; this.controllerThread = new ControllerThread(controllerThreadName); controllerThread.start(); }
Source:
private void addXmlAttributesToContextMap( final StartElement startElement, final Map<String, String> contextMap) { for (final Iterator attributeIterator = startElement.getAttributes(); attributeIterator.hasNext(); ) { final javax.xml.stream.events.Attribute attribute = (javax.xml.stream.events.Attribute) attributeIterator.next(); final String attributeKey = startElement.getName().getLocalPart() + "@" + attribute.getName().getLocalPart(); contextMap.put(attributeKey, attribute.getValue()); } }

Target:
private void addXmlAttributesToContextMap( final StartElement startElement, final Map<String, String> contextMap) { final Iterator<javax.xml.stream.events.Attribute> attributeIterator = startElement.getAttributes(); while (attributeIterator.hasNext()) { final javax.xml.stream.events.Attribute attribute = attributeIterator.next(); final String attributeKey = startElement.getName().getLocalPart() + "@" + attribute.getName().getLocalPart(); contextMap.put(attributeKey, attribute.getValue()); } }
Source:
public static void startServer() throws Exception { LOG = LoggerFactory.getLogger(HDFSDDFManagerTests.class); manager = new HDFSDDFManager(System.getenv("HDFS_URI")); try { new HDFSDDFManager("invalidpath"); assert false; } catch (Exception e) }

Target:
public static void startServer() throws Exception { LOG = LoggerFactory.getLogger(HDFSDDFManagerTests.class); manager = new HDFSDDFManager(System.getenv("HDFS_URI")); }
Source:
public List<Filter> additionalFilters() { if (rootContextFilters.isEmpty()) { new ArrayList<>(); } List<Filter> filters = new ArrayList<>(); final String[] filterClasses = rootContextFilters.split(","); for (String filterClass : filterClasses) { try { final Class<?> filterCls = Class.forName(filterClass); if (Filter.class.isAssignableFrom(filterCls)) { Filter filter = (Filter) filterCls.newInstance(); filters.add(filter); } } catch (InstantiationException | IllegalAccessException e) { logger.warn("Filter class can not be instantiated " + filterClass); } catch (ClassNotFoundException e) { logger.warn("Filter class not found " + filterClass); } } return filters; }

Target:
public List<Filter> additionalFilters() { if (rootContextFilters.isEmpty()) { return Collections.emptyList(); } List<Filter> filters = new ArrayList<>(); final String[] filterClasses = rootContextFilters.split(","); for (String filterClass : filterClasses) { try { getClass().getClassLoader(); final Class<?> filterCls = Class.forName(filterClass, false, getClass().getClassLoader()); if (Filter.class.isAssignableFrom(filterCls)) { Filter filter = (Filter) filterCls.newInstance(); filters.add(filter); } } catch (InstantiationException | IllegalAccessException e) { logger.warn("Filter class can not be instantiated " + filterClass); } catch (ClassNotFoundException e) { logger.warn("Filter class not found " + filterClass); } } return filters; }
Source:
private String prettyUploadedDate(Media media) { Date date = media.getDateUploaded(); if (date == null || date.toString() == null || date.toString().isEmpty()) { return "Uploaded date not available"; } SimpleDateFormat formatter = new SimpleDateFormat("yyyy MMM dd", Locale.getDefault()); return formatter.format(date); }

Target:
private String prettyUploadedDate(Media media) { Date date = media.getDateUploaded(); if (date == null || date.toString() == null || date.toString().isEmpty()) { return "Uploaded date not available"; } return DateUtils.dateInLocaleFormat(date); }
Source:
public String toString() { return "CustomFieldValue{" + "id=" + id + ", value=" + (value == null ? "null" : Arrays.asList(value).toString()) + '}'; }

Target:
public String toString() { return "CustomFieldValue{" + "id=" + id + ", value=" + Arrays.toString(value) + '}'; }
Source:
public void shouldBeAbleToScoreAGameWithNoStrikesOrSpares() { int[] rolls = { 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6 }; PlayGame(rolls); assertEquals(90, game.score()); }

Target:
public void shouldBeAbleToScoreAGameWithNoStrikesOrSpares() { int[] rolls = {3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6}; playGame(rolls); assertEquals(90, game.score()); }
Source:
public static void gather( long[] source, int[] positions, int[] rowNumberMap, int sourceOffset, byte[] target, int targetOffset, int numWords) { if (target.length < targetOffset + numWords * ARRAY_LONG_INDEX_SCALE || targetOffset < 0) { throw new IndexOutOfBoundsException(); } int end = sourceOffset + numWords; targetOffset += ARRAY_BYTE_BASE_OFFSET; if (rowNumberMap == null) { for (int i = sourceOffset; i < end; i++) { setLong(target, targetOffset, source[positions[i]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } else { for (int i = sourceOffset; i < end; i++) { setLong(target, targetOffset, source[rowNumberMap[positions[i]]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } }

Target:
public static void gather( long[] source, int[] positions, int[] rowNumberMap, int sourceOffset, byte[] target, int targetOffset, int numWords) { if (target.length < targetOffset + numWords * ARRAY_LONG_INDEX_SCALE || targetOffset < 0) { throw new IndexOutOfBoundsException(); } int end = sourceOffset + numWords; targetOffset += ARRAY_BYTE_BASE_OFFSET; if (rowNumberMap == null) { for (int i = sourceOffset; i < end; i++) { ByteArrays.setLong(target, targetOffset, source[positions[i]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } else { for (int i = sourceOffset; i < end; i++) { ByteArrays.setLong(target, targetOffset, source[rowNumberMap[positions[i]]]); targetOffset += ARRAY_LONG_INDEX_SCALE; } } }
Source:
public Collection<SlotState> getShardState(int shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_STATE_NAME); final Collection<SlotState> slotStates = new LinkedList<SlotState>(); Session session = DatastaxIO.getSession(); try { Select.Where statement = QueryBuilder .select() .column("key") .column("column1") .column("value") .writeTime("value") .from(CassandraModel.QUOTED_KEYSPACE, CassandraModel.CF_METRICS_STATE_NAME) .where(eq("key", (long) shard)); List<Row> results = session.execute(statement).all(); for (Row row : results) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Read shard: %d: - %s %s writetime(value): %s\n", row.getLong("key"), row.getString("column1"), row.getLong("value"), row.getLong("writetime(value)"))); } SlotState state = serDes.deserialize(row.getString("column1")); state.withTimestamp(row.getLong("value")) .withLastUpdatedTimestamp(row.getLong("writetime(value)") / 1000); slotStates.add(state); } return slotStates; } finally { ctx.stop(); } }

Target:
public Collection<SlotState> getShardState(int shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_STATE_NAME); final Collection<SlotState> slotStates = new LinkedList<SlotState>(); Session session = DatastaxIO.getSession(); try { Select.Where statement = QueryBuilder .select() .column("key") .column("column1") .column("value") .writeTime("value") .from(CassandraModel.CF_METRICS_STATE_NAME) .where(eq("key", (long) shard)); List<Row> results = session.execute(statement).all(); for (Row row : results) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Read shard: %d: - %s %s writetime(value): %s\n", row.getLong("key"), row.getString("column1"), row.getLong("value"), row.getLong("writetime(value)"))); } SlotState state = serDes.deserialize(row.getString("column1")); state.withTimestamp(row.getLong("value")) .withLastUpdatedTimestamp(row.getLong("writetime(value)") / 1000); slotStates.add(state); } return slotStates; } finally { ctx.stop(); } }
Source:
public static void saveEditors(Collection projects) { if (!BuildAction.isSaveAllSet()) { return; } IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { IWorkbenchPage[] pages = window.getPages(); for (IWorkbenchPage page : pages) { if (projects == null) { page.saveAllEditors(false); } else { IEditorPart[] editors = page.getDirtyEditors(); for (IEditorPart editor : editors) { IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); if (inputFile != null) { if (projects.contains(inputFile.getProject())) { page.saveEditor(editor, false); } } } } } } }

Target:
public static void saveEditors(Collection projects) { if (!BuildAction.isSaveAllSet()) { return; } IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { for (IWorkbenchPage page : window.getPages()) { if (projects == null) { page.saveAllEditors(false); } else { for (IEditorPart editor : page.getDirtyEditors()) { IFile inputFile = ResourceUtil.getFile(editor.getEditorInput()); if (inputFile != null) { if (projects.contains(inputFile.getProject())) { page.saveEditor(editor, false); } } } } } } }
Source:
ReceiveConfig(final Config config) { checkReceivedObjects = config.getBoolean( "receive", "fsckobjects", config.getBoolean("transfer", "fsckobjects", false)); allowLeadingZeroFileMode = checkReceivedObjects && config.getBoolean("fsck", "allowLeadingZeroFileMode", false); safeForWindows = checkReceivedObjects && config.getBoolean("fsck", "safeForWindows", false); safeForMacOS = checkReceivedObjects && config.getBoolean("fsck", "safeForMacOS", false); allowCreates = true; allowDeletes = !config.getBoolean("receive", "denydeletes", false); allowNonFastForwards = !config.getBoolean("receive", "denynonfastforwards", false); allowOfsDelta = config.getBoolean("repack", "usedeltabaseoffset", true); certNonceSeed = config.getString("receive", "", "certnonceseed"); certNonceSlopLimit = config.getInt("receive", "certnonceslop", 0); }

Target:
ReceiveConfig(final Config config) { checkReceivedObjects = config.getBoolean( "receive", "fsckobjects", config.getBoolean("transfer", "fsckobjects", false)); allowLeadingZeroFileMode = checkReceivedObjects && config.getBoolean("fsck", "allowLeadingZeroFileMode", false); safeForWindows = checkReceivedObjects && config.getBoolean("fsck", "safeForWindows", false); safeForMacOS = checkReceivedObjects && config.getBoolean("fsck", "safeForMacOS", false); allowCreates = true; allowDeletes = !config.getBoolean("receive", "denydeletes", false); allowNonFastForwards = !config.getBoolean("receive", "denynonfastforwards", false); allowOfsDelta = config.getBoolean("repack", "usedeltabaseoffset", true); certNonceSeed = config.getString("receive", null, "certnonceseed"); certNonceSlopLimit = config.getInt("receive", "certnonceslop", 0); }
Source:
public LocalDateTime getStartDate() { int firstDataLine = -1; String message = ""; if (null == startDate) { try { loadContents(); firstDataLine = getFirstDataLine(); startDate = getDate(firstDataLine); } catch (DataFileException e) { message = e.getMessage(); } catch (IndexOutOfBoundsException arrex) { message = "Date column don't exist."; } if (!"".equals(message)) { if (firstDataLine > -1) { addMessage(firstDataLine, message); } else { addMessage(message); } } } return startDate; }

Target:
public LocalDateTime getStartDate() { int firstDataLine = -1; String message = ""; if (null == startDate) { try { loadContents(); firstDataLine = getFirstDataLine(); startDate = getDate(firstDataLine); } catch (DataFileException e) { message = e.getMessage(); } catch (IndexOutOfBoundsException arrex) { message = "Date column doesn't exist."; } if (!"".equals(message)) { if (firstDataLine > -1) { addMessage(firstDataLine, message); } else { addMessage(message); } } } return startDate; }
Source:
public void shouldDisplayEndpointParametersInOrderAfterMethodParametersUpdateInWorkingCopy() throws CoreException { final IMethod modifiedMethod = remodifyJavaMethod(modifyJavaMethod(WORKING_COPY)); final JaxrsResourceMethod resourceMethod = getResourceMethod(); resourceMethod.update(modifiedMethod, JdtUtils.parse(modifiedMethod, null)); final JaxrsEndpoint endpoint = metamodel.findEndpoints(resourceMethod).iterator().next(); endpoint.update(new Flags(F_PATH_ANNOTATION + F_QUERY_PARAM_ANNOTATION + F_MATRIX_PARAM_ANNOTATION)); WorkbenchTasks.waitForTasksToComplete(javaProject.getProject().getWorkspace()); final String uriPathTemplate = endpoint.getUriPathTemplate(); assertThat( uriPathTemplate, equalTo("/hello/customers/{foo:\\d+}/{bar:[a-z]+};matrixParam1={short};matrixParam2={List<String>};matrixParam3={String}?queryParam1={long}")); }

Target:
public void shouldDisplayEndpointParametersInOrderAfterMethodParametersUpdateInWorkingCopy() throws CoreException { final IMethod modifiedMethod = remodifyJavaMethod(modifyJavaMethod(WORKING_COPY)); final JaxrsResourceMethod resourceMethod = getResourceMethod(); resourceMethod.update(modifiedMethod, JdtUtils.parse(modifiedMethod, null)); final JaxrsEndpoint endpoint = metamodel.findEndpoints(resourceMethod).iterator().next(); endpoint.update(new Flags(F_PATH_ANNOTATION + F_QUERY_PARAM_ANNOTATION + F_MATRIX_PARAM_ANNOTATION)); WorkbenchTasks.waitForTasksToComplete(getWorkspace(javaProject)); final String uriPathTemplate = endpoint.getUriPathTemplate(); assertThat( uriPathTemplate, equalTo("/hello/customers/{foo:\\d+}/{bar:[a-z]+};matrixParam1={short};matrixParam2={List<String>};matrixParam3={String}?queryParam1={long}")); }
Source:
public boolean isSatisfied(CommandContext ctx) { if(satisfied == null) { satisfied = checkAccess(ctx); if(satisfied) { CliLogger.ROOT_LOGGER.accessRequirementSatisfied(toString()); } else { CliLogger.ROOT_LOGGER.accessRequirementNotSatisfied(toString()); } } return satisfied; }

Target:
public boolean isSatisfied(CommandContext ctx) { if(satisfied == null) { satisfied = checkAccess(ctx); if(satisfied) { CliLogger.ROOT_LOGGER.tracef("Requirement %s is satisfied", this); } else { CliLogger.ROOT_LOGGER.tracef("Requirement %s is not satisfied", this); } } return satisfied; }
Source:
private Set<QualifiedTablePrefix> calculatePrefixesWithSchemaName( ConnectorSession connectorSession, TupleDomain<ColumnHandle> constraint, Predicate<Map<ColumnHandle, NullableValue>> predicate) { Optional<Set<String>> schemas = stringFilter(constraint, SCHEMA_COLUMN_HANDLE); if (schemas.isPresent()) { return schemas.get().stream() .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); } Session session = ((FullConnectorSession) connectorSession).getSession(); return metadata.listSchemaNames(session, catalogName).stream() .filter(schema -> predicate.test(ImmutableMap.of( CATALOG_COLUMN_HANDLE, new NullableValue(createUnboundedVarcharType(), utf8Slice(catalogName)), SCHEMA_COLUMN_HANDLE, new NullableValue(createUnboundedVarcharType(), utf8Slice(schema))))) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); }

Target:
private Set<QualifiedTablePrefix> calculatePrefixesWithSchemaName( ConnectorSession connectorSession, TupleDomain<ColumnHandle> constraint, Predicate<Map<ColumnHandle, NullableValue>> predicate) { Optional<Set<String>> schemas = filterString(constraint, SCHEMA_COLUMN_HANDLE); if (schemas.isPresent()) { return schemas.get().stream() .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); } Session session = ((FullConnectorSession) connectorSession).getSession(); return metadata.listSchemaNames(session, catalogName).stream() .filter(schema -> predicate.test(schemaAsFixedValues(schema))) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); }
Source:
public FollowerBean(Follower follower, ZooKeeperServer zks) { super(zks, "FollowerServer_port" + zks.getClientPort()); this.follower = follower; }

Target:
public FollowerBean(Follower follower, ZooKeeperServer zks) { super(zks, "Follower"); this.follower = follower; }
Source:
protected JsonPayloadGenerator getPayloadGenerator() { if (!validate()) { return null; } String j = jsonTextArea.getText(); int i = numberOfPayloadsSpinner.getValue(); return new JsonPayloadGenerator(j, i); }

Target:
protected JsonPayloadGenerator getPayloadGenerator() { if (!validate()) { return null; } return new JsonPayloadGenerator(jsonTextArea.getText(), numberOfPayloadsSpinner.getValue()); }
Source:
public CompositeFileListFilter(Collection<? extends FileListFilter<F>> fileFilters) { this.fileFilters = new LinkedHashSet<>(fileFilters); fileFilters.stream().allMatch(f -> f.supportsSingleFileFiltering()); }

Target:
public CompositeFileListFilter(Collection<? extends FileListFilter<F>> fileFilters) { this.fileFilters = new LinkedHashSet<>(fileFilters); this.allSupportAccept = fileFilters.stream().allMatch(FileListFilter<F>::supportsSingleFileFiltering); }
Source:
void processContainersNow() { containerManager.getContainerIDs() .parallelStream().forEach(this::processContainer); }

Target:
synchronized void processContainersNow() { notify(); }
Source:
private void assertDiskDescriptionMap(Disk disk) throws IOException { assertEquals("Should be map of disk alias and disk description", String.format("{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}", disk.getDiskAlias(), StringUtils.defaultString(disk.getDiskDescription())), MetadataDiskDescriptionHandler.getJsonDiskDescription(disk)); }

Target:
private static void assertDiskDescriptionMap(Disk disk) throws IOException { assertEquals("Should be map of disk alias and disk description", String.format("{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}", disk.getDiskAlias(), StringUtils.defaultString(disk.getDiskDescription())), MetadataDiskDescriptionHandler.getJsonDiskDescription(disk)); }
Source:
public void listenTag(ReplaceableTagEvent event) { if (!event.matches("LISTENER")) return; if (!event.getType().equalsIgnoreCase(id)) return; if (event.getValue().equalsIgnoreCase("region")) { event.setReplaced(region); } else if (event.getValue().equalsIgnoreCase("required")) { event.setReplaced(String.valueOf(required)); } else if (event.getValue().equalsIgnoreCase("currentkills")) { event.setReplaced(String.valueOf(kills_so_far)); } else if (event.getValue().equalsIgnoreCase("targets")) { String targetList = ""; for (String curTar : targets){ targetList = targetList + curTar + ", "; targetList = targetList.substring(0, targetList.length() - 1); } event.setReplaced(targetList); } else if (event.getValue().equalsIgnoreCase("mobnames")){ String namesList = ""; for (String curNam : names){ namesList = namesList + curNam + ", "; namesList = namesList.substring(0, namesList.length() - 1); } } }

Target:
public void listenTag(ReplaceableTagEvent event) { if (!event.matches("LISTENER")) return; if (!event.getType().equalsIgnoreCase(id)) return; if (event.getValue().equalsIgnoreCase("region")) { event.setReplaced(region); } else if (event.getValue().equalsIgnoreCase("required")) { event.setReplaced(String.valueOf(required)); } else if (event.getValue().equalsIgnoreCase("currentkills")) { event.setReplaced(String.valueOf(kills_so_far)); } else if (event.getValue().equalsIgnoreCase("targets")) { String targetList = ""; for (String curTar : targets){ targetList = targetList + curTar + ", "; targetList = targetList.substring(0, targetList.length() - 1); } event.setReplaced(targetList); } else if (event.getValue().equalsIgnoreCase("mobnames")){ String namesList = ""; for (String curNam : names){ namesList = namesList + curNam + ", "; namesList = namesList.substring(0, namesList.length() - 1); } event.setReplaced(namesList); } }
Source:
DefaultMetricsMaster(CoreMasterContext masterContext, Clock clock, ExecutorServiceFactory executorServiceFactory) { super(masterContext, clock, executorServiceFactory); mMetricsStore = new MetricsStore(); registerAggregators(); mClusterMetricsUpdater = new HeartbeatThread(HeartbeatContext.MASTER_CLUSTER_METRICS_UPDATER, new ClusterMetricsUpdater(), ServerConfiguration.getMs(PropertyKey.MASTER_CLUSTER_METRICS_UPDATE_INTERVAL), ServerConfiguration.global(), mMasterContext.getUserState()); int numThreads = ServerConfiguration.getInt(PropertyKey.MASTER_METRICS_SERVICE_THREADS); mExecutorService = ExecutorServiceFactories.fixedThreadPool( "alluxio-master-metrics-service", numThreads).create(); }

Target:
DefaultMetricsMaster(CoreMasterContext masterContext, Clock clock, ExecutorServiceFactory executorServiceFactory) { super(masterContext, clock, executorServiceFactory); mMetricsStore = new MetricsStore(); registerAggregators(); mClusterMetricsUpdater = new HeartbeatThread(HeartbeatContext.MASTER_CLUSTER_METRICS_UPDATER, new ClusterMetricsUpdater(), ServerConfiguration.getMs(PropertyKey.MASTER_CLUSTER_METRICS_UPDATE_INTERVAL), ServerConfiguration.global(), mMasterContext.getUserState()); int numThreads = ServerConfiguration.getInt(PropertyKey.MASTER_METRICS_SERVICE_THREADS); mExecutorService = ExecutorServiceFactories.fixedThreadPool( "alluxio-master-metrics-updater", numThreads).create(); }
Source:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; List<AttributeHandleIdenfier> list = getChecks(); for (AttributeHandleIdenfier attributeHandleIdenfier : list) { if (attributeHandleIdenfier.check(message) != null) { try { User user = perunSession.getPerunBl().getUsersManagerBl().getUserById(perunSession, attributeHandleIdenfier.check(message)); Attribute attribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, user, getDestinationAttributeName()); if (attribute.valueAsList() == null || attribute.valueAsList().isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); resolvingMessages.add(new AttributeRemovedForUser(attributeDefinition, user)); } else { resolvingMessages.add(new AttributeSetForUser(attribute, user)); } } catch (UserNotExistsException e) { log.warn("User from UserExtSource doesn't exist in Perun. This occurred while parsing message: {}.", attributeHandleIdenfier.check(message), message); } } } return resolvingMessages; }

Target:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; List<AttributeHandleIdentifier> list = getHandleIdentifiers(); for (AttributeHandleIdentifier attributeHandleIdenfier : list) { Integer userId = attributeHandleIdenfier.shouldBeEventHandled(message); if (userId != null) { try { User user = perunSession.getPerunBl().getUsersManagerBl().getUserById(perunSession, userId); Attribute attribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, user, getDestinationAttributeName()); if (attribute.valueAsList() == null || attribute.valueAsList().isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); resolvingMessages.add(new AttributeRemovedForUser(attributeDefinition, user)); } else { resolvingMessages.add(new AttributeSetForUser(attribute, user)); } } catch (UserNotExistsException e) { log.warn("User from UserExtSource doesn't exist in Perun. This occurred while parsing message: {}.", message); } } } return resolvingMessages; }
Source:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_RADIO_BUTTON) { @Override public void run() { if (fIsFlatViewClicked) { ITmfTrace parentTrace = getTrace(); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>)(Object)getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); } fIsFlatViewClicked = false; refresh(); } } }; action.setChecked(true); action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }

Target:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_PUSH_BUTTON) { @Override public void run() { ITmfTrace parentTrace = getTrace(); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>)(Object)getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); refresh(); } } }; action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }
Source:
public <U> UpdateHandlerRegistration<U> registerUpdateHandler( SubscriptionQueryMessage<?, ?, ?> query, int updateBufferSize) { Sinks.Many<SubscriptionQueryUpdateMessage<U>> sink = Sinks.many().replay().limit(updateBufferSize); Runnable removeHandler = () -> updateHandlers.remove(query); Flux<SubscriptionQueryUpdateMessage<U>> updateMessageFlux = sink.asFlux() .doOnCancel(removeHandler) .doOnTerminate(removeHandler); FluxSinkWrapper<SubscriptionQueryUpdateMessage<U>> fluxSinkWrapper = new FluxSinkWrapper<>(sink); updateHandlers.put(query, fluxSinkWrapper); Registration registration = () -> { fluxSinkWrapper.complete(); return true; }; return new UpdateHandlerRegistration<>(registration, updateMessageFlux); }

Target:
public <U> UpdateHandlerRegistration<U> registerUpdateHandler( SubscriptionQueryMessage<?, ?, ?> query, int updateBufferSize) { Sinks.Many<SubscriptionQueryUpdateMessage<U>> sink = Sinks.many().replay().limit(updateBufferSize); Runnable removeHandler = () -> updateHandlers.remove(query); Flux<SubscriptionQueryUpdateMessage<U>> updateMessageFlux = sink.asFlux() .doOnCancel(removeHandler) .doOnTerminate(removeHandler); SinksManyWrapper<SubscriptionQueryUpdateMessage<U>> sinksManyWrapper = new SinksManyWrapper<>(sink); updateHandlers.put(query, sinksManyWrapper); Registration registration = () -> { sinksManyWrapper.complete(); return true; }; return new UpdateHandlerRegistration<>(registration, updateMessageFlux); }
Source:
@Test public void hasValue_FailingWithAbsent() { try { ASSERT.that(Optional.absent()).hasValue("foo"); fail("Should have thrown"); } catch (AssertionError expected) { ASSERT.that(expected.getMessage()) .isEqualTo("<Optional.absent()> cannot have the value <foo>"); } }

Target:
@Test public void hasValue_FailingWithAbsent() { try { ASSERT.that(Optional.absent()).hasValue("foo"); fail("Should have thrown"); } catch (AssertionError expected) { ASSERT.that(expected.getMessage()) .isEqualTo("Not true that <Optional.absent()> has value <foo>"); } }
Source:
public boolean validate(IDocument document, int offset, DocumentEvent event) { if (!isOffsetValid(offset)) return fIsValidated= false; CompletionProposal coreProposal= ((MemberProposalInfo) getProposalInfo()).fProposal; if (coreProposal.isSuffixProposal()) fIsValidated= isValidPrefix(getPrefix(document, offset)); if (fIsValidated && event != null) { int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength; final int newLength= Math.max(getReplacementLength() + delta, 0); setReplacementLength(newLength); } return fIsValidated; }

Target:
public boolean validate(IDocument document, int offset, DocumentEvent event) { if (!isOffsetValid(offset)) return fIsValidated= false; if (isSupportingRequiredProposals()) { CompletionProposal coreProposal= ((MemberProposalInfo) getProposalInfo()).fProposal; if (coreProposal.isSuffixProposal()) fIsValidated= isValidPrefix(getPrefix(document, offset)); } else fIsValidated= isValidPrefix(getPrefix(document, offset)); if (fIsValidated && event != null) { int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength; final int newLength= Math.max(getReplacementLength() + delta, 0); setReplacementLength(newLength); } return fIsValidated; }
Source:
static String spliceOrAppendString(final String destination, final String toInsert, final int insertIdx) { if (destination.equals(Allele.SPAN_DEL_STRING)) { return destination; } if (insertIdx <= destination.length()) { return destination.substring(0, insertIdx) + toInsert + destination.substring(insertIdx); } else { return destination + toInsert; } }

Target:
static String spliceOrAppendString(final String destination, final String toInsert, final int insertIdx) { if (destination.equals(Allele.SPAN_DEL_STRING)) { return destination; } if (insertIdx <= destination.length()) { return destination.substring(0, insertIdx) + toInsert + destination.substring(insertIdx); } return destination + toInsert; }
Source:
public void gitHubURLPageElementTest() { assertEquals("123", GithubURLPageElements.extractIssueNumber("fixes #123").get()); assertEquals("123", GithubURLPageElements.extractIssueNumber("Closed #123. This is dummy").get()); assertEquals("123", GithubURLPageElements.extractIssueNumber("refer to #144. Closed #123. This is du").get()); assertNotEquals("131", GithubURLPageElements.extractIssueNumber("fixes #123").get()); }

Target:
public void gitHubURLPageElementTest() { assertEquals(123, (int) GithubURLPageElements.extractIssueNumber("fixes #123").get()); assertEquals(123, (int) GithubURLPageElements.extractIssueNumber("Closed #123. This is dummy").get()); assertEquals(123, (int) GithubURLPageElements.extractIssueNumber("refer to #144. Closed #123. This i").get()); }