auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static String createAllResponseResultClassVars(final ImmutableList<Ds3ResponseCode> responseCodes) { if (isEmpty(responseCodes)) { return ""; } final ImmutableMap<String, Ds3ResponseType> map = createUniqueDs3ResponseTypesMap(responseCodes); final ImmutableList.Builder<String> builder = ImmutableList.builder(); for (Map.Entry<String, Ds3ResponseType> entry : map.entrySet()) { builder.add("private " + convertType(entry.getValue().getType(), entry.getValue().getComponentType()) + " " + entry.getKey() + ";"); } return builder.build() .stream() .map(i -> indent(1) + i) .collect(Collectors.joining("\n")); }

Target:
public static String createAllResponseResultClassVars(final ImmutableList<Ds3ResponseCode> responseCodes) { if (isEmpty(responseCodes)) { return ""; } final ImmutableMap<String, Ds3ResponseType> map = createUniqueDs3ResponseTypesMap(responseCodes); final ImmutableList.Builder<String> builder = ImmutableList.builder(); for (final Map.Entry<String, Ds3ResponseType> entry : map.entrySet()) { builder.add("private " + convertType(entry.getValue().getType(), entry.getValue().getComponentType()) + " " + entry.getKey() + ";"); } return builder.build() .stream() .map(i -> indent(1) + i) .collect(Collectors.joining("\n")); }
Source:
public Link matchAnchor(Post.Builder post, CharSequence text, Element anchor, PostParser.Callback callback) { String href = anchor.attr("href"); if(href.matches(" href = href.substring(2); href = href.substring(href.indexOf('/')); } PostLinkable.Type t; Object value; Matcher externalMatcher = fullQuotePattern.matcher(href); if (externalMatcher.matches()) { String board = externalMatcher.group(1); int threadId = Integer.parseInt(externalMatcher.group(2)); int postId = Integer.parseInt(externalMatcher.group(3)); if (board.equals(post.board.code) && callback.isInternal(postId)) { t = PostLinkable.Type.QUOTE; value = postId; } else { t = PostLinkable.Type.THREAD; value = new PostLinkable.ThreadLink(board, threadId, postId); } } else { Matcher quoteMatcher = quotePattern.matcher(href); if (quoteMatcher.matches()) { t = PostLinkable.Type.QUOTE; value = Integer.parseInt(quoteMatcher.group(1)); } else { Matcher boardLinkMatcher = boardLinkPattern.matcher(href); Matcher boardSearchMatcher = boardSearchPattern.matcher(href); if(boardLinkMatcher.matches()) { t = PostLinkable.Type.BOARD; value = boardLinkMatcher.group(1); } else if (boardSearchMatcher.matches()) { String board = boardSearchMatcher.group(1); String search = boardSearchMatcher.group(2); t = PostLinkable.Type.SEARCH; value = new PostLinkable.SearchLink(board, search); } else { t = PostLinkable.Type.LINK; value = href; } } } Link link = new Link(); link.type = t; link.key = text; link.value = value; return link; }

Target:
public Link matchAnchor(Post.Builder post, CharSequence text, Element anchor, PostParser.Callback callback) { String href = anchor.attr("href"); if (href.matches(" href = href.substring(2); href = href.substring(href.indexOf('/')); } PostLinkable.Type t; Object value; Matcher externalMatcher = fullQuotePattern.matcher(href); if (externalMatcher.matches()) { String board = externalMatcher.group(1); int threadId = Integer.parseInt(externalMatcher.group(2)); int postId = Integer.parseInt(externalMatcher.group(3)); if (board.equals(post.board.code) && callback.isInternal(postId)) { t = PostLinkable.Type.QUOTE; value = postId; } else { t = PostLinkable.Type.THREAD; value = new PostLinkable.ThreadLink(board, threadId, postId); } } else { Matcher quoteMatcher = quotePattern.matcher(href); if (quoteMatcher.matches()) { t = PostLinkable.Type.QUOTE; value = Integer.parseInt(quoteMatcher.group(1)); } else { Matcher boardLinkMatcher = boardLinkPattern.matcher(href); Matcher boardLinkMatcher8Chan = boardLinkPattern8Chan.matcher(href); Matcher boardSearchMatcher = boardSearchPattern.matcher(href); if (boardLinkMatcher.matches() || boardLinkMatcher8Chan.matches()) { t = PostLinkable.Type.BOARD; value = boardLinkMatcher.matches() ? boardLinkMatcher.group(1) : boardLinkMatcher8Chan.group(1); } else if (boardSearchMatcher.matches()) { String board = boardSearchMatcher.group(1); String search = boardSearchMatcher.group(2); t = PostLinkable.Type.SEARCH; value = new PostLinkable.SearchLink(board, search); } else { t = PostLinkable.Type.LINK; value = href; } } } Link link = new Link(); link.type = t; link.key = text; link.value = value; return link; }
Source:
public void handleReconnect(ClientDescriptor clientDescriptor, byte[] extendedReconnectData) { ClientState clientState = this.clientStateMap.get(clientDescriptor); if (clientState == null) { LOGGER.error("Client trying to reconnect is not connected to entity.", clientDescriptor); return; } clientState.attach(); Set<String> cacheIds = reconnectDataCodec.decode(extendedReconnectData); for (final String cacheId : cacheIds) { ServerStoreImpl serverStore = ehcacheStateService.getStore(cacheId); if (serverStore == null) { LOGGER.error("ServerStore '{}' does not exist as expected by Client '{}'.", cacheId, clientDescriptor); continue; } serverStore.setEvictionListener(new ServerStoreEvictionListener() { @Override public void onEviction(long key) { invalidateHashAfterEviction(cacheId, key); } }); attachStore(clientDescriptor, cacheId); } LOGGER.info("Client '{}' successfully reconnected to newly promoted ACTIVE after failover.", clientDescriptor); }

Target:
public void handleReconnect(ClientDescriptor clientDescriptor, byte[] extendedReconnectData) { ClientState clientState = this.clientStateMap.get(clientDescriptor); if (clientState == null) { throw new AssertionError("Client "+ clientDescriptor +" trying to reconnect is not connected to entity"); } clientState.attach(); Set<String> cacheIds = reconnectDataCodec.decode(extendedReconnectData); for (final String cacheId : cacheIds) { ServerStoreImpl serverStore = ehcacheStateService.getStore(cacheId); if (serverStore == null) { LOGGER.warn("ServerStore '{}' does not exist as expected by Client '{}'.", cacheId, clientDescriptor); continue; } serverStore.setEvictionListener(new ServerStoreEvictionListener() { @Override public void onEviction(long key) { invalidateHashAfterEviction(cacheId, key); } }); attachStore(clientDescriptor, cacheId); } LOGGER.info("Client '{}' successfully reconnected to newly promoted ACTIVE after failover.", clientDescriptor); }
Source:
public Jackson2Config createCopy() { return new Jackson2Config().setMapper(mapper); }

Target:
public Jackson2Config createCopy() { return new Jackson2Config(this); }
Source:
protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsHolder) { super.checkFile(file, problemsHolder); ProgressManager.checkCanceled(); if (!GoTestFinder.isTestFile(file)) return; for (GoImportSpec importSpec : file.getImports()) { if (importSpec.isCImport()) { problemsHolder.registerProblem(importSpec, "Usage of cgo in tests is not supported.", new GoDeleteImportQuickFix()); } } }

Target:
protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsHolder) { if (!GoTestFinder.isTestFile(file)) return; for (GoImportSpec importSpec : file.getImports()) { if (importSpec.isCImport()) { problemsHolder.registerProblem(importSpec, "Usage of cgo in tests is not supported.", new GoDeleteImportQuickFix()); } } }
Source:
private Resource addLinks(Object original, Resource converted) { boolean add = false; if (original instanceof Host) { if (StringUtils.isNotEmpty((String) DataAccessor.getFields(original).get(EXTRACTED_CONFIG_FIELD))) { add = canAccessConfig(); } if (!add && StringUtils.isNotEmpty((String) converted.getFields().get(FIELD_DRIVER))) { add = canAccessConfig(); } Object imported = DataAccessor.fromDataFieldOf(original).withKey(HostConstants.FIELD_IMPORTED).get(); if (imported != null && (Boolean)imported) { Map<String, URL> links = converted.getLinks(); if (links != null) { links.remove("remove"); } } } if (add) { converted.getLinks().put(CONFIG_LINK, ApiContext.getUrlBuilder().resourceLink(converted, CONFIG_LINK)); } converted.getLinks().put(STORAGE_POOLS_LINK, ApiContext.getUrlBuilder().resourceLink(converted, STORAGE_POOLS_LINK)); return converted; }

Target:
private Resource addLinks(Object original, Resource converted) { boolean add = false; if (original instanceof Host) { if (StringUtils.isNotEmpty((String) DataAccessor.getFields(original).get(EXTRACTED_CONFIG_FIELD))) { add = canAccessConfig(); } if (!add && StringUtils.isNotEmpty((String) converted.getFields().get(FIELD_DRIVER))) { add = canAccessConfig(); } boolean imported = DataAccessor.fieldBool(original, HostConstants.FIELD_IMPORTED); if (imported) { Map<String, URL> links = converted.getLinks(); if (links != null) { links.remove("remove"); } } } if (add) { converted.getLinks().put(CONFIG_LINK, ApiContext.getUrlBuilder().resourceLink(converted, CONFIG_LINK)); } converted.getLinks().put(STORAGE_POOLS_LINK, ApiContext.getUrlBuilder().resourceLink(converted, STORAGE_POOLS_LINK)); return converted; }
Source:
public void rateLimitLog(String newMsg, String value) { long now = Time.currentElapsedTime(); if (newMsg.equals(msg)) { ++count; this.value = value; if (now - timestamp >= LOG_INTERVAL) { flush(); msg = newMsg; timestamp = now; this.value = value; } } else { flush(); msg = newMsg; this.value = value; timestamp = now; if (null == value) { LOG.warn("Message: {}", msg); } else { LOG.warn("Message: {}, Value: {}", msg, value); } } }

Target:
public void rateLimitLog(String newMsg, String value) { long now = getCurrentElapsedTime(); if (newMsg.equals(msg)) { if (now - timestamp >= LOG_INTERVAL) { flush(); msg = newMsg; timestamp = now; this.value = value; count = 1; } else { ++count; this.value = value; } } else { flush(); msg = newMsg; this.value = value; timestamp = now; if (null == value) { LOG.warn("Message: {}", msg); } else { LOG.warn("Message: Value: {}", msg, value); } } }
Source:
public BoxRequestsMetadata.DeleteItemMetadata getDeleteFolderMetadataTemplateRequest(String id, String template) { BoxRequestsMetadata.DeleteItemMetadata request = new BoxRequestsMetadata.DeleteItemMetadata(getFileMetadataUrl(id, template), mSession); return request; }

Target:
public BoxRequestsMetadata.DeleteItemMetadata getDeleteFolderMetadataTemplateRequest(String id, String template) { BoxRequestsMetadata.DeleteItemMetadata request = new BoxRequestsMetadata.DeleteItemMetadata(getFolderMetadataUrl(id, template), mSession); return request; }
Source:
void initializeAndPublishProxies() { for (Map.Entry<String, DistributedObjectFuture> entry : proxies.entrySet()) { DistributedObjectFuture future = entry.getValue(); if (!future.isSetAndInitialized()) { extractDistributedObject(future); publish(new DistributedObjectEventPacket(CREATED, serviceName, entry.getKey())); } } }

Target:
void initializeAndPublishProxies() { for (Map.Entry<String, DistributedObjectFuture> entry : proxies.entrySet()) { String name = entry.getKey(); DistributedObjectFuture future = entry.getValue(); if (!future.isSetAndInitialized()) { try { future.get(); } catch (Throwable e) { proxyService.logger.warning("Error while initializing proxy: " + name, e); future.setError(e); proxies.remove(entry.getKey()); throw rethrow(e); } publish(new DistributedObjectEventPacket(CREATED, serviceName, name)); } } }
Source:
public void courseDetailShared(String courseId, String aboutUrl, ShareUtils.ShareType method) { Event aEvent = new Event(); aEvent.properties.putValue(Keys.NAME, Values.SOCIAL_COURSE_DETAIL_SHARED); aEvent.data.putValue(Keys.NAME, courseId); aEvent.data.putValue(Keys.CATEGORY, Values.SOCIAL_SHARING); aEvent.data.putValue(Keys.URL, aboutUrl); aEvent.data.putValue(Keys.TYPE, Analytics.Util.getShareTypeValue(method)); aEvent.setAppNameContext(); tracker.track(Events.SOCIAL_COURSE_DETAIL_SHARED, aEvent.properties); }

Target:
public void courseDetailShared(String courseId, String aboutUrl, ShareUtils.ShareType method) { Event aEvent = new Event(); aEvent.properties.putValue(Keys.NAME, Values.SOCIAL_COURSE_DETAIL_SHARED); aEvent.data.putValue(Keys.NAME, courseId); aEvent.data.putValue(Keys.CATEGORY, Values.SOCIAL_SHARING); aEvent.data.putValue(Keys.URL, aboutUrl); aEvent.data.putValue(Keys.TYPE, getShareTypeValue(method)); aEvent.setAppNameContext(); tracker.track(Events.SOCIAL_COURSE_DETAIL_SHARED, aEvent.properties); }
Source:
public CodeSystemVersionEntry build(final Document doc) { return new CodeSystemVersionEntry( Mappings.longDocValuesField(VERSION_IMPORT_DATE).getValue(doc), Mappings.longDocValuesField(VERSION_EFFECTIVE_DATE).getValue(doc), Mappings.longDocValuesField(VERSION_EFFECTIVE_DATE).getValue(doc), Mappings.stringDocValuesField(VERSION_DESCRIPTION).getValue(doc), doc.get(VERSION_VERSION_ID), doc.get(TerminologyRegistryIndexConstants.VERSION_PARENT_BRANCH_PATH) != null ? doc.get(TerminologyRegistryIndexConstants.VERSION_PARENT_BRANCH_PATH): "MAIN", Mappings.longDocValuesField(VERSION_STORAGE_KEY).getValue(doc), doc.get(VERSION_REPOSITORY_UUID), doc.get(VERSION_SYSTEM_SHORT_NAME)); }

Target:
public CodeSystemVersionEntry build(final Document doc) { return new CodeSystemVersionEntry( Mappings.longField(VERSION_IMPORT_DATE).getValue(doc), Mappings.longField(VERSION_EFFECTIVE_DATE).getValue(doc), Mappings.longField(VERSION_LATEST_UPDATE_DATE).getValue(doc), doc.get(VERSION_DESCRIPTION), doc.get(VERSION_VERSION_ID), doc.get(TerminologyRegistryIndexConstants.VERSION_PARENT_BRANCH_PATH) != null ? doc.get(TerminologyRegistryIndexConstants.VERSION_PARENT_BRANCH_PATH): "MAIN", Mappings.longDocValuesField(VERSION_STORAGE_KEY).getValue(doc), doc.get(VERSION_REPOSITORY_UUID), doc.get(VERSION_SYSTEM_SHORT_NAME)); }
Source:
public static DistributedQueryRunner createRaptorQueryRunner( Map<String, String> extraProperties, boolean loadTpch, boolean bucketed, Map<String, String> extraRaptorProperties) throws Exception { DistributedQueryRunner queryRunner = new DistributedQueryRunner(createSession("tpch"), 2, extraProperties); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); queryRunner.installPlugin(new RaptorPlugin()); File baseDir = queryRunner.getCoordinator().getBaseDataDir().toFile(); Map<String, String> raptorProperties = ImmutableMap.<String, String>builder() .putAll(extraRaptorProperties) .put("metadata.db.type", "h2") .put("metadata.db.connections.max", "100") .put("metadata.db.filename", new File(baseDir, "db").getAbsolutePath()) .put("storage.data-directory", new File(baseDir, "data").getAbsolutePath()) .put("storage.max-shard-rows", "2000") .put("storage.max-files-created", "200") .put("backup.provider", "file") .put("backup.directory", new File(baseDir, "backup").getAbsolutePath()) .build(); queryRunner.createCatalog("raptor", "raptor", raptorProperties); if (loadTpch) { copyTables(queryRunner, "tpch", createSession(), bucketed); } return queryRunner; }

Target:
public static DistributedQueryRunner createRaptorQueryRunner( Map<String, String> extraProperties, boolean loadTpch, boolean bucketed, Map<String, String> extraRaptorProperties) throws Exception { DistributedQueryRunner queryRunner = new DistributedQueryRunner(createSession("tpch"), 2, extraProperties); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); queryRunner.installPlugin(new RaptorPlugin()); File baseDir = queryRunner.getCoordinator().getBaseDataDir().toFile(); Map<String, String> raptorProperties = ImmutableMap.<String, String>builder() .putAll(extraRaptorProperties) .put("metadata.db.type", "h2") .put("metadata.db.connections.max", "100") .put("metadata.db.filename", new File(baseDir, "db").getAbsolutePath()) .put("storage.data-directory", new File(baseDir, "data").getAbsolutePath()) .put("storage.max-shard-rows", "2000") .put("backup.provider", "file") .put("backup.directory", new File(baseDir, "backup").getAbsolutePath()) .build(); queryRunner.createCatalog("raptor", "raptor", raptorProperties); if (loadTpch) { copyTables(queryRunner, "tpch", createSession(), bucketed); } return queryRunner; }
Source:
protected void onInit() throws Exception { super.onInit(); ResultFactory generatedResultFactory = XmlNamespaceUtils.configureResultFactory(resultType, resultFactoryName,this.getBeanFactory()); if(generatedResultFactory != null){ resultFactory=generatedResultFactory; } boolean resultFactorySpecified = StringUtils.hasText(resultFactoryName) || StringUtils.hasText(resultType); if(resultFactorySpecified){ alwaysUseResultFactory=true; } this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); if (this.templates == null) { TransformerFactory transformerFactory; if (this.transformerFactoryClassName != null) { transformerFactory = TransformerFactory.newInstance(this.transformerFactoryClassName, this.classLoader); } else { transformerFactory = TransformerFactory.newInstance(); } this.templates = transformerFactory.newTemplates(createStreamSourceOnResource(this.xslResource)); } }

Target:
protected void onInit() throws Exception { super.onInit(); boolean resultFactorySpecified = StringUtils.hasText(this.getResultFactoryName()) || StringUtils.hasText(this.getResultType()); if(resultFactorySpecified){ alwaysUseResultFactory=true; } this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); if (this.templates == null) { TransformerFactory transformerFactory; if (this.transformerFactoryClassName != null) { transformerFactory = TransformerFactory.newInstance(this.transformerFactoryClassName, this.classLoader); } else { transformerFactory = TransformerFactory.newInstance(); } this.templates = transformerFactory.newTemplates(createStreamSourceOnResource(this.xslResource)); } }
Source:
public <E> void save( E configuration, File configurationFile, ConfigurationWriter<E> writer) throws IOException { Writer fw = null; try { configurationFile.getParentFile().mkdirs(); File tempFile = new File(configurationFile.getParentFile(), configurationFile.getName() + ".tmp"); fw = new BufferedWriter( new FileWriter( tempFile ) ); writer.write( fw, configuration ); fw.flush(); Files.move( tempFile, configurationFile ); } finally { IOUtils.closeQuietly( fw ); } }

Target:
public <E> void save( E configuration, File configurationFile, ConfigurationWriter<E> writer) throws IOException { Writer fw = null; try { configurationFile.getParentFile().mkdirs(); File tempFile = new File(configurationFile.getParentFile(), configurationFile.getName() + ".tmp"); fw = new BufferedWriter( new FileWriter( tempFile ) ); writer.write( fw, configuration ); fw.flush(); fw.close(); Files.move( tempFile, configurationFile ); } finally { IOUtils.closeQuietly( fw ); } }
Source:
default Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes) { SymbolReference<ResolvedMethodDeclaration> methodSolved = solveMethod(name, argumentsTypes, false); if (methodSolved.isSolved()) { ResolvedMethodDeclaration methodDeclaration = methodSolved.getCorrespondingDeclaration(); MethodUsage methodUsage; if (methodDeclaration instanceof TypeVariableResolutionCapability) { methodUsage = ((TypeVariableResolutionCapability) methodDeclaration) .resolveTypeVariables(this, argumentsTypes); } else { return Optional.empty(); } return Optional.of(methodUsage); } else { return Optional.empty(); } }

Target:
default Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes) { SymbolReference<ResolvedMethodDeclaration> methodSolved = solveMethod(name, argumentsTypes, false); if (methodSolved.isSolved()) { ResolvedMethodDeclaration methodDeclaration = methodSolved.getCorrespondingDeclaration(); MethodUsage methodUsage; if (methodDeclaration instanceof TypeVariableResolutionCapability) { methodUsage = ((TypeVariableResolutionCapability) methodDeclaration) .resolveTypeVariables(this, argumentsTypes); } else { throw new UnsupportedOperationException("Resolved method declarations should have the " + TypeVariableResolutionCapability.class.getName() + "."); } return Optional.of(methodUsage); } else { return Optional.empty(); } }
Source:
public final Observable<T> distinctUntilChanged(Func2<? super T, ? super T, Boolean> comparator) { return lift(new OperatorDistinctUntilChanged<>(new Func1<T, Object>() { T previousValue; @Override public Object call(T t) { if (previousValue != null) { if (comparator.call(previousValue, t)) { return previousValue; } else { previousValue = t; return t; } } else { previousValue = t; return previousValue; } } })); }

Target:
public final Observable<T> distinctUntilChanged(Func2<? super T, ? super T, Boolean> comparator) { return lift(new OperatorDistinctUntilChanged<T, Void>(comparator)); }
Source:
protected void onCheckBoxClick(int position) { if (selectionMode == SINGLE) { boolean currentState = selectionManager.isPositionSelected(position); for (int i : selectionManager.getSelectedPositions()) { selectionManager.setSelectionTo(false, i); notifyItemChanged(i); } selectionManager.setSelectionTo(!currentState, position); notifyItemChanged(position); } else if (selectionMode == PAIRS) { if (selectionManager.getSelectedPositions().size() < numberMergeSelections) { selectionManager.toggleSelection(position); } else { selectionManager.setSelectionTo(false, position); notifyItemChanged(position); } } else { selectionManager.toggleSelection(position); } selectionListener.onSelectionChanged(selectionManager.getSelectedPositions().size()); }

Target:
protected void onCheckBoxClick(int position) { if (selectionMode == SINGLE) { boolean currentState = selectionManager.isPositionSelected(position); for (int i : selectionManager.getSelectedPositions()) { selectionManager.setSelectionTo(false, i); notifyItemChanged(i); } selectionManager.setSelectionTo(!currentState, position); notifyItemChanged(position); } else if (selectionMode == PAIRS) { if (selectionManager.getSelectedPositions().size() < 2) { selectionManager.toggleSelection(position); } else { selectionManager.setSelectionTo(false, position); notifyItemChanged(position); } } else { selectionManager.toggleSelection(position); } selectionListener.onSelectionChanged(selectionManager.getSelectedPositions().size()); }
Source:
public PeriodicSchedule createSchedule() { List<LocalDate> unadj = createUnadjustedDates(); List<LocalDate> adj = applyBusinessDayAdjustment(unadj); RollConvention rollConv = getEffectiveRollConvention(); List<SchedulePeriod> periods = new ArrayList<>(); for (int i = 0; i < unadj.size() - 1; i++) { SchedulePeriodType type = SchedulePeriodType.of(i, unadj.size()); periods.add( SchedulePeriod.of(type, adj.get(i), adj.get(i + 1), unadj.get(i), unadj.get(i + 1), frequency, rollConv)); } return PeriodicSchedule.of(periods); }

Target:
public PeriodicSchedule createSchedule() { List<LocalDate> unadj = createUnadjustedDates(); List<LocalDate> adj = applyBusinessDayAdjustment(unadj); RollConvention rollConv = getEffectiveRollConvention(); List<SchedulePeriod> periods = new ArrayList<>(); for (int i = 0; i < unadj.size() - 1; i++) { periods.add( SchedulePeriod.builder() .type(SchedulePeriodType.of(i, unadj.size())) .startDate(adj.get(i)) .endDate(adj.get(i + 1)) .unadjustedStartDate(unadj.get(i)) .unadjustedEndDate(unadj.get(i + 1)) .frequency(frequency) .rollConvention(rollConv) .build()); } return PeriodicSchedule.of(periods); }
Source:
protected String processACHBatchDetail(PayeeACHAccountExtractDetail achDetail) { LOG.info("processACHBatchDetail: Starting processACHBatchDetail for: " + achDetail.getLogData()); Person payee = personService.getPersonByPrincipalName(achDetail.getNetID()); String processingError; processingError = validateACHBatchDetail(achDetail, payee); if (StringUtils.isNotBlank(processingError)) { return processingError; } processingError = addOrUpdateACHAccountIfNecessary(payee, achDetail, PayeeIdTypeCodes.ENTITY, payee.getEntityId()); if (StringUtils.isNotBlank(processingError)) { return processingError; } processingError = addOrUpdateACHAccountIfNecessary(payee, achDetail, PayeeIdTypeCodes.EMPLOYEE, payee.getEmployeeId()); return processingError; }

Target:
protected String processACHBatchDetail(PayeeACHAccountExtractDetail achDetail) { LOG.info("processACHBatchDetail: Starting processACHBatchDetail for: " + achDetail.getLogData()); Person payee = personService.getPersonByPrincipalName(achDetail.getNetID()); String processingError = validateACHBatchDetail(achDetail, payee); if (StringUtils.isNotBlank(processingError)) { return processingError; } processingError = addOrUpdateACHAccountIfNecessary(payee, achDetail, PayeeIdTypeCodes.ENTITY, payee.getEntityId()); if (StringUtils.isNotBlank(processingError)) { return processingError; } processingError = addOrUpdateACHAccountIfNecessary(payee, achDetail, PayeeIdTypeCodes.EMPLOYEE, payee.getEmployeeId()); return processingError; }
Source:
Set<String> getSupportedRecipes() { return runtimes.getSupportedRecipes(); }

Target:
public Set<String> getSupportedRecipes() { return runtimes.getSupportedRecipes(); }
Source:
public String index(Request request, Response response) throws IOException { List<String> resourceList = goConfigService.getResourceList(); return GSON.toJson(resourceList); }

Target:
public String index(Request request, Response response) throws IOException { List<String> resourceList = goConfigService.getResourceList(); return JsonOutputWriter.OBJECT_MAPPER.writeValueAsString(resourceList); }
Source:
private void setTags(ProgData progData, Content content) { Set<String> tagsFromGenres = paTagMap.map(content.getGenres()); if (!tagsFromGenres.isEmpty()) { content.setTags(tagsFromGenres); } }

Target:
private void setTags(ProgData progData, Content content) { Set<String> tagsFromGenres = paTagMap.map(content.getGenres()); content.setTags(tagsFromGenres); }
Source:
default ConnectionDetails getConnectionDetails() { ConnectionDetails connectionDetails = getSource().getConnectionDetails(); if (connectionDetails == null) { throw new IllegalStateException("ConnectionDetails undefined for: " + getSource().getName()); } return getSource().getConnectionDetails(); }

Target:
default ConnectionDetails getConnectionDetails() { ConnectionDetails connectionDetails = getSource().getConnectionDetails(); if (connectionDetails == null) { throw new IllegalStateException("ConnectionDetails undefined for: " + getSource().getName()); } return connectionDetails; }
Source:
@Test void testArrowSchema() { Source source = Sources.of(ArrowTest.class.getResource("/files")); ArrowSchema arrowSchema = new ArrowSchema(source.file().getAbsoluteFile()); Map<String, Table> tableMap = arrowSchema.getTableMap(); }

Target:
@Test void testArrowSchema() { Source source = Sources.of(ArrowTest.class.getResource("/arrow")); ArrowSchema arrowSchema = new ArrowSchema(source.file().getAbsoluteFile()); Map<String, Table> tableMap = arrowSchema.getTableMap(); RelDataType relDataType = tableMap.get("TEST").getRowType(new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT)); Assertions.assertEquals(relDataType.getFieldNames().get(0), "fieldOne"); Assertions.assertEquals(relDataType.getFieldNames().get(1), "fieldTwo"); Assertions.assertEquals(relDataType.getFieldNames().get(2), "fieldThree"); }
Source:
protected void startScan() { logger.debug("Starting Astro discovery scan"); String result = null; try { result = HttpUtil.executeUrl("GET", "<LINK_1>,lon", 5000); } catch (IOException e) { logger.warn("Can't get latitude and longitude for the current location: {}", e); } if (result != null) { String lat = StringUtils.trim(StringUtils.substringBetween(result, "\"lat\":", ",")); String lon = StringUtils.trim(StringUtils.substringBetween(result, "\"lon\":", "}")); try { double latitude = Double.parseDouble(lat); double longitude = Double.parseDouble(lon); logger.info("Evaluated Astro geolocation: latitude: {}, longitude: {}", latitude, longitude); ThingTypeUID sunType = new ThingTypeUID(BINDING_ID, SUN); ThingTypeUID moonType = new ThingTypeUID(BINDING_ID, MOON); ThingUID sunThing = new ThingUID(sunType, LOCAL); ThingUID moonThing = new ThingUID(moonType, LOCAL); String propGeolocation = String.format("%s,%s", latitude, longitude); thingDiscovered(DiscoveryResultBuilder.create(sunThing).withLabel("Local Sun") .withProperty("geolocation", propGeolocation).build()); thingDiscovered(DiscoveryResultBuilder.create(moonThing).withLabel("Local Moon") .withProperty("geolocation", propGeolocation).build()); } catch (Exception ex) { logger.warn("Can't discover Astro geolocation", ex); } } }

Target:
protected void startScan() { logger.debug("Starting Astro discovery scan"); String result = null; try { result = HttpUtil.executeUrl("GET", "<LINK_1>,lon", 5000); } catch (IOException e) { logger.warn("Can't get latitude and longitude for the current location: {}", e); } if (result != null) { String lat = StringUtils.trim(StringUtils.substringBetween(result, "\"lat\":", ",")); String lon = StringUtils.trim(StringUtils.substringBetween(result, "\"lon\":", "}")); try { double latitude = Double.parseDouble(lat); double longitude = Double.parseDouble(lon); logger.info("Evaluated Astro geolocation: latitude: {}, longitude: {}", latitude, longitude); ThingTypeUID sunType = new ThingTypeUID(BINDING_ID, SUN); ThingTypeUID moonType = new ThingTypeUID(BINDING_ID, MOON); ThingUID sunThing = new ThingUID(sunType, LOCAL); ThingUID moonThing = new ThingUID(moonType, LOCAL); String propGeolocation = String.format("%s,%s", latitude, longitude); thingDiscovered(DiscoveryResultBuilder.create(sunThing).withLabel("Local Sun") .withProperty("geolocation", propGeolocation).build()); thingDiscovered(DiscoveryResultBuilder.create(moonThing).withLabel("Local Moon") .withProperty("geolocation", propGeolocation).build()); } catch (Exception ex) { logger.warn("Can't discover Astro geolocation"); } } }
Source:
private static String buildFormattedDescription(final FailureCause originalCause, final List<FoundIndication> foundIndications, final String description) { String formattedCandidate = description; if (!foundIndications.isEmpty()) { final FoundIndication firstFoundIndication = foundIndications.get(0); try { if (originalCause != null) { final List<Indication> originalCauseIndications = originalCause.getIndications(); int expressionIndex = 0; boolean found = false; for (final int size = originalCauseIndications.size(); expressionIndex < size; ++expressionIndex) { if (originalCauseIndications.get(expressionIndex).getPattern().pattern().equals( firstFoundIndication.getPattern())) { found = true; break; } } if (found) { final int expressionNumber = expressionIndex + 1; formattedCandidate = convertFormat(formattedCandidate, expressionNumber); final Pattern contentPattern = Pattern.compile(firstFoundIndication.getPattern()); final Matcher contentMatcher = contentPattern.matcher(firstFoundIndication.getMatchingString()); formattedCandidate = contentMatcher.replaceAll(formattedCandidate); } } } catch (final Exception exception) { logger.log(Level.SEVERE, null, exception); } } return formattedCandidate; }

Target:
private static String buildFormattedDescription(final FailureCause originalCause, final List<FoundIndication> foundIndications, final String description) { String formattedDescription = description; if (!foundIndications.isEmpty()) { final FoundIndication firstFoundIndication = foundIndications.get(0); try { if (originalCause != null) { final List<Indication> originalCauseIndications = originalCause.getIndications(); int expressionIndex = 0; boolean foundExpressionIndex = false; for (final int size = originalCauseIndications.size(); expressionIndex < size; ++expressionIndex) { if (originalCauseIndications.get(expressionIndex).getPattern().pattern().equals( firstFoundIndication.getPattern())) { foundExpressionIndex = true; break; } } if (foundExpressionIndex) { final int expressionNumber = expressionIndex + 1; formattedDescription = convertFormat(formattedDescription, expressionNumber); final Pattern contentPattern = Pattern.compile(firstFoundIndication.getPattern()); final Matcher contentMatcher = contentPattern.matcher(firstFoundIndication.getMatchingString()); formattedDescription = contentMatcher.replaceAll(formattedDescription); } } } catch (final Exception exception) { logger.log(Level.SEVERE, null, exception); } } return formattedDescription; }
Source:
public static void main(String[] args) throws InterruptedException { ClientConfig clientConfig = new ClientConfig(); ClientUserCodeDeploymentConfig clientUserCodeDeploymentConfig = new ClientUserCodeDeploymentConfig(); clientUserCodeDeploymentConfig.addClass("IncrementingEntryProcessor"); clientConfig.setUserCodeDeploymentConfig(clientUserCodeDeploymentConfig.setEnabled(true)); HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig); IncrementingEntryProcessor incrementingEntryProcessor = new IncrementingEntryProcessor(); int keyCount = 10; IMap<Integer, Integer> map = client.getMap("sample map"); for (int i = 0; i < keyCount; i++) { map.put(i, 0); } map.executeOnEntries(incrementingEntryProcessor); for (int i = 0; i < keyCount; i++) { System.out.println(map.get(i)); } }

Target:
public static void main(String[] args) throws InterruptedException { ClientConfig clientConfig = new ClientConfig(); ClientUserCodeDeploymentConfig clientUserCodeDeploymentConfig = new ClientUserCodeDeploymentConfig(); clientUserCodeDeploymentConfig.addClass("IncrementingEntryProcessor"); clientUserCodeDeploymentConfig.setEnabled(true); clientConfig.setUserCodeDeploymentConfig(clientUserCodeDeploymentConfig); HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig); IncrementingEntryProcessor incrementingEntryProcessor = new IncrementingEntryProcessor(); int keyCount = 10; IMap<Integer, Integer> map = client.getMap("sample map"); for (int i = 0; i < keyCount; i++) { map.put(i, 0); } map.executeOnEntries(incrementingEntryProcessor); for (int i = 0; i < keyCount; i++) { System.out.println(map.get(i)); } }
Source:
public TargetRoll getAllMods(Person tech) { TargetRoll mods = new TargetRoll(getDifficulty(), "difficulty"); mods.append(oldUnit.getSiteMod()); if(oldUnit.getEntity().hasQuirk("easy_maintain")) { mods.addModifier(-1, "easy to maintain"); } else if(oldUnit.getEntity().hasQuirk("difficult_maintain")) { mods.addModifier(1, "difficult to maintain"); } if(customJob) { mods.addModifier(2, "custom job"); } if(null != tech && tech.getOptions().booleanOption("tech_engineer")) { mods.addModifier(-2, "engineer"); } return mods; }

Target:
public TargetRoll getAllMods(Person tech) { TargetRoll mods = new TargetRoll(getDifficulty(), "difficulty"); mods.append(oldUnit.getSiteMod()); if(oldUnit.getEntity().hasQuirk("easy_maintain")) { mods.addModifier(-1, "easy to maintain"); } else if(oldUnit.getEntity().hasQuirk("difficult_maintain")) { mods.addModifier(1, "difficult to maintain"); } if(customJob) { mods.addModifier(2, "custom job"); } if ((null != tech) && tech.getOptions().booleanOption("tech_engineer")) { mods.addModifier(-2, "engineer"); } return mods; }
Source:
public void deleteBundleAndDependencies(final String bundleId, final User user) throws DotDataException { final Bundle bundle = this.getBundleById(bundleId); if (null != bundle) { this.internalDeleteBundleAndDependencies(bundleId, user); } else { throw new NotFoundInDbException("The bundle id: " + bundleId + " does not exists"); } }

Target:
public void deleteBundleAndDependencies(final String bundleId, final User user) throws DotDataException { final Bundle bundle = this.getBundleById(bundleId); if (null != bundle) { this.internalDeleteBundleAndDependencies(bundleId, user); } else { Logger.error(this,"The bundle id: " + bundleId + " does not exists"); throw new NotFoundInDbException("The bundle id: " + bundleId + " does not exists"); } }
Source:
public synchronized User createNewUser(Map<String, String> userData, boolean validate) throws UserCreateException { try { DocumentReference userDocRef = getOrGenerateUserDocRef(userData.remove("xwikiname")); XWikiDocument userDoc = modelAccess.createDocument(userDocRef); if (areIdentifiersUnique(userData)) { createUserFromData(userDoc, userData); setRightsOnUser(userDoc, Arrays.asList(EAccessLevel.VIEW, EAccessLevel.EDIT, EAccessLevel.DELETE)); modelAccess.saveDocument(userDoc, webUtils.getAdminMessageTool().get( "core.comment.createdUser")); addUserToDefaultGroups(userDocRef); if (validate) { new PasswordRecoveryAndEmailValidationCommand().sendNewValidationToAccountEmail( userDocRef); } } return getUser(userDocRef); } catch (DocumentAccessException | QueryException | SendValidationFailedException | UserInstantiationException exc) { throw new UserCreateException(exc); } }

Target:
public User createNewUser(Map<String, String> userData, boolean validate) throws UserCreateException { try { DocumentReference userDocRef = getOrGenerateUserDocRef(userData.remove("xwikiname")); XWikiDocument userDoc = modelAccess.createDocument(userDocRef); if (areIdentifiersUnique(userData)) { createUserFromData(userDoc, userData); setRightsOnUser(userDoc, Arrays.asList(EAccessLevel.VIEW, EAccessLevel.EDIT, EAccessLevel.DELETE)); modelAccess.saveDocument(userDoc, webUtils.getAdminMessageTool().get( "core.comment.createdUser")); addUserToDefaultGroups(userDocRef); if (validate) { new PasswordRecoveryAndEmailValidationCommand().sendNewValidationToAccountEmail( userDocRef); } } return getUser(userDocRef); } catch (DocumentAccessException | QueryException | SendValidationFailedException | UserInstantiationException exc) { throw new UserCreateException(exc); } }
Source:
@Override public void drive() throws VolcanoTimeoutException { TaskDescriptor description = new TaskDescriptor(); tasks.push(new OptimizeGroup(planner.root, planner.infCost)); exploreMaterializationRoots(); try { while (!tasks.isEmpty()) { Task task = tasks.pop(); description.log(task); task.perform(); } } catch (VolcanoTimeoutException ex) { LOGGER.warn("Volcano planning times out, cancels the subsequent optimization."); } }

Target:
@Override public void drive() { TaskDescriptor description = new TaskDescriptor(); tasks.push(new OptimizeGroup(planner.root, planner.infCost)); exploreMaterializationRoots(); try { while (!tasks.isEmpty()) { Task task = tasks.pop(); description.log(task); task.perform(); } } catch (VolcanoTimeoutException ex) { LOGGER.warn("Volcano planning times out, cancels the subsequent optimization."); } }
Source:
private void initializeNotifyOnAvaiableButton() { final String text = isDryers ? getString(R.string.notify_on_dryer_available) : getString(R.string.notify_on_washer_available); notifyButton.setText(text); notifyButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Machine m = null; int mTime = Integer.MAX_VALUE; for (Machine mach : currentAdapter.getCurrentMachines()) { try { int machTime = Integer.parseInt(mach.getTime().substring(0, mach.getTime().indexOf(' '))); if (machTime < mTime) { m = mach; mTime = machTime; } } catch (NumberFormatException | StringIndexOutOfBoundsException e) { continue; } } if (m == null) { postSnackbar("No machines to set a timer for!", Snackbar.LENGTH_LONG); return; } if (m.getStatus().equals("Not online") || m.getStatus().equals("Out of order")) { postSnackbar("It looks like this location is offline. " + "Please go to the laundry room to check machines.", Snackbar.LENGTH_LONG); return; } currentAdapter.registerNotification(m); } }); }

Target:
private void initializeNotifyOnAvaiableButton() { final String text = isDryers ? getString(R.string.notify_on_dryer_available) : getString(R.string.notify_on_washer_available); notifyButton.setText(text); notifyButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Machine m = null; int mTime = Integer.MAX_VALUE; for (Machine machine : currentAdapter.getCurrentMachines()) { try { int machineTime = Integer.parseInt(machine.getTime().substring(0, machine.getTime().indexOf(' '))); if (machineTime < mTime) { m = machine; mTime = machineTime; } } catch (NumberFormatException | StringIndexOutOfBoundsException e) { continue; } } if (m == null) { postSnackbar(getString(R.string.fragment_no_machine), Snackbar.LENGTH_LONG); return; } if (m.getStatus().equals("Not online") || m.getStatus().equals("Out of order")) { postSnackbar(getString(R.string.fragment_offline_location), Snackbar.LENGTH_LONG); return; } currentAdapter.registerNotification(m); } }); }
Source:
public boolean rollback(String pushId) { boolean matched = false; Node n; for (Iterator<Node> it = marked.iterator(); it.hasNext(); ) { n = it.next(); if (matched) it.remove(); else if (n.get().getPushId() == pushId) { current = n; matched = true; } } return matched; }

Target:
public boolean rollback(String pushId) throws PublisherException { boolean matched = false; Node n; for (Iterator<Node> it = marked.iterator(); it.hasNext(); ) { n = it.next(); if (matched) it.remove(); else if (n.get().getPushId() == pushId) { current = n; matched = true; } } return matched; }
Source:
private void applyButtonStyles(ConversationStyle style) { Typeface typeface = getTypeface(style, SwrveConversationConstants.DEFAULT_BUTTON_TYPEFACE); style.setTypeface(typeface); if(conversationVersion < 4) { style.setTextSize(getResources().getDimensionPixelSize(R.dimen.swrve__conversation_control_default_text_size)); } }

Target:
private void applyButtonStyles(ConversationStyle style) { Typeface typeface = getTypeface(style, SwrveConversationConstants.DEFAULT_BUTTON_TYPEFACE); style.setTypeface(typeface); if (style.getTextSize() == 0) { style.setTextSize(getResources().getDimensionPixelSize(R.dimen.swrve__conversation_control_default_text_size)); } }
Source:
protected void onCollectionLoaded(Collection col) { super.onCollectionLoaded(col); mPrefWhiteboard = MetaDB.getWhiteboardState(this, getParentDid()); if (mPrefWhiteboard) { boolean whiteboardVisibility = MetaDB.getWhiteboardVisibility(this, getParentDid()); setWhiteboardEnabledState(true); setWhiteboardVisibility(whiteboardVisibility); } if (!reset_done) { col.getSched().reset(); reset_done = false; } DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ANSWER_CARD, mAnswerCardHandler, new DeckTask.TaskData(null, 0)); disableDrawerSwipeOnConflicts(); mSched.setContext(new WeakReference<Activity>(this)); if (mPrefFullscreenReview) { CompatHelper.getCompat().setFullScreen(this); } }

Target:
protected void onCollectionLoaded(Collection col) { super.onCollectionLoaded(col); mPrefWhiteboard = MetaDB.getWhiteboardState(this, getParentDid()); if (mPrefWhiteboard) { boolean whiteboardVisibility = MetaDB.getWhiteboardVisibility(this, getParentDid()); setWhiteboardEnabledState(true); setWhiteboardVisibility(whiteboardVisibility); } if (!mSchedResetDone) { col.getSched().reset(); mSchedResetDone = false; } DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ANSWER_CARD, mAnswerCardHandler, new DeckTask.TaskData(null, 0)); disableDrawerSwipeOnConflicts(); mSched.setContext(new WeakReference<Activity>(this)); if (mPrefFullscreenReview) { CompatHelper.getCompat().setFullScreen(this); } }
Source:
public List<TaskSummary> getTasksAssignedAsPotentialOwner(String userId, QueryFilter filter) { Map<String, Object> params = new HashMap<String, Object>(); params.put("userId", userId); params.put("groupIds", userGroupCallback.getGroupsForUser(userId)); params.put("status", allActiveStatus); applyQueryContext(params, filter); applyQueryFilter(params, filter); return (List<TaskSummary>) commandService.execute(new QueryNameCommand<List<TaskSummary>>("NewTasksAssignedAsPotentialOwner",params)); }

Target:
public List<TaskSummary> getTasksAssignedAsPotentialOwner(String userId, QueryFilter filter) { Map<String, Object> params = new HashMap<String, Object>(); params.put("userId", userId); params.put("groupIds", getCallbackUserRoles(userGroupCallback, userId)); params.put("status", allActiveStatus); applyQueryContext(params, filter); applyQueryFilter(params, filter); return (List<TaskSummary>) commandService.execute(new QueryNameCommand<List<TaskSummary>>("NewTasksAssignedAsPotentialOwner",params)); }
Source:
public boolean isResponseRelatedToRequest(EndpointContext requestContext, EndpointContext responseContext) { if (ignoreAddress) { return isToBeSent(requestContext, responseContext); } else { return super.isResponseRelatedToRequest(requestContext, responseContext); } }

Target:
public boolean isResponseRelatedToRequest(EndpointContext requestContext, EndpointContext responseContext) { if (ignoreAddress) { return super.internalMatch(requestContext, responseContext); } else { return super.isResponseRelatedToRequest(requestContext, responseContext); } }
Source:
public static void main(String[] args) throws Exception { if (args.length != 1) { log.error("Usage: Copy <dataConfigPath>"); System.exit(1); } String hadoopConfDir = System.getenv("HADOOP_CONF_DIR"); if (hadoopConfDir == null) { log.error("HADOOP_CONF_DIR must be set in environment!"); System.exit(1); } if (!(new File(hadoopConfDir).exists())) { log.error("Directory set by HADOOP_CONF_DIR={} does not exist", hadoopConfDir); System.exit(1); } DataConfig dataConfig = DataConfig.load(args[0]); SparkConf sparkConf = new SparkConf().setAppName("CC-Load"); JavaSparkContext ctx = new JavaSparkContext(sparkConf); JavaPairRDD<Text, ArchiveReader> archives = ctx.newAPIHadoopFile(dataConfig.getHdfsLoadDir(), WARCFileInputFormat.class, Text.class, ArchiveReader.class, new Configuration()); JavaRDD<Page> pages = IndexUtil.createPages(archives); pages.foreachPartition(iter -> { final FluoConfiguration fluoConfig = new FluoConfiguration(new File("fluo.properties")); try (FluoClient client = FluoFactory.newClient(fluoConfig)) { iter.forEachRemaining(page -> { if (page.getOutboundLinks().size() > 0) { try (LoaderExecutor le = client.newLoaderExecutor()) { log.info("Loading page with links", page.getUrl(), page.getOutboundLinks() .size()); le.execute(PageLoader.updatePage(page)); } } }); } }); ctx.stop(); }

Target:
public static void main(String[] args) throws Exception { if (args.length != 1) { log.error("Usage: Copy <dataConfigPath>"); System.exit(1); } String hadoopConfDir = System.getenv("HADOOP_CONF_DIR"); if (hadoopConfDir == null) { log.error("HADOOP_CONF_DIR must be set in environment!"); System.exit(1); } if (!(new File(hadoopConfDir).exists())) { log.error("Directory set by HADOOP_CONF_DIR={} does not exist", hadoopConfDir); System.exit(1); } DataConfig dataConfig = DataConfig.load(args[0]); SparkConf sparkConf = new SparkConf().setAppName("CC-Load"); JavaSparkContext ctx = new JavaSparkContext(sparkConf); JavaPairRDD<Text, ArchiveReader> archives = ctx.newAPIHadoopFile(dataConfig.getHdfsLoadDir(), WARCFileInputFormat.class, Text.class, ArchiveReader.class, new Configuration()); JavaRDD<Page> pages = IndexUtil.createPages(archives); pages.foreachPartition(iter -> { final FluoConfiguration fluoConfig = new FluoConfiguration(new File("fluo.properties")); try (FluoClient client = FluoFactory.newClient(fluoConfig)) { try (LoaderExecutor le = client.newLoaderExecutor()) { iter.forEachRemaining(page -> { if (page.getOutboundLinks().size() > 0) { log.info("Loading page with links", page.getUrl(), page.getOutboundLinks() .size()); le.execute(PageLoader.updatePage(page)); } }); } } }); ctx.stop(); }
Source:
public static JButton createStopButton(final Task task, final MCMCWrapper model) { final JButton button = new JButton(Main.IMAGELOADER.getIcon(FileNames.ICON_TICK)); button.setText("Yes, finish"); button.setToolTipText("Finish the simulation"); button.setEnabled(false); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(task.isStarted()) { ((MixedTreatmentComparison) getMTCModel(model.getModel())).setExtendSimulation(ExtendSimulation.FINISH); } } }); return button; }

Target:
public static JButton createStopButton(final Task task, final MCMCWrapper model) { final JButton button = new JButton(Main.IMAGELOADER.getIcon(FileNames.ICON_TICK)); button.setText("Yes, finish"); button.setToolTipText("Finish the simulation"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(task.isStarted()) { ((MixedTreatmentComparison) ((MixedTreatmentComparison)model.getModel())).setExtendSimulation(ExtendSimulation.FINISH); } } }); return button; }
Source:
protected void init() { this.ctr = ReflectionHelper.findConstructor(this.cls, World.class); }

Target:
protected void init() { this.factory = new EntityEntryBuilder.ConstructorFactory<Entity>(this.cls) { @Override protected String describeEntity() { return String.valueOf(EntityEntry.this.getRegistryName()); } }; }