auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private int index(final Talk talk) throws IOException { final Iterable<Integer> indexes = Iterables.transform( talk.read() .xpath("/talk/archive/log/@index|/talk/request/@index"), new Function<String, Integer>() { @Override public Integer apply(final String input) { return Integer.parseInt(input); } } ); <START> int index; <END> if (indexes.iterator().hasNext()) { index = Ordering.natural().max(indexes); } else { index = 0; } return index; }</code><technical_language>this set final</technical_language>

Target:
private int index(final Talk talk) throws IOException { final Iterable<Integer> indexes = Iterables.transform( talk.read() .xpath("/talk/archive/log/@index|/talk/request/@index"), new Function<String, Integer>() { @Override public Integer apply(final String input) { return Integer.parseInt(input); } } ); final int index; if (indexes.iterator().hasNext()) { index = Ordering.natural().max(indexes); } else { index = 0; } return index; }
Source:
<code>private AuditLogCleanupManager() { log.info("Start initializing " + getClass().getSimpleName()); Calendar calendar = new GregorianCalendar(); Date mAuditLogCleanupTime = Config.<DateTime> getValue(ConfigValues.AuditLogCleanupTime); calendar.setTimeInMillis(mAuditLogCleanupTime.getTime()); String cronExpression = String.format("%d %d %d * * ?", calendar.get(Calendar.SECOND), calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY)); log.info("Setting audit cleanup manager to run at: " + cronExpression); <START> SchedulerUtilQuartzImpl.getInstance().scheduleACronJob(this, "OnTimer", new Class[] {}, new Object[] {}, <END> cronExpression); log.info("Finished initializing " + getClass().getSimpleName()); }</code><technical_language>Fix scheduling</technical_language>

Target:
private AuditLogCleanupManager() { log.info("Start initializing " + getClass().getSimpleName()); Calendar calendar = new GregorianCalendar(); Date mAuditLogCleanupTime = Config.<DateTime> getValue(ConfigValues.AuditLogCleanupTime); calendar.setTimeInMillis(mAuditLogCleanupTime.getTime()); String cronExpression = String.format("%d %d %d * * ?", calendar.get(Calendar.SECOND), calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY)); log.info("Setting audit cleanup manager to run at: " + cronExpression); SchedulerUtilQuartzImpl.getInstance().scheduleACronJob(this, "onTimer", new Class[] {}, new Object[] {}, cronExpression); log.info("Finished initializing " + getClass().getSimpleName()); }
Source:
<code>public void updatePresentation(@NotNull NodePresentation presentation) { presentation.setPresentableText(getData().getName()); presentation.setPresentableIcon( <START> "PACKAGE".equals(getData().getEntryType()) <END> ? javaResources.packageItem() : nodesResources.simpleFolder()); }</code><technical_language>constant</technical_language>

Target:
public void updatePresentation(@NotNull NodePresentation presentation) { presentation.setPresentableText(getData().getName()); presentation.setPresentableIcon( PACKAGE.name().equals(getData().getEntryType()) ? javaResources.packageItem() : nodesResources.simpleFolder()); }
Source:
<code>public static Cache create(final RedisCacheConfig config) { JedisPoolConfig poolConfig = config.getPoolConfig(); <START> JedisPool pool = new JedisPool(poolConfig, config.getHost(), config.getPort(), config.getTimeout()); <END> return new RedisCache(pool, config); }</code><technical_language>formatting</technical_language>

Target:
public static Cache create(final RedisCacheConfig config) { final Supplier<ResourceHolder<ShardedJedis>> clientSupplier; if (config.getPoolSize() > 1) { clientSupplier = new LoadBalancingPool<>( config.getPoolSize(), new Supplier<ShardedJedis>() { @Override public ShardedJedis get() { return new ShardedJedis(config.getShardsInfo(), Hashing.MURMUR_HASH); } } ); } else { clientSupplier = Suppliers.<ResourceHolder<ShardedJedis>>ofInstance( StupidResourceHolder.create(new ShardedJedis(config.getShardsInfo(), Hashing.MURMUR_HASH)) ); } return new RedisCache(clientSupplier, config); }
Source:
<code>private void buildErrataDetailPanel() { errataDetailPanel = new FlowPanel(); errataDetailFormPanel = new GeneralFormPanel(); errataTitle = new Span(); errataTitle.setStyleName(style.errataTitleLabel()); FlowPanel errataTitlePanel = new FlowPanel(); errataTitlePanel.setStyleName(style.errataTitlePanel()); errataTitlePanel.add(errataTitle); errataDetailPanel.add(errataTitlePanel); <START> errataDetailPanel.setStyleName("testtest"); END> errataDetailPanel.add(errataDetailFormPanel); }</code><technical_language>I guessing this style name else? especially style defined</technical_language>

Target:
private void buildErrataDetailPanel() { errataDetailPanel = new FlowPanel(); errataDetailFormPanel = new GeneralFormPanel(); errataTitle = new Span(); errataTitle.setStyleName(style.errataTitleLabel()); FlowPanel errataTitlePanel = new FlowPanel(); errataTitlePanel.setStyleName(style.errataTitlePanel()); errataTitlePanel.add(errataTitle); errataDetailPanel.add(errataTitlePanel); errataDetailPanel.add(errataDetailFormPanel); }
Source:
<code>public static void main(String[] args) { try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { printModules(moduleServices.keySet()); } else { if (others.isEmpty()) { throw new IllegalArgumentException("Module must be provided"); } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists.", module) ); } moduleService.parseArguments(others); if (moduleService.doHelp()) { System.out.println(module + " help"); <START> return; <END> } loadExtensions(moduleService, argMap); moduleService.run(); } } catch (Throwable t) { String message = t.getMessage() != null ? t.getMessage() : t.getClass().getName(); logger.error(message); logger.debug(message, t); System.exit(1); } }</code><technical_language>please avoid return middle of function. suggest exception for normal termination? :) or... condtional</technical_language>

Target:
public static void main(String[] args) { try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { List<String> modules = new ArrayList<>(moduleServices.keySet()); Collections.sort(modules); throw new ArgumentException("Modules: " + StringUtils.join(modules, ", ")); } if (others.isEmpty()) { throw new IllegalArgumentException("Module must be provided"); } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists.", module) ); } moduleService.parseArguments(others); if (moduleService.doHelp()) { throw new ArgumentException(module + " help"); } loadExtensions(moduleService, argMap); moduleService.run(); } catch(ArgumentException e) { System.out.println(e.getMessage()); System.exit(0); } catch (Throwable t) { String message = t.getMessage() != null ? t.getMessage() : t.getClass().getName(); logger.error(message); logger.debug(message, t); System.exit(1); } }
Source:
<code>private void uploadNextInQueue() { MediaModel next = getNextMediaToUpload(); if (next == null) { AppLog.v(AppLog.T.MEDIA, "No more media items to upload. Skipping this request - MediaUploadService."); stopServiceIfUploadsComplete(); return; } SiteModel site = mSiteStore.getSiteByLocalId(next.getLocalSiteId()); if (site == null) { <START> AppLog.i(AppLog.T.MEDIA, "Unexpected state, site is null. Skipping this request - MediaUploadService."); <END> stopServiceIfUploadsComplete(); } dispatchUploadAction(next, site); }</code><technical_language>return do in next == null check - for dispatchUploadAction do (and fix 'site' null warning getting)</technical_language>

Target:
private void uploadNextInQueue() { MediaModel next = getNextMediaToUpload(); if (next == null) { AppLog.v(AppLog.T.MEDIA, "No more media items to upload. Skipping this request - MediaUploadService."); stopServiceIfUploadsComplete(); return; } SiteModel site = mSiteStore.getSiteByLocalId(next.getLocalSiteId()); if (site == null) { AppLog.i(AppLog.T.MEDIA, "Unexpected state, site is null. Skipping this request - MediaUploadService."); stopServiceIfUploadsComplete(); return; } dispatchUploadAction(next, site); }
Source:
<code>public void shouldCalculateTheSumOfANonEmptyIntegerList() { final List<Integer> list = Collections.unmodifiableList( <START> IntStream.range(0, 5) <END> .boxed() .collect(Collectors.toList()) ); final int actual = ListOps.reduce(list, 0, (x, y) -> x + y, Integer::sum); assertEquals(10, actual); }</code><technical_language>Arrays.asList(...) for short lists</technical_language>

Target:
public void shouldCalculateTheSumOfANonEmptyIntegerList() { final List<Integer> list = Collections.unmodifiableList( Arrays.asList(0, 1, 2, 3, 4) ); final int actual = ListOps.reduce(list, 0, (x, y) -> x + y, Integer::sum); assertEquals(10, actual); }
Source:
<code>public void configurationEvent(ConfigurationEvent event) { LOGGER.debug("Configuration event received by listener: {}", event); if (event.getPid().equals(pid) && ConfigurationEvent.CM_UPDATED == event.getType()) { <START> LOGGER.error("configuration event received matching pid & update event: {}", event); <END> updated = true; } }</code><technical_language>logged error level</technical_language>

Target:
public void configurationEvent(ConfigurationEvent event) { LOGGER.debug("Configuration event received by listener: {}", event); if (event.getPid().equals(pid) && ConfigurationEvent.CM_UPDATED == event.getType()) { LOGGER.debug("configuration event received matching pid & update event: {}", event); updated = true; } }
Source:
<code>public void loadNextPage(@NonNull final InfiniteScrollUtils.PageLoadCallback<DiscussionThread> callback) { <START> if (discussionTopic.isFollowingType()) { <END> populateFollowingThreadList(callback); } else { populatePostList(callback); } }</code><technical_language>This check moved GetThreadListTask if pass DiscussionTopic instead of a list of thread IDs. merge GetThreadListTask GetFollowingThreadListTask. allow remove a lot of duplicate logic in this class. This incidentally fix fact paging is currently broken for "following" topic (nextPage is incremented) prevent future issues tasks treated equally. I move getAllTopicIds GetThreadListTask point place used/needed</technical_language>

Target:
public void loadNextPage(@NonNull final InfiniteScrollUtils.PageLoadCallback<DiscussionThread> callback) { populatePostList(callback); }
Source:
<code>public void testDecreasingBatchSize() { int rows = 1024; TestingTicker testingTicker = new TestingTicker(); ExpressionProfiler profiler = new ExpressionProfiler(testingTicker, 0L); PageProcessor pageProcessor = new PageProcessor( Optional.empty(), ImmutableList.of(new InputPageProjection(0, BIGINT)), OptionalInt.of(512), profiler); Slice[] slices = new Slice[rows]; Arrays.fill(slices, Slices.allocate(rows)); Page inputPage = new Page(createSlicesBlock(slices)); PageProcessorOutput output = pageProcessor.process(SESSION, new DriverYieldSignal(), inputPage); long previousPositionCount = 1; long totalPositionCount = 0; while (totalPositionCount < rows) { Optional<Page> page = output.next(); assertTrue(page.isPresent()); long positionCount = page.get().getPositionCount(); totalPositionCount += positionCount; if (positionCount > 1 && previousPositionCount != 1) { assertEquals(positionCount, previousPositionCount / 2); } previousPositionCount = positionCount; } <START> } <END></code><technical_language>advance testing ticker in this loop safe</technical_language>

Target:
public void testDecreasingBatchSize() { int rows = 1024; TestingTicker testingTicker = new TestingTicker(); ExpressionProfiler profiler = new ExpressionProfiler(testingTicker, new Duration(0, MILLISECONDS)); PageProcessor pageProcessor = new PageProcessor( Optional.empty(), ImmutableList.of(new InputPageProjection(0, BIGINT)), OptionalInt.of(512), profiler); Slice[] slices = new Slice[rows]; Arrays.fill(slices, Slices.allocate(rows)); Page inputPage = new Page(createSlicesBlock(slices)); PageProcessorOutput output = pageProcessor.process(SESSION, new DriverYieldSignal(), inputPage); long previousPositionCount = 1; long totalPositionCount = 0; while (totalPositionCount < rows) { Optional<Page> page = output.next(); assertTrue(page.isPresent()); long positionCount = page.get().getPositionCount(); totalPositionCount += positionCount; if (positionCount > 1 && previousPositionCount != 1) { assertEquals(positionCount, previousPositionCount / 2); } previousPositionCount = positionCount; } }
Source:
<code><START> public XSSFTableColumn(XSSFTable table, CTTableColumn ctTableColumn) { <END> this.table = table; this.ctTableColumn = ctTableColumn; }</code><technical_language>I insist in methods a CT* parameter annotated @Internal private</technical_language>

Target:
protected XSSFTableColumn(XSSFTable table, CTTableColumn ctTableColumn) { this.table = table; this.ctTableColumn = ctTableColumn; }
Source:
<code>public InternalIndexState getInitialState( long indexId, SchemaIndexDescriptor descriptor ) { SpatialIndexFiles spatialIndexFiles = new SpatialIndexFiles( directoryStructure(), indexId, fs, settingsFactory ); final Iterable<SpatialIndexFiles.SpatialFileLayout> existing = spatialIndexFiles.existing(); <START> if ( !existing.iterator().hasNext() ) <END> { return InternalIndexState.ONLINE; } InternalIndexState state = InternalIndexState.ONLINE; for ( SpatialIndexFiles.SpatialFileLayout subIndex : existing ) { try { switch ( NativeSchemaIndexes.readState( pageCache, subIndex.indexFile ) ) { case FAILED: return InternalIndexState.FAILED; case POPULATING: state = InternalIndexState.POPULATING; default: } } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( indexId, descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } } return state; }</code><technical_language>remove this if block all-together</technical_language>

Target:
public InternalIndexState getInitialState( long indexId, SchemaIndexDescriptor descriptor ) { SpatialIndexFiles spatialIndexFiles = new SpatialIndexFiles( directoryStructure(), indexId, fs, settingsFactory ); final Iterable<SpatialIndexFiles.SpatialFileLayout> existing = spatialIndexFiles.existing(); InternalIndexState state = InternalIndexState.ONLINE; for ( SpatialIndexFiles.SpatialFileLayout subIndex : existing ) { try { switch ( NativeSchemaIndexes.readState( pageCache, subIndex.indexFile ) ) { case FAILED: return InternalIndexState.FAILED; case POPULATING: state = InternalIndexState.POPULATING; default: } } catch ( MetadataMismatchException | IOException e ) { monitor.failedToOpenIndex( indexId, descriptor, "Requesting re-population.", e ); return InternalIndexState.POPULATING; } } return state; }
Source:
<code><START> private <END> Expression getExpressionWithoutParenthezis(Expression expression) { Expression currExpression= expression; while (currExpression instanceof ParenthesizedExpression) { currExpression= ((ParenthesizedExpression) currExpression).getExpression(); } return currExpression; }</code><technical_language>'static' added, rely instance of class</technical_language>

Target:
private static Expression getExpressionWithoutParenthezis(Expression expression) { Expression currExpression= expression; while (currExpression instanceof ParenthesizedExpression) { currExpression= ((ParenthesizedExpression) currExpression).getExpression(); } return currExpression; }
Source:
<code>void onRenameInFile() { <START> int matches = renameHelper_.renameInFile(); <END> if (matches > 0) { String message = "Found " + matches; if (matches == 1) message += " match"; else message += " matches"; String selectedItem = docDisplay_.getSelectionValue(); message += " for '" + selectedItem + "'"; view_.getStatusBar().showMessage(message); } }</code><technical_language>For C++ mode I need exclude command (so users rename C++ variables)</technical_language>

Target:
void onRenameInFile() { int matches = renameHelper_.renameInFile(); if (matches > 0) { String message = "Found " + matches; if (matches == 1) message += " match"; else message += " matches"; String selectedItem = docDisplay_.getSelectionValue(); message += " for '" + selectedItem + "'"; view_.getStatusBar().showMessage(message, new HideMessageHandler() { @Override public boolean onNativePreviewEvent(NativePreviewEvent preview) { if (!docDisplay_.isFocused() || !docDisplay_.inMultiSelectMode()) { docDisplay_.exitMultiSelectMode(); docDisplay_.clearSelection(); return true; } if (preview.getTypeInt() == Event.ONKEYDOWN) { switch (preview.getNativeEvent().getKeyCode()) { case KeyCodes.KEY_ENTER: preview.cancel(); case KeyCodes.KEY_UP: case KeyCodes.KEY_DOWN: case KeyCodes.KEY_ESCAPE: docDisplay_.exitMultiSelectMode(); docDisplay_.clearSelection(); return true; } } return false; } }); } }
Source:
<code>public long countLocationsByType(final Integer type) throws MiddlewareQueryException { <START> return this.countAllByMethod(this.getLocationDao(), COUNT_BY_TYPE, new Object[] { type }, <END> new Class[] { Integer.class }); }</code><technical_language>replace LocationDataManagerImpl.COUNT_BY_TYPE</technical_language>

Target:
public long countLocationsByType(final Integer type) throws MiddlewareQueryException { return this.countAllByMethod(this.getLocationDao(), LocationDataManagerImpl.COUNT_BY_TYPE, new Object[] { type }, new Class[] { Integer.class }); }
Source:
<code><START> protected boolean canDoAction() { <END> QuotaDAO dao = DbFacade.getInstance().getQuotaDAO(); if (getParameters() != null) { Quota quota = dao.getById(getParameters().getQuotaId()); if (dao.getDefaultQuotaByStoragePoolId(getParameters().getStoragePoolId()).getId().equals(quota.getId())) { } } return true; }</code><technical_language>u also</technical_language>

Target:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { return false; } return true; }
Source:
<code>public static HaxeClass resolveClassReference(@NotNull HaxeReference element) { HaxeClassResolveResult result = element.resolveHaxeClass(); <START> return result == HaxeClassResolveResult.EMPTY ? null : result.getHaxeClass(); <END> }</code><technical_language>This simply: return result.getHaxeClass(); return null if result is EMPTY</technical_language>

Target:
public static HaxeClass resolveClassReference(@NotNull HaxeReference element) { HaxeClassResolveResult result = element.resolveHaxeClass(); return result.getHaxeClass(); }
Source:
<code>private void loadBuildingLayer() { FillLayer indoorBuildingLayer = new FillLayer("indoor-building-fill", "indoor-building"); <START> indoorBuildingLayer.setProperties( <END> fillColor(Color.parseColor("#eeeeee")), fillOpacity(Function.zoom(0.8f, stop(17, fillOpacity(1f)), stop(16.5f, fillOpacity(0.5f)), stop(16, fillOpacity(0f)) )) ); map.addLayer(indoorBuildingLayer); LineLayer indoorBuildingLineLayer = new LineLayer("indoor-building-line", "indoor-building"); indoorBuildingLineLayer.setProperties( lineColor(Color.parseColor("#50667f")), lineWidth(0.5f), lineOpacity(Function.zoom(0.8f, stop(17, lineOpacity(1f)), stop(16.5f, lineOpacity(0.5f)), stop(16, lineOpacity(0f)) )) ); map.addLayer(indoorBuildingLineLayer); }</code><technical_language>If want, chain this withProperties</technical_language>

Target:
private void loadBuildingLayer() { FillLayer indoorBuildingLayer = new FillLayer("indoor-building-fill", "indoor-building").withProperties( fillColor(Color.parseColor("#eeeeee")), fillOpacity(Function.zoom(0.8f, stop(17, fillOpacity(1f)), stop(16.5f, fillOpacity(0.5f)), stop(16, fillOpacity(0f)) )) ); map.addLayer(indoorBuildingLayer); LineLayer indoorBuildingLineLayer = new LineLayer("indoor-building-line", "indoor-building").withProperties( lineColor(Color.parseColor("#50667f")), lineWidth(0.5f), lineOpacity(Function.zoom(0.8f, stop(17, lineOpacity(1f)), stop(16.5f, lineOpacity(0.5f)), stop(16, lineOpacity(0f)) )) ); map.addLayer(indoorBuildingLineLayer); }
Source:
<code>private void handleSubOperation(final Tuple3<LongKeyOperation, Pair<Long, Long>, Integer> subOperation) { final LongKeyOperation operation = subOperation.getFirst(); final Pair<Long, Long> subKeyRange = subOperation.getSecond(); final int blockId = subOperation.getThird(); try { <START> routerLock.readLock().lock(); <END> final Optional<String> remoteEvalId = router.resolveEval(blockId); final boolean isLocal = !remoteEvalId.isPresent(); if (isLocal) { final Block block = typeToBlocks.get(operation.getDataType()).get(blockId); final Map<Long, Object> result = block.executeSubOperation(operation, subKeyRange); resultAggregator.submitLocalResult(operation, result, Collections.EMPTY_LIST); } else { final List<LongRange> failedRanges = new ArrayList<>(1); failedRanges.add(new LongRange(subKeyRange.getFirst(), subKeyRange.getSecond())); resultAggregator.submitLocalResult(operation, Collections.EMPTY_MAP, failedRanges); } } finally { routerLock.readLock().unlock(); } }</code><technical_language>Typically lock() try</technical_language>

Target:
private void handleSubOperation(final Tuple3<LongKeyOperation, Pair<Long, Long>, Integer> subOperation) { final LongKeyOperation operation = subOperation.getFirst(); final Pair<Long, Long> subKeyRange = subOperation.getSecond(); final int blockId = subOperation.getThird(); routerLock.readLock().lock(); try { final Optional<String> remoteEvalId = router.resolveEval(blockId); final boolean isLocal = !remoteEvalId.isPresent(); if (isLocal) { final Block block = typeToBlocks.get(operation.getDataType()).get(blockId); final Map<Long, Object> result = block.executeSubOperation(operation, subKeyRange); resultAggregator.submitLocalResult(operation, result, Collections.EMPTY_LIST); } else { final List<LongRange> failedRanges = new ArrayList<>(1); failedRanges.add(new LongRange(subKeyRange.getFirst(), subKeyRange.getSecond())); resultAggregator.submitLocalResult(operation, Collections.EMPTY_MAP, failedRanges); } } finally { routerLock.readLock().unlock(); } }
Source:
<code>private Payload createPayload(byte[] content) { Payload payload = null; if (content.length > 0) { <START> payload = new ByteArrayPayload(content); <END> ContentMetadata cm = metaData.toBuilder().contentLength((long)content.length).contentMD5((HashCode) null).build(); payload.setContentMetadata(BaseMutableContentMetadata.fromContentMetadata(cm)); } return payload; }</code><technical_language>[minor] Payloads.newByteArrayPayload</technical_language>

Target:
private Payload createPayload(byte[] content) { Payload payload = null; if (content.length > 0) { payload = Payloads.newByteArrayPayload(content); ContentMetadata cm = metaData.toBuilder().contentLength((long)content.length).contentMD5((HashCode) null).build(); payload.setContentMetadata(BaseMutableContentMetadata.fromContentMetadata(cm)); } return payload; }
Source:
<code>public <T> T fromJson(InputStream json, Type type) { Reader reader = new InputStreamReader(json); try { return (T) gson.fromJson(reader, type); } finally { <START> closeQuietly(reader); <END> } }</code><technical_language>caller do resource management instead of callee</technical_language>

Target:
public <T> T fromJson(InputStream json, Type type) { return (T) gson.fromJson(new InputStreamReader(json), type); }
Source:
<code>public void hasAuthenticatedUserAliasInHeader() throws Exception { final String loc = "<LINK_1>"; final String head = new RsPrint( new TkApp(new MkBase()).act( new RqWithHeader( new RqWithAuth("urn:test:1"), String.format( "Cookie: RsReturn=%s", URLEncoder.encode(loc, Charset.defaultCharset().name()) ) ) ) ).printHead(); MatcherAssert.assertThat( "Incorrect X-Netbout-Alias header", Pattern.compile( <START> "^X-Netbout-Alias: tester", <END> Pattern.MULTILINE ).matcher(head).find() ); }</code><technical_language>@kujtimiihoxha test</technical_language>

Target:
public void hasAuthenticatedUserAliasInHeader() throws Exception { final String loc = "<LINK_0>"; final String head = new RsPrint( new TkApp(new MkBase()).act( new RqWithHeader( new RqWithAuth("urn:test:2"), String.format( "Cookie: RsReturn=%s ", URLEncoder.encode(loc, Charset.defaultCharset().name()) ) ) ) ).printHead(); MatcherAssert.assertThat( "Incorrect X-Netbout-Alias header", Pattern.compile( "^X-Netbout-Alias: tester", Pattern.MULTILINE ).matcher(head).find() ); }
Source:
<code>public GwtXmlGeneratorConfig(Set<String> gwtXmlModules, File generationRoot) { <START> this(gwtXmlModules, generationRoot, DEFAULT_GWT_XML_PATH, DEFAULT_GWT_ETNRY_POINT, DEFAULT_STYLE_SHEET, false); <END> }</code><technical_language>add constant for isLoggingEnabled reuse [there](<LINK_0></technical_language>

Target:
public GwtXmlGeneratorConfig(Set<String> gwtXmlModules, File generationRoot) { this(gwtXmlModules, generationRoot, DEFAULT_GWT_XML_PATH, DEFAULT_GWT_ETNRY_POINT, DEFAULT_STYLE_SHEET, DEFAULT_LOGGING); }
Source:
<code>protected void createContents(IProgressMonitor monitor, IProject project) throws CoreException, JavaModelException, InvocationTargetException, InterruptedException { <START> String[] paths = fData.getLibraryPaths(); <END> for (int i = paths.length - 1; i >= 0; i--) { File jarFile = new File(paths[i]); if (fData.isUnzipLibraries()) { importJar(jarFile, project, monitor); } else { addJar(jarFile, project, monitor); } monitor.worked(1); } IFile importedManifest = PDEProject.getManifest(project); if (importedManifest.exists()) { importedManifest.delete(true, false, monitor); if (!fData.hasBundleStructure()) { IFolder meta_inf = project.getFolder("META-INF"); if (meta_inf.members().length == 0) { meta_inf.delete(true, false, monitor); } } } }</code><technical_language>Another method consumes entire monitor pass a loop. fixed SubMonitor</technical_language>

Target:
protected void createContents(IProgressMonitor monitor, IProject project) throws CoreException, JavaModelException, InvocationTargetException, InterruptedException { String[] paths = fData.getLibraryPaths(); SubMonitor subMonitor = SubMonitor.convert(monitor, paths.length + 2); for (int i = paths.length - 1; i >= 0; i--) { File jarFile = new File(paths[i]); if (fData.isUnzipLibraries()) { importJar(jarFile, project, subMonitor.newChild(1)); } else { addJar(jarFile, project, subMonitor); } } IFile importedManifest = PDEProject.getManifest(project); if (importedManifest.exists()) { importedManifest.delete(true, false, subMonitor.newChild(1)); subMonitor.setWorkRemaining(1); if (!fData.hasBundleStructure()) { IFolder meta_inf = project.getFolder("META-INF"); if (meta_inf.members().length == 0) { meta_inf.delete(true, false, subMonitor.newChild(1)); } } } subMonitor.setWorkRemaining(0); }
Source:
<code>protected void processQuery() { try { updateAsyncQueryStatus(QueryStatus.PROCESSING, id); ElideResponse response = null; log.debug("query: {}", query); log.debug("queryType: {}", queryType); AsyncQuery asyncQuery; AsyncQueryResult asyncQueryResult; if (queryType.equals(QueryType.JSONAPI_V1_0)) { MultivaluedMap<String, String> queryParams = getQueryParams(query); response = elide.get(getPath(query), queryParams, user); log.debug("JSONAPI_V1_0 getResponseCode: {}", response.getResponseCode()); log.debug("JSONAPI_V1_0 getBody: {}", response.getBody()); } else if (queryType.equals(QueryType.GRAPHQL_V1_0)) { response = runner.run(query, user); log.debug("GRAPHQL_V1_0 getResponseCode: {}", response.getResponseCode()); log.debug("GRAPHQL_V1_0 getBody: {}", response.getBody()); } if (response.getResponseCode() == 200) { <START> asyncQuery = updateAsyncQueryStatus(QueryStatus.COMPLETE, id); <END> } else { asyncQuery = updateAsyncQueryStatus(QueryStatus.FAILURE, id); } asyncQueryResult = createAsyncQueryResult(response.getResponseCode(), response.getBody(), asyncQuery, id); updateAsyncQueryStatus(asyncQueryResult, id); } catch (IOException e) { log.error("IOException: {}", e.getMessage()); } catch (URISyntaxException e) { log.error("URISyntaxException: {}", e.getMessage()); } catch (Exception e) { log.error("Exception: {}", e.getMessage()); } }</code><technical_language>GraphQL return response codes of 200 errors. discuss UI figure out want do in this case</technical_language>

Target:
protected void processQuery() { try { asyncQueryDao.updateStatus(queryObj, QueryStatus.PROCESSING); ElideResponse response = null; log.debug("AsyncQuery Object from request: {}", queryObj); if (queryObj.getQueryType().equals(QueryType.JSONAPI_V1_0)) { MultivaluedMap<String, String> queryParams = getQueryParams(queryObj.getQuery()); log.debug("Extracted QueryParams from AsyncQuery Object: {}", queryParams); response = elide.get(getPath(queryObj.getQuery()), queryParams, user); log.debug("JSONAPI_V1_0 getResponseCode: {}, JSONAPI_V1_0 getBody: {}", response.getResponseCode(), response.getBody()); } else if (queryObj.getQueryType().equals(QueryType.GRAPHQL_V1_0)) { response = runner.run(queryObj.getQuery(), user); log.debug("GRAPHQL_V1_0 getResponseCode: {}, GRAPHQL_V1_0 getBody: {}", response.getResponseCode(), response.getBody()); } if (response == null) { throw new NoHttpResponseException("Response for request returned as null"); } asyncQueryDao.createAsyncQueryResult(response.getResponseCode(), response.getBody(), queryObj, queryObj.getId()); asyncQueryDao.updateStatus(queryObj, QueryStatus.COMPLETE); } catch (Exception e) { log.error("Exception: {}", e); if (e.getClass().equals(InterruptedException.class)) { asyncQueryDao.updateStatus(queryObj, QueryStatus.TIMEDOUT); } else { asyncQueryDao.updateStatus(queryObj, QueryStatus.FAILURE); } } }
Source:
<code>public Form(long id, String name, int index, Type type, <START> Country country) { <END> setId(required(id, "id is required")); setName(required(name, "name is required")); setIndex(required(index, "index is required")); setType(required(type, "type is required")); setCountry(required(country, "country is required")); }</code><technical_language>remove private setters? necessary private setters, reduce size of class</technical_language>

Target:
public Form(long id, String name, int index, Type type, Country country) { this.id = required(id, "id is required"); this.name = required(name, "name is required"); this.index = required(index, "index is required"); this.type = required(type, "type is required"); this.country = required(country, "country is required"); }
Source:
<code>public void cleanup() throws DBException { Measurements measurements = Measurements.getMeasurements(); try { long st = System.nanoTime(); if (bufferedMutator != null) { bufferedMutator.close(); } if (currentTable != null) { currentTable.close(); } long en = System.nanoTime(); final String type = clientSideBuffering ? "UPDATE" : "CLEANUP"; measurements.measure(type, (int) ((en - st) / 1000)); synchronized (THREAD_COUNT) { int threadCount = THREAD_COUNT.decrementAndGet(); if (threadCount <= 0 && connection != null) { connection.close(); <START> connection = null; <END> } } } catch (IOException e) { throw new DBException(e); } }</code><technical_language>This synchronized block needed. closing of connection is protected decrement of atomic integer</technical_language>

Target:
public void cleanup() throws DBException { Measurements measurements = Measurements.getMeasurements(); try { long st = System.nanoTime(); if (bufferedMutator != null) { bufferedMutator.close(); } if (currentTable != null) { currentTable.close(); } long en = System.nanoTime(); final String type = clientSideBuffering ? "UPDATE" : "CLEANUP"; measurements.measure(type, (int) ((en - st) / 1000)); int threadCount = THREAD_COUNT.decrementAndGet(); if (threadCount <= 0) { synchronized (THREAD_COUNT) { if (connection != null) { connection.close(); connection = null; } } } } catch (IOException e) { throw new DBException(e); } }
Source:
<code><START> public LongRunningOperationStatus getStatus() { <END> return innerResponse.getStatus(); }</code><technical_language>putting out early in this review big of a fan of LongRunningOperationStatus - long</technical_language>

Target:
public LongRunningOperationStatus getStatus() { return pollResponse.getStatus(); }
Source:
<code><START> @Nullable public static JDBCDriverShim ensureJDBCDriverIsAvailable(Class<? extends Driver> jdbcDriverClass, <END> String connectionString, String jdbcPluginType, String jdbcPluginName) throws IllegalAccessException, InstantiationException, SQLException { try { DriverManager.getDriver(connectionString); } catch (SQLException e) { LOG.debug("Plugin Type: and Plugin Name: {}; Driver Class: not found. Registering JDBC driver via shim ", jdbcPluginType, jdbcPluginName, jdbcDriverClass.getName(), JDBCDriverShim.class.getName()); JDBCDriverShim driverShim = new JDBCDriverShim(jdbcDriverClass.newInstance()); try { DBUtils.deregisterAllDrivers(jdbcDriverClass); } catch (NoSuchFieldException | ClassNotFoundException e1) { LOG.error("Unable to deregister JDBC Driver class {}", jdbcDriverClass); } DriverManager.registerDriver(driverShim); return driverShim; } return null; }</code><technical_language>@Nullable a new line. java @Nullable public static ..</technical_language>

Target:
public static DriverCleanup ensureJDBCDriverIsAvailable(Class<? extends Driver> jdbcDriverClass, String connectionString, String jdbcPluginType, String jdbcPluginName) throws IllegalAccessException, InstantiationException, SQLException { try { DriverManager.getDriver(connectionString); return new DriverCleanup(null); } catch (SQLException e) { LOG.debug("Plugin Type: and Plugin Name: {}; Driver Class: not found. Registering JDBC driver via shim ", jdbcPluginType, jdbcPluginName, jdbcDriverClass.getName(), JDBCDriverShim.class.getName()); final JDBCDriverShim driverShim = new JDBCDriverShim(jdbcDriverClass.newInstance()); try { DBUtils.deregisterAllDrivers(jdbcDriverClass); } catch (NoSuchFieldException | ClassNotFoundException e1) { LOG.error("Unable to deregister JDBC Driver class {}", jdbcDriverClass); } DriverManager.registerDriver(driverShim); return new DriverCleanup(driverShim); } }
Source:
<code>public static Object getMockObject(String mockService, Class serviceType) { boolean isDefault = ConfigUtils.isDefault(mockService); if (isDefault) { mockService = serviceType.getName() + "Mock"; } Class<?> mockClass; try { mockClass = ReflectUtils.forName(mockService); } catch (Exception e) { if (!isDefault) { ExtensionFactory extensionFactory = ExtensionLoader.getExtensionLoader(ExtensionFactory.class).getAdaptiveExtension(); Object obj = extensionFactory.getExtension(serviceType, mockService); if (obj != null) { return obj; } } throw new IllegalStateException("Did not find mock class or instance " + mockService + ", please check" + <START> " if there's mock class or instance implementing interface " + serviceType.getName(), e); <END> } if (mockClass == null || !serviceType.isAssignableFrom(mockClass)) { throw new IllegalStateException("The mock class " + mockClass.getName() + " not implement interface " + serviceType.getName()); } try { return mockClass.newInstance(); } catch (InstantiationException e) { throw new IllegalStateException("No default constructor from mock class " + mockClass.getName(), e); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } }</code><technical_language>please check" + " if mock class instance put line</technical_language>

Target:
public static Object getMockObject(String mockService, Class serviceType) { if (ConfigUtils.isDefault(mockService)) { mockService = serviceType.getName() + "Mock"; } Class<?> mockClass = ReflectUtils.forName(mockService); if (!serviceType.isAssignableFrom(mockClass)) { throw new IllegalStateException("The mock class " + mockClass.getName() + " not implement interface " + serviceType.getName()); } try { return mockClass.newInstance(); } catch (InstantiationException e) { throw new IllegalStateException("No default constructor from mock class " + mockClass.getName(), e); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } }
Source:
<code>private void updatePortMirroringChangability() { AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { <START> List<VM> vms = (List<VM>) ((VdcQueryReturnValue) ReturnValue).getReturnValue(); <END> if (vms != null && !vms.isEmpty()) { getPortMirroring().setChangeProhibitionReason(ConstantsManager.getInstance() .getConstants() .portMirroringNotChangedIfUsedByVms()); getPortMirroring().setIsChangable(false); } stopProgress(); } }; IdQueryParameters params = new IdQueryParameters(getProfile().getId()); startProgress(null); Frontend.getInstance().runQuery(VdcQueryType.GetVmsByVnicProfileId, params, asyncQuery); }</code><technical_language>I change Collection<VM>. specific List functionality here, this improve flexibility prevent breakage in case decides query returns a Set, for example</technical_language>

Target:
private void updatePortMirroringChangability() { AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { Collection<VM> vms = (Collection<VM>) ((VdcQueryReturnValue) ReturnValue).getReturnValue(); if (vms != null && !vms.isEmpty()) { getPortMirroring().setChangeProhibitionReason(ConstantsManager.getInstance() .getConstants() .portMirroringNotChangedIfUsedByVms()); getPortMirroring().setIsChangable(false); } stopProgress(); } }; IdQueryParameters params = new IdQueryParameters(getProfile().getId()); startProgress(null); Frontend.getInstance().runQuery(VdcQueryType.GetVmsByVnicProfileId, params, asyncQuery); }
Source:
<code>public void checkLatency(final ZooKeeperServer zks, Request request) { long requestLatency = Time.currentElapsedTime() - request.createTime; boolean enabledAndAboveThreshold = (requestWarnThresholdMs == 0) || (requestWarnThresholdMs > -1 && requestLatency > requestWarnThresholdMs); if (enabledAndAboveThreshold) { zks.serverStats().incNumRequestsAboveThresholdTime(); <START> if(!waitForLoggingWarnThresholdMsg) { <END> synchronized (waitForLoggingWarnThresholdMsg) { if (!waitForLoggingWarnThresholdMsg) { waitForLoggingWarnThresholdMsg = true; LOG.warn("Request exceeded threshold. Took ms", request, requestLatency); startCount = zks.serverStats().getNumRequestsAboveThresholdTime(); timer.schedule(new TimerTask() { @Override public void run() { waitForLoggingWarnThresholdMsg = false; long count = zks.serverStats().getNumRequestsAboveThresholdTime() - startCount; LOG.warn("Number of requests that exceeded ms in past ms: {}", requestWarnThresholdMs, delayTimeForLoggingWarnThresholdMsg, count); } }, delayTimeForLoggingWarnThresholdMsg); } } } } }</code><technical_language>nit: space if (</technical_language>

Target:
public void checkLatency(final ZooKeeperServer zks, Request request) { long requestLatency = Time.currentElapsedTime() - request.createTime; boolean enabledAndAboveThreshold = (requestWarnThresholdMs == 0) || (requestWarnThresholdMs > -1 && requestLatency > requestWarnThresholdMs); if (enabledAndAboveThreshold) { zks.serverStats().incNumRequestsAboveThresholdTime(); boolean success = waitForLoggingWarnThresholdMsg.compareAndSet(Boolean.FALSE, Boolean.TRUE); if (success) { LOG.warn("Request exceeded threshold. Took ms", request, requestLatency); startCount = zks.serverStats().getNumRequestsAboveThresholdTime(); timer.schedule(new TimerTask() { @Override public void run() { long count = zks.serverStats().getNumRequestsAboveThresholdTime() - startCount; LOG.warn("Number of requests that exceeded ms in past ms: {}", requestWarnThresholdMs, delayTimeForLoggingWarnThresholdMsg, count); waitForLoggingWarnThresholdMsg.set(Boolean.FALSE); } }, delayTimeForLoggingWarnThresholdMsg); } } }
Source:
<code><START> public List<TimelineView> getTimelines(final String eventTypeName, final Client client) <END> throws ForbiddenAccessException, UnableProcessException, TimelineException { if (!client.getClientId().equals(securitySettings.getAdminClientId())) { throw new ForbiddenAccessException("Request is forbidden for user " + client.getClientId()); } try { final EventType eventType = eventTypeCache.getEventType(eventTypeName); return timelineDbRepository.listTimelines(eventType.getName()).stream() .map(TimelineView::new) .collect(Collectors.toList()); } catch (final NoSuchEventTypeException e) { throw new UnableProcessException("EventType \"" + eventTypeName + "\" does not exist", e); } catch (final InternalNakadiException e) { throw new TimelineException("Could not get event type: " + eventTypeName, e); } }</code><technical_language>Generating view service level</technical_language>

Target:
public List<Timeline> getTimelines(final String eventTypeName, final Client client) throws ForbiddenAccessException, UnableProcessException, TimelineException { if (!client.getClientId().equals(securitySettings.getAdminClientId())) { throw new ForbiddenAccessException("Request is forbidden for user " + client.getClientId()); } try { final EventType eventType = eventTypeCache.getEventType(eventTypeName); return timelineDbRepository.listTimelines(eventType.getName()); } catch (final NoSuchEventTypeException e) { throw new NotFoundException("EventType \"" + eventTypeName + "\" does not exist", e); } catch (final InternalNakadiException e) { throw new TimelineException("Could not get event type: " + eventTypeName, e); } }
Source:
<code>private static ExpressionInterpreter getExpressionInterpreter( Expression expression, Map<Symbol, Type> symbolTypes, Map<Symbol, Integer> symbolToInputMappings, Metadata metadata, SqlParser sqlParser, Session session) { SymbolToInputParameterRewriter rewriter = new SymbolToInputParameterRewriter(symbolTypes, symbolToInputMappings); Expression rewritten = rewriter.rewrite(expression); List<Type> inputTypes = rewriter.getInputTypes(); ImmutableMap.Builder<Integer, Type> parameterTypes = ImmutableMap.builder(); for (int parameter = 0; parameter < inputTypes.size(); parameter++) { Type type = inputTypes.get(parameter); parameterTypes.put(parameter, type); } <START> IdentityLinkedHashMap<Expression, Type> expressionTypes = NodeRefCollections.toIdentityMap(getExpressionTypesFromInput(session, metadata, sqlParser, parameterTypes.build(), rewritten, emptyList())); <END> return expressionInterpreter(rewritten, metadata, session, expressionTypes); }</code><technical_language>change IdentityLinkedHashMap<Expression, Type> expressionTypes Map<Node<? extends Expression>, Type> expressionTypes</technical_language>

Target:
private static ExpressionInterpreter getExpressionInterpreter( Expression expression, Map<Symbol, Type> symbolTypes, Map<Symbol, Integer> symbolToInputMappings, Metadata metadata, SqlParser sqlParser, Session session) { SymbolToInputParameterRewriter rewriter = new SymbolToInputParameterRewriter(symbolTypes, symbolToInputMappings); Expression rewritten = rewriter.rewrite(expression); List<Type> inputTypes = rewriter.getInputTypes(); ImmutableMap.Builder<Integer, Type> parameterTypes = ImmutableMap.builder(); for (int parameter = 0; parameter < inputTypes.size(); parameter++) { Type type = inputTypes.get(parameter); parameterTypes.put(parameter, type); } Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypesFromInput(session, metadata, sqlParser, parameterTypes.build(), rewritten, emptyList()); return expressionInterpreter(rewritten, metadata, session, expressionTypes); }
Source:
<code><START> private void resetData() { <END> for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : fQuarks) { deleteSeries(createSeriesName(ss, quark)); } } fQuarks.clear(); }</code><technical_language>In updateChart(), collection fModules is updated first, this method is called. anymore modules able recreate series need deleted. series set SWTChart delete id provided ISeries</technical_language>

Target:
private void resetData() { for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : fQuarks) { deleteSeries(createSeriesName(ss, quark)); } } fQuarks.clear(); fModules.clear(); }
Source:
<code>private void readFullAccountAndUpdateCache(String pathToFullAccountMetadata) { long startTimeMs = System.currentTimeMillis(); logger.trace("Start fetching full account metadata set from path={}", pathToFullAccountMetadata); ZNRecord zNRecord = helixStore.get(pathToFullAccountMetadata, null, AccessOption.PERSISTENT); if (zNRecord == null) { logger.debug("The ZNRecord to read does not exist on path={}, clearing local cache", pathToFullAccountMetadata); cache.update(new AccountTwoKeyMap()); return; } Map<String, String> accountMap = zNRecord.getMapField(ACCOUNT_METADATA_MAP_KEY); if (accountMap == null) { logger.debug("The ZNRecord={} to read on path={} does not have a simple map with key={}, clearing local cache", zNRecord, pathToFullAccountMetadata, ACCOUNT_METADATA_MAP_KEY); cache.update(new AccountTwoKeyMap()); return; } cache.update(new AccountTwoKeyMap(accountMap)); <START> logger.trace("Completed fetching full account metadata set from path={}, took time={}ms", pathToFullAccountMetadata, <END> System.currentTimeMillis() - startTimeMs); }</code><technical_language>Consider adding metrics for tracking long updates</technical_language>

Target:
private void readFullAccountAndUpdateCache(String pathToFullAccountMetadata) throws JSONException { lock.lock(); try { long startTimeMs = System.currentTimeMillis(); logger.trace("Start reading full account metadata set from path={}", pathToFullAccountMetadata); ZNRecord zNRecord = helixStore.get(pathToFullAccountMetadata, null, AccessOption.PERSISTENT); logger.trace("Fetched ZNRecord from path={}, took time={} ms", pathToFullAccountMetadata, System.currentTimeMillis() - startTimeMs); if (zNRecord == null) { logger.debug("The ZNRecord to read does not exist on path={}", pathToFullAccountMetadata); } else { Map<String, String> remoteAccountMap = zNRecord.getMapField(ACCOUNT_METADATA_MAP_KEY); if (remoteAccountMap == null) { logger.debug("ZNRecord={} to read on path={} does not have a simple map with key={}", zNRecord, pathToFullAccountMetadata, ACCOUNT_METADATA_MAP_KEY); } else { logger.trace("Start parsing remote account data."); AccountInfoMap newAccountInfoMap = new AccountInfoMap(remoteAccountMap); accountInfoMapRef.set(newAccountInfoMap); logger.trace("Completed updating local cache with number={} accounts", newAccountInfoMap.getAccounts().size()); } } } finally { lock.unlock(); } }
Source:
<code>private SchedulerBase createScheduler( final JobMasterPartitionTracker partitionTracker, final JobVertex... vertices) throws Exception { final JobGraph jobGraph = new JobGraph(new JobID(), "test job", vertices); final SchedulerBase scheduler = SchedulerTestingUtils.newSchedulerBuilder(jobGraph) <START> .setExecutionSlotAllocatorFactory(SchedulerTestingUtils.slotSharingExecutionSlotAllocatorFactoryBuilder() <END> .withAllocationTimeout(Time.seconds(10)) .build()) .setPartitionTracker(partitionTracker) .build(); scheduler.initialize(mainThreadExecutor.getMainThreadExecutor()); mainThreadExecutor.execute(scheduler::startScheduling); return scheduler; }</code><technical_language>this default? is custom allocation timeout setting here</technical_language>

Target:
private SchedulerBase createScheduler( final JobMasterPartitionTracker partitionTracker, final JobVertex... vertices) throws Exception { final JobGraph jobGraph = new JobGraph(new JobID(), "test job", vertices); final SchedulerBase scheduler = SchedulerTestingUtils.newSchedulerBuilder(jobGraph) .setExecutionSlotAllocatorFactory( SchedulerTestingUtils.newSlotSharingExecutionSlotAllocatorFactory()) .setPartitionTracker(partitionTracker) .build(); scheduler.initialize(mainThreadExecutor.getMainThreadExecutor()); mainThreadExecutor.execute(scheduler::startScheduling); return scheduler; }