auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void testServiceAnnotation() { <END> ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(ConfigTest.class.getPackage().getName().replace('.', '/') + "/service-annotation.xml"); ctx.start(); try { DemoService demoService = refer("dubbo://127.0.0.1:20887"); String hello = demoService.sayName("hello"); assertEquals("say:hello", hello); } finally { ctx.stop(); ctx.close(); } }</code><technical_language>unit test is enough</technical_language>

Target:
public void testServiceAnnotation() { AnnotationConfigApplicationContext providerContext = new AnnotationConfigApplicationContext(); providerContext.register(ProviderConfiguration.class); providerContext.refresh(); ReferenceConfig<HelloService> reference = new ReferenceConfig<HelloService>(); reference.setApplication(new ApplicationConfig("consumer")); reference.setRegistry(new RegistryConfig(RegistryConfig.NO_AVAILABLE)); reference.setInterface(HelloService.class); reference.setUrl("dubbo://127.0.0.1:12345"); String hello = reference.get().sayHello("hello"); assertEquals("Hello, hello", hello); }
Source:
<code>public void sendMessages(String topic, String... messages) throws IOException { try (AutoClosableProcess autoClosableProcess = AutoClosableProcess.runNonBlocking( kafkaDir.resolve(Paths.get("bin", "kafka-console-producer.sh")).toString(), "--broker-list", KAFKA_ADDRESS, "--topic", topic, "--property", "parse.key=true", "--property", <START> "key.separator=\t")) { <END> try (PrintStream printStream = new PrintStream(autoClosableProcess.getProcess().getOutputStream(), true, StandardCharsets.UTF_8.name())) { for (final String message : messages) { printStream.println(message); } printStream.flush(); } try { autoClosableProcess.getProcess().waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }</code><technical_language>baking this this method smells a bit. is obvious user this format is expected. if key is provided, in SQLClientKafkaITCase</technical_language>

Target:
public void sendMessages(String topic, String... messages) throws IOException { List<String> args = createSendMessageArguments(topic); sendMessagesAndWait(args, messages); }
Source:
<code>public Map<ObjectId, String> call() throws GitAPIException { try { Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>(); <START> LinkedList<NameRevCommit> pending = new LinkedList<NameRevCommit>(); <END> addPrefixes(nonCommits, pending); int cutoff = minCommitTime() - COMMIT_TIME_SLOP; while (!pending.isEmpty()) { NameRevCommit c = pending.remove(); if (c.getCommitTime() < cutoff) continue; boolean merge = c.getParentCount() > 1; long cost = c.cost + (merge ? MERGE_COST : 1); for (int i = 0; i < c.getParentCount(); i++) { NameRevCommit p = (NameRevCommit) walk.parseCommit(c.getParent(i)); if (p.tip == null || compare(c.tip, cost, p.tip, p.cost) < 0) { if (merge) { p.tip = c.format().append('^').append(i + 1).toString(); p.distance = 0; } else { p.tip = c.tip; p.distance = c.distance + 1; } p.cost = cost; pending.add(p); } } } Map<ObjectId, String> result = new LinkedHashMap<ObjectId, String>(revs.size()); for (ObjectId id : revs) { RevObject o = walk.parseAny(id); if (o instanceof NameRevCommit) { NameRevCommit c = (NameRevCommit) o; if (c.tip != null) result.put(id, simplify(c.format().toString())); } else { String name = nonCommits.get(id); if (name != null) result.put(id, simplify(name)); } } setCallable(false); walk.release(); return result; } catch (IOException e) { walk.reset(); throw new JGitInternalException(e.getMessage(), e); } }</code><technical_language>FIFORevQueue? generic, RevCommit member type</technical_language>

Target:
public Map<ObjectId, String> call() throws GitAPIException { try { Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>(); FIFORevQueue pending = new FIFORevQueue(); addPrefixes(nonCommits, pending); int cutoff = minCommitTime() - COMMIT_TIME_SLOP; while (true) { NameRevCommit c = (NameRevCommit) pending.next(); if (c == null) break; if (c.getCommitTime() < cutoff) continue; boolean merge = c.getParentCount() > 1; long cost = c.cost + (merge ? MERGE_COST : 1); for (int i = 0; i < c.getParentCount(); i++) { NameRevCommit p = (NameRevCommit) walk.parseCommit(c.getParent(i)); if (p.tip == null || compare(c.tip, cost, p.tip, p.cost) < 0) { if (merge) { p.tip = c.format().append('^').append(i + 1).toString(); p.distance = 0; } else { p.tip = c.tip; p.distance = c.distance + 1; } p.cost = cost; pending.add(p); } } } Map<ObjectId, String> result = new LinkedHashMap<ObjectId, String>(revs.size()); for (ObjectId id : revs) { RevObject o = walk.parseAny(id); if (o instanceof NameRevCommit) { NameRevCommit c = (NameRevCommit) o; if (c.tip != null) result.put(id, simplify(c.format().toString())); } else { String name = nonCommits.get(id); if (name != null) result.put(id, simplify(name)); } } setCallable(false); walk.release(); return result; } catch (IOException e) { walk.reset(); throw new JGitInternalException(e.getMessage(), e); } }
Source:
<code>public void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException{ ExecIndexRow keyRow1; ExecRow row; DataValueDescriptor IDOrderable; TabInfoImpl ti=getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM); SYSCONSTRAINTSRowFactory rf=(SYSCONSTRAINTSRowFactory)ti.getCatalogRowFactory(); IDOrderable=getIDValueAsCHAR(formerUUID); keyRow1=exFactory.getIndexableRow(1); keyRow1.setColumn(1,IDOrderable); row=rf.makeRow(cd,null); assert rf.getNumIndexes()==3:"Programmer error: there are more indexes on sysconstraints than expected"; boolean[] bArray=new boolean[3]; if(colsToSet==null){ bArray[0]=true; bArray[1]=true; bArray[2]=true; }else{ for(int colToSet : colsToSet){ switch(colToSet){ case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTID: bArray[0]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTNAME: case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_SCHEMAID: bArray[1]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_TABLEID: bArray[2]=true; break; default: <START> assert false: "Unexpected colToSet: " + colToSet; <END> } } } ti.updateRow(keyRow1,row,SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX1_ID,bArray,colsToSet,tc); }</code><technical_language>other value: In SpliceDataDictionary.java protected void addSubKeyConstraint( colsToSet[0]=SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT</technical_language>

Target:
public void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException{ ExecIndexRow keyRow1; ExecRow row; DataValueDescriptor IDOrderable; TabInfoImpl ti=getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM); SYSCONSTRAINTSRowFactory rf=(SYSCONSTRAINTSRowFactory)ti.getCatalogRowFactory(); IDOrderable=getIDValueAsCHAR(formerUUID); keyRow1=exFactory.getIndexableRow(1); keyRow1.setColumn(1,IDOrderable); row=rf.makeRow(cd,null); assert rf.getNumIndexes()==3:"Programmer error: there are more indexes on sysconstraints than expected"; boolean[] bArray=new boolean[3]; if(colsToSet==null){ bArray[0]=true; bArray[1]=true; bArray[2]=true; }else{ for(int colToSet : colsToSet){ switch(colToSet){ case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTID: bArray[0]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTNAME: case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_SCHEMAID: bArray[1]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_TABLEID: bArray[2]=true; break; default: } } } ti.updateRow(keyRow1,row,SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX1_ID,bArray,colsToSet,tc); }
Source:
<code>public QueryResult<Alert> queryAlerts(final AlertQuery query) { assertIsOpen(); final Predicate<Alert> containsPredicate = query.getContains() .map(c -> (Predicate<Alert>) a -> a.getDescription().contains(c)) .orElse(e -> true); final ImmutableList<Alert> alerts = _alerts.values().stream() .filter(containsPredicate) .skip(query.getOffset().orElse(0)) <START> .limit(query.getOffset().orElse(1000)) <END> .collect(ImmutableList.toImmutableList()); final long total = _alerts.values().stream() .filter(containsPredicate) .count(); return new DefaultQueryResult<>(alerts, total); }</code><technical_language>query.getLimit()</technical_language>

Target:
public QueryResult<Alert> queryAlerts(final AlertQuery query) { assertIsOpen(); if (!query.getOrganization().equals(_organization)) { return new DefaultQueryResult<>(ImmutableList.of(), 0); } final Predicate<Alert> containsPredicate = query.getContains() .map(c -> (Predicate<Alert>) a -> a.getDescription().contains(c)) .orElse(e -> true); final ImmutableList<Alert> alerts = _alerts.values().stream() .filter(containsPredicate) .skip(query.getOffset().orElse(0)) .limit(query.getLimit()) .collect(ImmutableList.toImmutableList()); final long total = _alerts.values().stream() .filter(containsPredicate) .count(); return new DefaultQueryResult<>(alerts, total); }
Source:
<code>public void run() { final Shell shell = getSite().getShell(); final ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell); try { dialog.run(true, false, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.setTaskName(Messages.DiscoveryViewer_waitingForDiscoveryCompletion); for (ConnectorDescriptorItemUi item : discoveryViewer.getAllConnectorsItemsUi()) { item.getConnectorUnits(); } } }); List<ConnectorDescriptor> toInstall = new ArrayList<ConnectorDescriptor>(discoveryViewer.getInstallableConnectors()); toInstall.addAll(discoveryViewer.getUpdatableConnectors()); JBossDiscoveryUi.install(toInstall, dialog); <START> } catch (Exception ex) { <END> JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ex.getMessage(), ex)); } }</code><technical_language>java } catch (InterruptedException ex) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ex.getMessage(), ex)); } catch (InvocationTargetException ite) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ite.getMessage(), ite)); }</technical_language>

Target:
public void run() { final Shell shell = getSite().getShell(); final ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell); try { dialog.run(true, false, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.setTaskName(Messages.DiscoveryViewer_waitingForDiscoveryCompletion); for (ConnectorDescriptorItemUi item : discoveryViewer.getAllConnectorsItemsUi()) { item.getConnectorUnits(); } } }); List<ConnectorDescriptor> toInstall = new ArrayList<ConnectorDescriptor>(discoveryViewer.getInstallableConnectors()); toInstall.addAll(discoveryViewer.getUpdatableConnectors()); JBossDiscoveryUi.install(toInstall, dialog); } catch (InterruptedException ex) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ex.getMessage(), ex)); } catch (InvocationTargetException ite) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ite.getMessage(), ite)); } }
Source:
<code>public static Block parse(final mjson.Json blockJson) { final Block block = new Block(); final mjson.Json uri = blockJson.at("url"); if (uri == null) { <START> throw new IllegalArgumentException("No URI found in Htsget data block"); <END> } try { block.uri = new URI(uri.asString()); } catch (final URISyntaxException e) { throw new IllegalArgumentException("Failed to parse URI in Htsget data block", e); } final mjson.Json dataClass = blockJson.at("class"); if (dataClass != null) { block.dataClass = HtsgetClass.valueOf(dataClass.asString().toLowerCase()); } final mjson.Json headers = blockJson.at("headers"); if (headers != null) { block.headers = headers.asJsonMap().entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> e.getValue().asString() )); } return block; }</code><technical_language>Again, right exception type. a HtsgetMalformedResponseException. a good idea output json errors easier debug. (You limit some number of characters avoid dumping a massive datablock screen accidentally)</technical_language>

Target:
public static Block parse(final mjson.Json blockJson) { final mjson.Json uriJson = blockJson.at("url"); if (uriJson == null) { throw new HtsgetMalformedResponseException("No URI found in Htsget data block: " + blockJson.toString().substring(0, Math.min(100, blockJson.toString().length()))); } final URI uri; try { uri = new URI(uriJson.asString()); } catch (final URISyntaxException e) { throw new HtsgetMalformedResponseException("Could not parse URI in Htsget data block: " + uriJson.asString(), e); } final mjson.Json dataClassJson = blockJson.at("class"); final HtsgetClass dataClass = dataClassJson == null ? null : HtsgetClass.valueOf(dataClassJson.asString().toLowerCase()); final mjson.Json headersJson = blockJson.at("headers"); final Map<String, String> headers = headersJson == null ? null : headersJson.asJsonMap().entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> e.getValue().asString() )); return new Block(uri, headers, dataClass); }
Source:
<code>public void setUpClass() throws Exception { <START> log.info("setting up hive test driver"); <END> }</code><technical_language>GoraHiveTestDriver setUpClass / tearDownClass? Is pragmatically control ( start/stop ) embedded server instance? this setup guarantee embedded server instance is running start executing tests? failures if guarantee</technical_language>

Target:
public void setUpClass() throws Exception { log.info("setting up hive test driver"); if (testServer == null) { testServer = new HiveTestServer(); } testServer.start(); }
Source:
<code>public Properties trackVideoPlaying(String videoId, Double currentTime, String courseId, String unitUrl){ <START> try{ <END> SegmentAnalyticsEvent aEvent = getCommonPropertiesWithCurrentTime(currentTime, videoId, Values.VIDEO_PLAYED); aEvent.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); tracker.track(Keys.PLAYED_VIDEO, aEvent.properties); return aEvent.properties; }catch(Exception e){ logger.error(e); } return null; }</code><technical_language>great if generic catch blocks removed tracker</technical_language>

Target:
public Properties trackVideoPlaying(String videoId, Double currentTime, String courseId, String unitUrl){ SegmentAnalyticsEvent aEvent = getCommonPropertiesWithCurrentTime(currentTime, videoId, Values.VIDEO_PLAYED); aEvent.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); tracker.track(Events.PLAYED_VIDEO, aEvent.properties); return aEvent.properties; }
Source:
<code>public NodesByCommitTimeFilter(String filterText) { if (filterText != null) { Matcher matcher = FILTER_ACTIVE_PATTERN.matcher(filterText); active = matcher.matches(); if (active) { if (filterText.length() > 1) { <START> maxCount = Integer.parseInt(filterText.substring(1)); <END> } filtering = maxCount > 0; } } }</code><technical_language>This produces a NumberFormatExpection if I enter "#2000000000000000000000"</technical_language>

Target:
public NodesByCommitTimeFilter(String filterText) { if (filterText != null) { Matcher matcher = FILTER_ACTIVE_PATTERN.matcher(filterText); active = matcher.matches(); if (active) { if (filterText.length() > 1) { try { maxCount = Integer.parseInt(filterText.substring(1)); } catch (NumberFormatException e) { } } } } }
Source:
<code>public synchronized void aggregate(final ByteBuffer buffer, final int position) { final Object object = selector.getObject(); if (object == null) { return; } final DoublesUnion union = unions.get(buffer).get(position); if (object instanceof DoublesSketch) { union.update((DoublesSketch) object); } else { union.update(selector.getDouble()); <START> } <END> }</code><technical_language>nit: nice extract 5 lines in of aggregator classes</technical_language>

Target:
public synchronized void aggregate(final ByteBuffer buffer, final int position) { final DoublesUnion union = unions.get(buffer).get(position); DoublesSketchMergeAggregator.updateUnion(selector, union); }
Source:
<code>public void testGetUnboundEndpoints() throws Exception { Trace trace1 = new Trace(); trace1.setId("1"); <START> trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); END> Consumer c1 = new Consumer(); c1.setUri("testuri"); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<Trace>(); traces.add(trace1); tracePublisher.publish(null, traces); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<Trace> result = traceService.searchFragments(null, new Criteria()); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); List<EndpointInfo> endpoints = analyticsService.getUnboundEndpoints(null, 0, 0, true); assertNotNull(endpoints); assertEquals(1, endpoints.size()); assertEquals("testuri", endpoints.get(0).getEndpoint()); }</code><technical_language>4000 need converted microseconds - "within hour" - currently represented 4 seconds, needs 4000000 same. if test works, possibly issue. If a fix is applied, needs applied multiple times in this file</technical_language>

Target:
public void testGetUnboundEndpoints() throws Exception { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); Consumer c1 = new Consumer(); c1.setUri("testuri"); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<Trace>(); traces.add(trace1); tracePublisher.publish(null, traces); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<Trace> result = traceService.searchFragments(null, new Criteria()); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); List<EndpointInfo> endpoints = analyticsService.getUnboundEndpoints(null, 0, 0, true); assertNotNull(endpoints); assertEquals(1, endpoints.size()); assertEquals("testuri", endpoints.get(0).getEndpoint()); }
Source:
<code>public void executeSQL_shouldReturnNullGivenEmptyString() { adminService.executeSQL(" ", true); <START> verify(adminDAO, never()).executeSQL("was never called",true); <END> }</code><technical_language>please replace verify(adminDAO, never()).executeSQL(anyString(), anyBoolean());</technical_language>

Target:
public void executeSQL_shouldReturnNullGivenEmptyString() { adminService.executeSQL(" ", true); verify(adminDAO, never()).executeSQL(anyString(), anyBoolean()); }
Source:
<code>public final boolean shouldTraverse(NodeTraversal t, Node n, Node parent) { switch (n.getType()) { case Token.BLOCK: if (isLoneBlock(n)) { loneBlocks.push(n); } break; case Token.LET: case Token.CONST: <START> allowLoneBlock(n); <END> break; case Token.CLASS: if (NodeUtil.isClassDeclaration(n)) { allowLoneBlock(n); } break; case Token.FUNCTION: if (NodeUtil.isFunctionDeclaration(n)) { allowLoneBlock(n); } break; } return true; }</code><technical_language>I simpler change to: allowLoneBlock(parent)</technical_language>

Target:
public final boolean shouldTraverse(NodeTraversal t, Node n, Node parent) { switch (n.getType()) { case Token.BLOCK: if (isLoneBlock(n)) { loneBlocks.push(n); } break; case Token.LET: case Token.CONST: allowLoneBlock(parent); break; case Token.CLASS: if (NodeUtil.isClassDeclaration(n)) { allowLoneBlock(parent); } break; case Token.FUNCTION: if (NodeUtil.isFunctionDeclaration(n)) { allowLoneBlock(parent); } break; } return true; }
Source:
<code>public void onInteract(PlayerRightClickEvent e) { Player p = e.getPlayer(); if (openGuide(e, SlimefunGuideLayout.BOOK) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.BOOK); } } else if (openGuide(e, SlimefunGuideLayout.CHEST) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.CHEST); } } else if (openGuide(e, SlimefunGuideLayout.CHEAT_SHEET) == Result.ALLOW) { <START> if (!p.isSneaking()) { <END> p.chat("/sf cheat"); } else { SlimefunGuideSettings.openSettings(p, e.getItem()); } } }</code><technical_language>In other variants is p.isSneaking() negated. I uniform swap avoid confusion here</technical_language>

Target:
public void onInteract(PlayerRightClickEvent e) { Player p = e.getPlayer(); if (openGuide(e, SlimefunGuideLayout.BOOK) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.BOOK); } } else if (openGuide(e, SlimefunGuideLayout.CHEST) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.CHEST); } } else if (openGuide(e, SlimefunGuideLayout.CHEAT_SHEET) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { p.chat("/sf cheat"); } } }
Source:
<code>public String getOption() { final Function<Path, FileTime> createTimeComp = path -> { try { return Files.readAttributes(path, BasicFileAttributes.class).creationTime(); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }; try (final Stream<Path> dirContents = Files.list(UNPACK_DIRECTORY.toPath())) { return dirContents .max(Comparator.comparing(createTimeComp)) .map(Path::toAbsolutePath) <START> .map(Path::toString) <END> .map( s -> { System.err.println(s); return s; }) .map(s -> StringUtils.replace(super.getOption(), KARAF_HOME, s)) .map(s -> s.replace(File.separator + "bin" + File.separator + "..", File.separator)) .map(s -> s + File.separator) .orElseGet(super::getOption); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }</code><technical_language>This is Optional a stream is peek operation</technical_language>

Target:
public String getOption() { final Function<Path, FileTime> createTimeComp = path -> { try { return Files.readAttributes(path, BasicFileAttributes.class).creationTime(); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }; try (final Stream<Path> dirContents = Files.list(UNPACK_DIRECTORY.toPath())) { return dirContents .max(Comparator.comparing(createTimeComp)) .map(Path::toAbsolutePath) .map(Path::toString) .map( s -> { LOGGER.error(s); return s; }) .map(s -> StringUtils.replace(super.getOption(), KARAF_HOME, s)) .map(s -> s.replace(File.separator + "bin" + File.separator + "..", File.separator)) .map(s -> s + File.separator) .orElseGet(super::getOption); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }
Source:
<code>private boolean isSra(final File sourceFile) { try { return SRAAccession.isValid(sourceFile.getPath()); <START> } catch (Exception e) { <END> return false; } }</code><technical_language>final</technical_language>

Target:
private boolean isSra(final File sourceFile) { try { return SRAAccession.isValid(sourceFile.getPath()); } catch (final Exception e) { return false; } }
Source:
<code><START> public ListenableFuture<Object> getEvent() <END> { return future; }</code><technical_language>Throw if set</technical_language>

Target:
public ListenableFuture<Object> getEvent() { return nonCancellationPropagating(future); }
Source:
<code>public void testFulltext() throws Exception { createFileWithBlob(); String nxql = "SELECT * FROM Document WHERE ecm:fulltext='search'"; DocumentModelList esRet = ess.query(new NxQueryBuilder(session).nxql(nxql)); <START> Assert.assertEquals(1, esRet.totalSize()); <END> exception.expect(QueryParseException.class); session.query(nxql); }</code><technical_language>suggestion assertEquals(1, esRet.totalSize()); another in class</technical_language>

Target:
public void testFulltext() throws Exception { createFileWithBlob(); String nxql = "SELECT * FROM Document WHERE ecm:fulltext = 'search'"; DocumentModelList esRet = ess.query(new NxQueryBuilder(session).nxql(nxql)); assertEquals(1, esRet.totalSize()); exception.expect(QueryParseException.class); session.query(nxql); }
Source:
<code>public void waitForServerChanges() { if (!resultReceived) { try { waitForChanges.await(); } catch (InterruptedException e) { <START> throw new ObjectServerError(ErrorCode.UNKNOWN, e); <END> } } }</code><technical_language>log exception a warning here, this of user calls RealmAsyncTask.cancel(). is unexpected error</technical_language>

Target:
public void waitForServerChanges() throws InterruptedException { if (!resultReceived) { waitForChanges.await(); } }
Source:
<code>private Optional<String> loadQualityGateDetails(DbSession dbSession, ProjectAndSnapshot projectAndSnapshot, boolean onAnalysis) { if (onAnalysis) { if (!projectAndSnapshot.snapshotDto.isPresent()) { return Optional.empty(); <START> } <END> String analysisUuid = projectAndSnapshot.snapshotDto.get().getUuid(); MeasureQuery measureQuery = MeasureQuery.builder() .setAnalysisUuid(analysisUuid) .setProjectUuids(Collections.singletonList(projectAndSnapshot.project.projectUuid())) .setMetricKey(CoreMetrics.QUALITY_GATE_DETAILS_KEY) .build(); List<MeasureDto> measures = dbClient.measureDao().selectByQuery(dbSession, measureQuery); return measures.isEmpty() ? Optional.empty() : Optional.ofNullable(measures.get(0).getData()); } Optional<LiveMeasureDto> measure = dbClient.liveMeasureDao().selectMeasure(dbSession, projectAndSnapshot.project.projectUuid(), CoreMetrics.QUALITY_GATE_DETAILS_KEY); return measure.map(LiveMeasureDto::getDataAsString); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Call "Optional#isPresent()" accessing value. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private Optional<String> loadQualityGateDetails(DbSession dbSession, ProjectAndSnapshot projectAndSnapshot, boolean onAnalysis) { if (onAnalysis) { if (!projectAndSnapshot.snapshotDto.isPresent()) { return Optional.empty(); } String analysisUuid = projectAndSnapshot.snapshotDto.get().getUuid(); return dbClient.measureDao().selectMeasure(dbSession, analysisUuid, projectAndSnapshot.project.projectUuid(), CoreMetrics.QUALITY_GATE_DETAILS_KEY) .map(MeasureDto::getData); } Optional<LiveMeasureDto> measure = dbClient.liveMeasureDao().selectMeasure(dbSession, projectAndSnapshot.project.projectUuid(), CoreMetrics.QUALITY_GATE_DETAILS_KEY); return measure.map(LiveMeasureDto::getDataAsString); }
Source:
<code>public void syncStart() { if (_started) { throw new RuntimeException( "Helix Controller already started. Do not call syncStart() more than once."); } else { _started = true; } _watcher = new Thread(this); _watcher.setName(String .format("ClusterManager_Watcher_%s_%s_%s_%d", _clusterName, _instanceName, _type.name(), _uid)); <START> LOG.info("ClusterManager_watcher_{}_{}_{}_{} started, stacktrace {}", _clusterName, _instanceName, _type.name(), _uid, Thread.currentThread().getStackTrace()); <END> _watcher.start(); try { _startCountDown.await(); } catch (InterruptedException e) { LOG.error("Interrupted waiting for start", e); } }</code><technical_language>this log is for debugging. Do want remove then</technical_language>

Target:
public void syncStart() { if (_started) { throw new RuntimeException( "Helix Controller already started. Do not call syncStart() more than once."); } else { _started = true; } _watcher = new Thread(this); _watcher.setName(String .format("ClusterManager_Watcher_%s_%s_%s_%d", _clusterName, _instanceName, _type.name(), _uid)); LOG.debug("ClusterManager_watcher_{}_{}_{}_{} started, stacktrace {}", _clusterName, _instanceName, _type.name(), _uid, Thread.currentThread().getStackTrace()); _watcher.start(); try { _startCountDown.await(); } catch (InterruptedException e) { LOG.error("Interrupted waiting for start", e); } }
Source:
<code>public ResponseEntity<Resources<Resource<License>>> getLicensesOfReleases(@PathVariable("id") String id, OAuth2Authentication oAuth2Authentication) { final User sw360User = this.restControllerHelper.getSw360UserFromAuthentication(oAuth2Authentication); final Project project = this.projectService.getProjectForUserById(id, sw360User); final List<Resource<License>> licenseResources = new ArrayList<>(); final Set<String> allLicenseIds = new HashSet<>(); final Map<String, ProjectReleaseRelationship> releaseIdToUsage = project.getReleaseIdToUsage(); <START> for (final String releaseId : releaseIdToUsage.keySet()) { <END> final Release release = this.releaseService.getReleaseForUserById(releaseId, sw360User); final Set<String> licenseIds = release.getMainLicenseIds(); allLicenseIds.addAll(licenseIds); } for (final String licenseId : allLicenseIds) { final License license = this.licenseService.getLicenseById(licenseId); license.setText(null); license.setShortname(null); final Resource<License> licenseResource = new Resource<>(license); licenseResources.add(licenseResource); } final Resources<Resource<License>> resources = new Resources<>(licenseResources); return new ResponseEntity<>(resources, HttpStatus.OK); }</code><technical_language>I prefer code in method getProjectRelease final Set<String> releaseIds = project.getReleaseIdToUsage().keySet(); for (string releaseId : releaseIds) { ..</technical_language>

Target:
public ResponseEntity<Resources<Resource<License>>> getLicensesOfReleases(@PathVariable("id") String id, OAuth2Authentication oAuth2Authentication) { final User sw360User = restControllerHelper.getSw360UserFromAuthentication(oAuth2Authentication); final Project project = projectService.getProjectForUserById(id, sw360User); final List<Resource<License>> licenseResources = new ArrayList<>(); final Set<String> allLicenseIds = new HashSet<>(); final Set<String> releaseIdToUsage = project.getReleaseIdToUsage().keySet(); for (final String releaseId : releaseIdToUsage) { final Release release = releaseService.getReleaseForUserById(releaseId, sw360User); final Set<String> licenseIds = release.getMainLicenseIds(); allLicenseIds.addAll(licenseIds); } for (final String licenseId : allLicenseIds) { final License license = licenseService.getLicenseById(licenseId); license.setText(null); license.setShortname(null); final Resource<License> licenseResource = new Resource<>(license); licenseResources.add(licenseResource); } final Resources<Resource<License>> resources = new Resources<>(licenseResources); return new ResponseEntity<>(resources, HttpStatus.OK); }
Source:
<code>public Appendable write(Appendable appendable, Context context) throws IOException { context = createSubcontext(context); appendable.append("new ").append(name.simpleName()); Writables.Joiner.on(", ") .wrap("<", "> ") .appendTo(appendable, context, types) .append('('); if (arguments.isPresent()) { arguments.get().write(appendable, context); } appendable.append(") {"); if (!fieldWriters.isEmpty()) { appendable.append('\n'); } for (VariableWriter fieldWriter : fieldWriters.values()) { fieldWriter.write(new IndentingAppendable(appendable), context).append("\n"); } for (MethodWriter methodWriter : methodWriters) { appendable.append('\n'); methodWriter.write(new IndentingAppendable(appendable), context); } for (TypeWriter nestedTypeWriter : nestedTypeWriters) { appendable.append('\n'); nestedTypeWriter.write(new IndentingAppendable(appendable), context); } <START> appendable.append("}"); <END> return appendable; }</code><technical_language>nit: char</technical_language>

Target:
public Appendable write(Appendable appendable, Context context) throws IOException { context = createSubcontext(context); appendable.append("new ").append(name.simpleName()); Writables.Joiner.on(", ") .wrap("<", ">") .appendTo(appendable, context, typeVariables) .append('('); if (arguments.isPresent()) { arguments.get().write(appendable, context); } appendable.append(") {"); if (!fieldWriters.isEmpty()) { appendable.append('\n'); } for (VariableWriter fieldWriter : fieldWriters.values()) { fieldWriter.write(new IndentingAppendable(appendable), context).append("\n"); } for (MethodWriter methodWriter : methodWriters) { appendable.append('\n'); methodWriter.write(new IndentingAppendable(appendable), context); } for (TypeWriter nestedTypeWriter : nestedTypeWriters) { appendable.append('\n'); nestedTypeWriter.write(new IndentingAppendable(appendable), context); } appendable.append('}'); return appendable; }
Source:
<code>protected String getFinalJdbcConnection(final String jdbc) { final Properties parsedProps = Driver.parseURL(jdbc, null); if (parsedProps == null) { return jdbc; } final boolean sslEnabled = PGProperty.SSL.getBoolean(parsedProps) || "".equals(PGProperty.SSL.get(parsedProps)); final String sslmode = PGProperty.SSL_MODE.get(parsedProps); if (sslEnabled && sslmode == null) { <START> return jdbc.concat(LEGACY_DEFAULT_SSL_MODE); <END> } return jdbc; }</code><technical_language>log this</technical_language>

Target:
protected String getFinalJdbcConnection(final String jdbc) { final Properties parsedProps = Driver.parseURL(jdbc, null); if (parsedProps == null) { return jdbc; } final boolean sslEnabled = PGProperty.SSL.getBoolean(parsedProps) || "".equals(PGProperty.SSL.get(parsedProps)); final String sslmode = PGProperty.SSL_MODE.get(parsedProps); if (sslEnabled && sslmode == null) { logger.trace("SSL enabled without SSL mode specified: \"require\" will be used by default, appended to JDBC URL"); return jdbc.concat(LEGACY_DEFAULT_SSL_MODE); } return jdbc; }
Source:
<code>public CustomizedScanInfoBuilder(ScanInfo scanInfo) { this.scanInfo = scanInfo; try { <START> this.scan = new ImmutableScan(new Scan()); <END> } catch (IOException e) { throw new AssertionError("Scan should not throw IOException", e); } }</code><technical_language>This is tests ? Do u want create ImmutableScan a new Scan()? direct new ImmutableScan is enough</technical_language>

Target:
public CustomizedScanInfoBuilder(ScanInfo scanInfo) { this.scanInfo = scanInfo; this.scan = new ImmutableScan(new Scan()); }
Source:
<code>public String largestNumber(int[] nums) { Queue<String> queue = new PriorityQueue<>(new Comparator<String>(){ public int compare(String num1, String num2){ return (num2 + num1).compareTo(num1 + num2); } }); for(int num : nums){ queue.offer(num + ""); } StringBuilder sb = new StringBuilder(); while(queue.size() > 0){ sb.append(queue.poll()); } int sLen = sb.length(); int i = 0 ; while(i < sLen && sb.charAt(i) == '0') { i++; } <START> if(i == sLen) return "0"; <END> return sb.substring(i); }</code><technical_language>unnecessary. If digit is 0, return 0</technical_language>

Target:
public String largestNumber(int[] nums) { Queue<String> queue = new PriorityQueue<>(new Comparator<String>(){ public int compare(String num1, String num2){ return (num2 + num1).compareTo(num1 + num2); } }); for(int num : nums){ queue.offer(num + ""); } StringBuilder sb = new StringBuilder(); while(queue.size() > 0){ sb.append(queue.poll()); } if(sb.toString().charAt(0) == '0') return "0"; return sb.toString(); }
Source:
<code>protected void checkPermission(ProjectControl ctl) throws AuthException { if (!ctl.controlForRef(REF_CONFIG).canUpdate()) { throw new AuthException("You are not allowed to perform this operation." + " To submit into this reference you need 'Push' rights."); <START> } <END> }</code><technical_language>message confusing talks pushing submitting. for this class use: " save changes need 'Push' rights " + REF_CONFIG"."</technical_language>

Target:
protected void checkPermission(ProjectControl ctl) throws AuthException { if (!ctl.controlForRef(REF_CONFIG).canUpdate()) { throw new AuthException("You are not allowed to perform this operation." + " To save changes you need 'Push' rights on " + REF_CONFIG + "."); } }
Source:
<code>public final List<CredentialsDescriptor> getCredentialsDescriptors() { CredentialsProvider provider = getProvider(); List<CredentialsDescriptor> result = DescriptorVisibilityFilter.apply(this, ExtensionList.lookup(CredentialsDescriptor.class)); if (provider != null && provider.isEnabled()) { if (!(result instanceof ArrayList)) { result = new ArrayList<>(result); } <START> result.removeIf(d -> !_isApplicable(d) || !provider._isApplicable(d) || !d.isApplicable(provider)); <END> } return result; }</code><technical_language>stream</technical_language>

Target:
public final List<CredentialsDescriptor> getCredentialsDescriptors() { CredentialsProvider provider = getProvider(); List<CredentialsDescriptor> result = DescriptorVisibilityFilter.apply(this, ExtensionList.lookup(CredentialsDescriptor.class)); if (provider != null && provider.isEnabled()) { result = result.stream() .filter(d -> _isApplicable(d) && provider._isApplicable(d) && d.isApplicable(provider)) .collect(Collectors.toList()); } return result; }
Source:
<code>public TooEagerPollingException() { super("Polling for status updates was blocked because you recently retrieved a response indicating empty queue. " + "Next permitted poll time should be retrieved by querying 'getNextPermittedPollTime()' from the previous response. " + <START> "Polling too close to an empty queue response is a programming error."); <END> }</code><technical_language>Endre til "(...) Polling soon empty queue response (...)"</technical_language>

Target:
public TooEagerPollingException() { super("Polling for status updates was blocked because you recently retrieved a response indicating empty queue. " + "Next permitted poll time should be retrieved by querying 'getNextPermittedPollTime()' from the previous response. " + "Polling too soon after an empty queue response is a programming error."); }
Source:
<code>private void initNetworksTable() { networksTable.enableColumnResizing(); AbstractTextColumn<Network> nameColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getName(); } }; networksTable.addColumn(nameColumn, constants.name(), "40%"); AbstractTextColumn<Network> descriptionColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getDescription(); } }; networksTable.addColumn(descriptionColumn, constants.description(), "60%"); <START> networksTable.setWidth(100 + Style.Unit.PCT.getType()); <END> }</code><technical_language>simply "100px" String? (100 is a constant here.) This <number> + <unitType> concatenation is unnecessarily complex, I think. This applies other occurences well</technical_language>

Target:
private void initNetworksTable() { networksTable.enableColumnResizing(); AbstractTextColumn<Network> nameColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getName(); } }; networksTable.addColumn(nameColumn, constants.name(), "40%"); AbstractTextColumn<Network> descriptionColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getDescription(); } }; networksTable.addColumn(descriptionColumn, constants.description(), "60%"); networksTable.setWidth("100%"); }
Source:
<code>private static String stringifyDate(Date date) { <START> return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'").format(date); <END> }</code><technical_language>seconds intentional omission here</technical_language>

Target:
private static String stringifyDate(Date date) { return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(date); }
Source:
<code>public static boolean containsAnnotation(DetailAST ast, List<String> annotations) { if (ast == null) { throw new IllegalArgumentException(THE_AST_IS_NULL); } boolean result = false; if (annotations != null && !annotations.isEmpty()) { <START> result = getAnnotation(ast, (annotationNode) -> { <END> DetailAST identNode = annotationNode.findFirstToken(TokenTypes.IDENT); if (identNode == null) { identNode = annotationNode.findFirstToken(TokenTypes.DOT) .findFirstToken(TokenTypes.IDENT); } return annotations.contains(identNode.getText()); }) != null; } return result; }</code><technical_language>is this lambda's logic getAnnotation's lambda? I difference return (equals contains)</technical_language>

Target:
public static boolean containsAnnotation(DetailAST ast, List<String> annotations) { if (ast == null) { throw new IllegalArgumentException(THE_AST_IS_NULL); } if (annotations == null) { throw new IllegalArgumentException("annotations cannot be null"); } boolean result = false; if (!annotations.isEmpty()) { final DetailAST firstMatchingAnnotation = findFirstAnnotation(ast, annotationNode -> { DetailAST identNode = annotationNode.findFirstToken(TokenTypes.IDENT); if (identNode == null) { identNode = annotationNode.findFirstToken(TokenTypes.DOT) .findFirstToken(TokenTypes.IDENT); } return annotations.contains(identNode.getText()); }); result = firstMatchingAnnotation != null; } return result; }
Source:
<code>public Version getVersion() throws IOException { @SuppressWarnings("resource") OpenShiftClient openShiftClient = new DefaultOpenShiftClient(); final OpenShiftClientExtension client = new OpenShiftClientExtension( openShiftClient.adapt(OkHttpClient.class), OpenShiftConfig.wrap(openShiftClient.getConfiguration())); String versionString = client.getVersion(); <START> if (versionString == null || versionString.isEmpty()) { <END> return null; } final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); OpenShiftVersion openShiftVersion = gson.fromJson(versionString, OpenShiftVersion.class); Version version = openShiftVersion.getVersion(); version.setApiVersion(client.getApiVersion()); return version; }</code><technical_language>method isNullOrEmpty</technical_language>

Target:
public Version getVersion() throws IOException { OpenShiftClient openShiftClient = new DefaultOpenShiftClient(); final OpenShiftClientExtension client = new OpenShiftClientExtension( openShiftClient.adapt(OkHttpClient.class), OpenShiftConfig.wrap(openShiftClient.getConfiguration())); String versionString = client.getVersion(); if (isNullOrEmpty(versionString)) { return null; } final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); OpenShiftVersion openShiftVersion = gson.fromJson(versionString, OpenShiftVersion.class); Version version = openShiftVersion.getVersion(); version.setApiVersion(client.getApiVersion()); return version; }
Source:
<code>public void editLabel(AgentPrincipals agent, PID pid, String label) { FedoraTransaction tx = txManager.startTransaction(); try (Timer.Context context = timer.time()) { aclService.assertHasAccess( "User does not have permissions to edit filenames", pid, agent.getPrincipals(), Permission.editDescription); RepositoryObject obj = repoObjLoader.getRepositoryObject(pid); if (!(obj instanceof FileObject)) { <START> throw new Exception("Failed to edit filename for " + obj.getPid()); <END> } String oldLabel = getOldLabel(obj); repoObjFactory.createExclusiveRelationship(obj, DcElements.title, label); obj.getPremisLog() .buildEvent(Premis.FilenameChange) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Object renamed from " + oldLabel + " to " + label) .writeAndClose(); } catch (Exception e) { tx.cancel(e); } finally { tx.close(); } operationsMessageSender.sendUpdateDescriptionOperation( agent.getUsername(), Arrays.asList(pid)); }</code><technical_language>throw a more specific exception. java.lang.IllegalArgumentException orServiceException options. ObjectTypeMismatchException right fit</technical_language>

Target:
public void editLabel(AgentPrincipals agent, PID pid, String label) { FedoraTransaction tx = txManager.startTransaction(); try (Timer.Context context = timer.time()) { aclService.assertHasAccess( "User does not have permissions to edit filenames", pid, agent.getPrincipals(), Permission.editDescription); RepositoryObject obj = repoObjLoader.getRepositoryObject(pid); if (!(obj instanceof FileObject)) { throw new IllegalArgumentException("Failed to edit filename for " + obj.getPid()); } BinaryObject binaryObj = ((FileObject) obj).getOriginalFile(); String oldLabel = getOldLabel(binaryObj.getFilename()); repoObjFactory.createExclusiveRelationship(binaryObj, Ebucore.filename, label); obj.getPremisLog() .buildEvent(Premis.FilenameChange) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Object renamed from " + oldLabel + " to " + label) .writeAndClose(); } catch (Exception e) { tx.cancel(e); } finally { tx.close(); } operationsMessageSender.sendUpdateDescriptionOperation( agent.getUsername(), Arrays.asList(pid)); }
Source:
<code>public VCFIterator open(final InputStream in) throws IOException { if (in == null) { throw new IllegalArgumentException("input stream is null"); } final BufferedInputStream bufferedinput = new BufferedInputStream(in, 100); <START> bufferedinput.mark(100); <END> final BCFVersion bcfVersion = BCFVersion.readBCFVersion(bufferedinput); bufferedinput.reset(); if (bcfVersion != null) { return new BCFInputStreamIterator(bufferedinput); } else { return new VCFReaderIterator(IOUtil.gunZipIfNeeded(bufferedinput)); } }</code><technical_language>a static constant i.e. private static BCF_VERFSION_SIZE = 100 instead of a magic number? a smaller value</technical_language>

Target:
public VCFIterator open(final InputStream in) throws IOException { if (in == null) { throw new IllegalArgumentException("input stream is null"); } BufferedInputStream bufferedinput = new BufferedInputStream(in, Math.max( BCF2Codec.SIZEOF_BCF_HEADER, IOUtil.GZIP_HEADER_READ_LENGTH )); if(IOUtil.isGZIPInputStream(bufferedinput)) { bufferedinput = new BufferedInputStream( new GZIPInputStream(bufferedinput), BCF2Codec.SIZEOF_BCF_HEADER ); } final BCFVersion bcfVersion = BCF2Codec.tryReadBCFVersion(bufferedinput); if (bcfVersion != null) { return new BCFInputStreamIterator(bufferedinput); } else { return new VCFReaderIterator(bufferedinput); } }
Source:
<code>public void prepareStepMachine() { startupLogger.info("Prepare StepMachine"); StepIterator.Builder builder = new StepIterator.Builder(); try(InputStream s = this.getClass().getResourceAsStream("/steps.json")){ StepEngineConfiguration stepEngineConfig = JsonbBuilder.create().fromJson(s, StepEngineConfiguration.class); stepEngineConfig.steps.forEach(className -> builder.addStep(className)); } catch (IOException ex) { <START> LogManager.getLogger(WordleSkin.class.getName()).error("IO Problem loading steps description file", ex); <END> } StepIterator steps = builder.build(); StepEngine s = new StepEngine(steps); s.getContext().put("WordleSkin", this); tickTockExecutor.execute(new Runnable() { @Override public void run() { s.go(); } }); startupLogger.info("Prepare StepMachine done"); }</code><technical_language>of log4j-api java.util.logging preferred</technical_language>

Target:
public void prepareStepMachine() { startupLogger.info("Prepare StepMachine"); StepIterator steps = StepIterator.ofDefaultConfiguration(); StepEngine s = new StepEngine(steps); s.getContext().put("WordleSkin", this); tickTockExecutor.execute(new Runnable() { @Override public void run() { s.go(); } }); startupLogger.info("Prepare StepMachine done"); }
Source:
<code>private Object getTaskFactory(StreamApplication streamApp) { if (streamApp != null) { streamApp.init(streamGraph, config); return TaskFactoryUtil.createTaskFactory(config, streamGraph); } <START> return TaskFactoryUtil.createTaskFactory(config, null); <END> }</code><technical_language>passing null this method do? If code checks for null param, methods</technical_language>

Target:
private Object getTaskFactory(StreamApplication streamApp) { if (streamApp != null) { streamApp.init(graphSpec, config); return TaskFactoryUtil.createTaskFactory(graphSpec.getOperatorSpecGraph(), graphSpec.getContextManager()); } return TaskFactoryUtil.createTaskFactory(config); }
Source:
<code>protected final void publishWanRemove(Data dataKey) { <START> wanEventPublisher.publishWanRemove(name, dataKey); <END> }</code><technical_language>I similarly update counterpart, check cache.isWanReplicationEnabled call remove if check returns true. is implemented in MapOperation</technical_language>

Target:
protected final void publishWanRemove(Data dataKey) { if (!recordStore.isWanReplicationEnabled()) { return; } wanEventPublisher.publishWanRemove(name, toHeapData(dataKey)); }