auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Builder(final InfluxDB influxDB) { <START> this.influxDB = (InfluxDB) influxDB; <END> }</code><technical_language>I this cast removed</technical_language>

Target:
public Builder(final InfluxDB influxDB) { this.influxDB = influxDB; }
Source:
<code>private boolean onlyRepositoryNodesSelected(ISelection selection) { if (selection instanceof IStructuredSelection) { <START> List<?> list = ((IStructuredSelection) selection).toList(); for (Object element : list) { if (!(element instanceof RepositoryNode)) { return false; } } return true; <END> } return false; }</code><technical_language>return ((List<?>) ((IStructuredSelection) selection).toList()) .stream().allMatch(e -> e instanceof RepositoryNode);</technical_language>

Target:
private boolean onlyRepositoryNodesSelected(ISelection selection) { if (selection instanceof IStructuredSelection) { return ((List<?>) ((IStructuredSelection) selection).toList()) .stream().allMatch(e -> (e instanceof RepositoryNode)); } return false; }
Source:
<code>public void triggerMovementEvent(long timestamp, float positionX, float positionY) { when(motionEvent.getAction()).thenReturn(MotionEvent.ACTION_MOVE); when(motionEvent.getRawX()).thenReturn(positionX); when(motionEvent.getRawY()).thenReturn(positionY); <START> when(timeProvider.elapsedRealtime()).thenReturn(timestamp); <END> when(imageView.getX()).thenReturn(positionX); when(imageView.getY()).thenReturn(positionY); listener.onTouch(imageView, motionEvent, coordinateInterface); }</code><technical_language>suggestion when(motionEvent.getDownTime()).thenReturn(timestamp);</technical_language>

Target:
public void triggerMovementEvent(long timestamp, float positionX, float positionY) { when(motionEvent.getAction()).thenReturn(MotionEvent.ACTION_MOVE); when(motionEvent.getRawX()).thenReturn(positionX); when(motionEvent.getRawY()).thenReturn(positionY); when(motionEvent.getEventTime()).thenReturn(timestamp); listener.onTouch(imageView, motionEvent, coordinateInterface); when(imageView.getX()).thenReturn(positionX); when(imageView.getY()).thenReturn(positionY); }
Source:
<code>private static void CleanUp() { synchronized (entryIdToKalturaLiveEntryMap) { long currentTime = System.currentTimeMillis(); if (currentTime - lastMapCleanUp > Constants.KALTURA_TIME_BETWEEN_PERSISTENCE_CLEANUP) { try { Set<String> playingEntriesList = Utils.getEntriesFromApplication(_appInstance); Set<String> hashedEntriesList = entryIdToKalturaLiveEntryMap.keySet(); <START> long currTime = System.currentTimeMillis(); <END> for (String entry : hashedEntriesList) { long startTime = (long) getPropertyByEntry(entry, Constants.KALTURA_ENTRY_START_TIME); if ((!playingEntriesList.contains(entry)) && (currTime - startTime > Constants.KALTURA_PERSISTENCE_DATA_MIN_ENTRY_TIME)) { logger.info("Entry " + entry + " no longer exists. Removing it from Persistence Hash Map"); entryIdToKalturaLiveEntryMap.remove(entry); } } lastMapCleanUp = currentTime; } catch (Exception e) { logger.error("Error occurred while cleaning Persistence Data map: " + e); } } else { logger.debug("Persistence hash map was cleaned less than 1 min ago. Ignoring call!"); } } }</code><technical_language>redundent currTime ... currentTime remove other. tx</technical_language>

Target:
private static void CleanUp() { try { synchronized (entryIdToKalturaLiveEntryMap) { logger.debug("KalturaEntryDataPersistence CleanUp started"); Set<String> playingEntriesList = Utils.getEntriesFromApplication(_appInstance); Set<String> hashedEntriesList = entryIdToKalturaLiveEntryMap.keySet(); long currentTime = System.currentTimeMillis(); for (String entry : hashedEntriesList) { long validationTime = (long)getPropertyByEntry(entry, Constants.KALTURA_ENTRY_VALIDATED_TIME); if (!playingEntriesList.contains(entry)) { logger.info("(" + entry + ") Entry is no longer playing!"); int minTimeInMap = Constants.KALTURA_PERSISTENCE_DATA_MIN_ENTRY_TIME; if (currentTime - validationTime > minTimeInMap) { logger.info("(" + entry + ") Entry validation time is greater than " + minTimeInMap / 1000 + " seconds; Removing it from Map!"); entryIdToKalturaLiveEntryMap.remove(entry); } } } } } catch (Exception e) { logger.error("Error occurred while cleaning Persistence Data map: " + e); } }
Source:
<code>public void testIsComplexNonExpression() { <START> assertTrue(!isComplexTemplate("something")); <END> }</code><technical_language>assertFalse is</technical_language>

Target:
public void testIsComplexNonExpression() { assertFalse(isComplexTemplate("something")); }
Source:
<code>public Map<String, Object> apply(ServerOAuth2AuthorizeRequest authorizeRequest) { Map<String, Object> contextAttributes = new HashMap<>(); String scope = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.SCOPE); if (StringUtils.hasText(scope)) { contextAttributes.put(OAuth2AuthorizationContext.REQUEST_SCOPE_ATTRIBUTE_NAME, StringUtils.delimitedListToStringArray(scope, " ")); } <START> String username = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.USERNAME); <END> String password = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.PASSWORD); if (StringUtils.hasText(username) && StringUtils.hasText(password)) { contextAttributes.put(OAuth2AuthorizationContext.USERNAME_ATTRIBUTE_NAME, username); contextAttributes.put(OAuth2AuthorizationContext.PASSWORD_ATTRIBUTE_NAME, password); } return contextAttributes; }</code><technical_language>I this get username if username is a query parameter, if a form parameter</technical_language>

Target:
public Mono<Map<String, Object>> apply(ServerOAuth2AuthorizeRequest authorizeRequest) { Map<String, Object> contextAttributes = new HashMap<>(); String scope = authorizeRequest.getServerWebExchange().getRequest().getQueryParams().getFirst(OAuth2ParameterNames.SCOPE); if (StringUtils.hasText(scope)) { contextAttributes.put(OAuth2AuthorizationContext.REQUEST_SCOPE_ATTRIBUTE_NAME, StringUtils.delimitedListToStringArray(scope, " ")); } return Mono.just(contextAttributes); }
Source:
<code>public void truncate(long toDeleteInclusive) { lock.writeLock().lock(); try { long greatestLogEntry = getGreatestLogEntry(); if (greatestLogEntry >= 0) { toDeleteInclusive = Math.min(greatestLogEntry - 1, toDeleteInclusive); } File dir = new File(path); List<File> files = getLogEntries(dir); files.sort(nameAsLongComparator()); for (File file : files) { long fileSeq = getSeqFromFilename(file); if (fileSeq <= toDeleteInclusive) { if (!file.delete()) { <START> log.warn("failed to delete log file {}", file.getAbsolutePath()); <END> } } else { break; } } } finally { lock.writeLock().unlock(); } }</code><technical_language>good spot though</technical_language>

Target:
public void truncate(long toDeleteInclusive) { lock.writeLock().lock(); try { long greatestLogEntry = getGreatestLogEntry(); if (greatestLogEntry >= 0) { toDeleteInclusive = Math.min(greatestLogEntry - 1, toDeleteInclusive); } File dir = new File(path); List<File> files = getLogEntries(dir); files.sort(nameAsLongComparator()); for (File file : files) { long fileSeq = getSeqFromFilename(file); if (fileSeq <= toDeleteInclusive) { deleteLogFile(file); } else { break; } } } finally { lock.writeLock().unlock(); } }
Source:
<code>protected void deleteDataFiles() throws IOException { String pathToJsonFile = getPathToTestDataFile(getJsonDataPath()); String pathToCsvFile = getPathToTestDataFile(getCsvConfigPath()); <START> String pathToStatisticsJsonFile = getPathToStatisticsResultsFile(); <END> Files.delete(Paths.get(pathToJsonFile)); Files.delete(Paths.get(pathToCsvFile)); Files.delete(Paths.get(pathToStatisticsJsonFile)); }</code><technical_language>delete file? of now, .jtl results file deleted</technical_language>

Target:
protected void deleteDataFiles() throws IOException { String pathToJsonFile = getPathToTestDataFile(getJsonDataPath()); String pathToCsvFile = getPathToTestDataFile(getCsvConfigPath()); Files.delete(Paths.get(pathToJsonFile)); Files.delete(Paths.get(pathToCsvFile)); }
Source:
<code>public void testHaplotypeMapLiftover() throws Exception { Map<String, Interval> hg19 = new HashMap<>(); hg19.put("rs1210110", new Interval("1", 14096821, 14096821)); hg19.put("rs7555566", new Interval("1", 14804874, 14804874)); hg19.put("rs1364054", new Interval("2", 8178735, 8178735)); hg19.put("rs6734275", new Interval("2", 67241174, 67241174)); hg19.put("rs7584993", new Interval("2", 223845942, 223845942)); final File tmp = File.createTempFile("hg19Map", ".txt"); tmp.deleteOnExit(); new LiftOverHaplotypeMap().instanceMain(new String[] {"INPUT=" + HG18_HAPLOTYPE_MAP, "OUTPUT=" + tmp.getAbsolutePath(), "SEQUENCE_DICTIONARY=" + HG_19_SD, "CHAIN=" + CHAIN }); final HaplotypeMap results = new HaplotypeMap(tmp); final SamReader samReader = SamReaderFactory.makeDefault().open(new File(HG_19_SD)); SequenceUtil.assertSequenceDictionariesEqual( results.getHeader().getSequenceDictionary(), samReader.getFileHeader().getSequenceDictionary()); for (Snp snp : results.getAllSnps()) { Interval i = hg19.remove(snp.getName()); Assert.assertNotNull(i, "No lifted-over interval found for Snp: " + snp.getName()); Assert.assertEquals(snp.getChrom(), i.getContig(), "Sequence doesn't match for " + snp.getName()); Assert.assertEquals(snp.getPos(), i.getStart(), "Start position doesn't match for " + snp.getName()); } Assert.assertEquals(hg19.size(), 0, "Extra intervals remain after liftover: " + hg19); <START> CloserUtil.close(samReader); <END> }</code><technical_language>try-with-resources avoid explicit close here</technical_language>

Target:
public void testHaplotypeMapLiftover() throws Exception { Map<String, Interval> hg19 = new HashMap<>(); hg19.put("rs1210110", new Interval("1", 14096821, 14096821)); hg19.put("rs7555566", new Interval("1", 14804874, 14804874)); hg19.put("rs1364054", new Interval("2", 8178735, 8178735)); hg19.put("rs6734275", new Interval("2", 67241174, 67241174)); hg19.put("rs7584993", new Interval("2", 223845942, 223845942)); final File tmp = File.createTempFile("hg19Map", ".txt"); tmp.deleteOnExit(); new LiftOverHaplotypeMap().instanceMain(new String[]{"INPUT=" + HG18_HAPLOTYPE_MAP, "OUTPUT=" + tmp.getAbsolutePath(), "SEQUENCE_DICTIONARY=" + HG_19_SD, "CHAIN=" + CHAIN}); final HaplotypeMap results = new HaplotypeMap(tmp); try(final SamReader samReader = SamReaderFactory.makeDefault().open(new File(HG_19_SD))) { SequenceUtil.assertSequenceDictionariesEqual( results.getHeader().getSequenceDictionary(), samReader.getFileHeader().getSequenceDictionary()); for (Snp snp : results.getAllSnps()) { Interval i = hg19.remove(snp.getName()); Assert.assertNotNull(i, "No lifted-over interval found for Snp: " + snp.getName()); Assert.assertEquals(snp.getChrom(), i.getContig(), "Sequence doesn't match for " + snp.getName()); Assert.assertEquals(snp.getPos(), i.getStart(), "Start position doesn't match for " + snp.getName()); } Assert.assertEquals(hg19.size(), 0, "Extra intervals remain after liftover: " + hg19); } }
Source:
<code>public void synchToRange(final TmfRangeSynchSignal signal) { if (signal.getSource() == this || fTrace == null) { return; <START> } <END> if (signal.getCurrentRange().getIntersection(fTrace.getTimeRange()) == null) { return; } final long startTime = signal.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); final long endTime = signal.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime, endTime); startZoomThread(startTime, endTime); } }); }</code><technical_language>this a problem if object event list match range of current fTrace</technical_language>

Target:
public void synchToRange(final TmfRangeSynchSignal signal) { if (signal.getSource() == this || fTrace == null) { return; } if (signal.getCurrentRange().getIntersection(fTrace.getTimeRange()) == null) { return; } final long startTime = signal.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); final long endTime = signal.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphWrapper.isDisposed()) { return; } fTimeGraphWrapper.getTimeGraphViewer().setStartFinishTime(startTime, endTime); startZoomThread(startTime, endTime); } }); }
Source:
<code>public void testWithArrayCreateFullIdentWithArrayDeclare() { final DetailAST ast = new DetailAST(); ast.setType(TokenTypes.ARRAY_DECLARATOR); ast.setColumnNo(18); ast.setLineNo(15); <START> ast.setText("["); <END> final DetailAST ast1 = new DetailAST(); ast1.setType(TokenTypes.LITERAL_INT); ast1.setColumnNo(14); ast1.setLineNo(15); ast1.setText("int"); final DetailAST ast2 = new DetailAST(); ast2.setType(TokenTypes.RBRACK); ast2.setText("]"); final DetailAST ast3 = new DetailAST(); ast3.setType(TokenTypes.ARRAY_DECLARATOR); ast3.setText("["); final DetailAST ast4 = new DetailAST(); ast4.setType(TokenTypes.RBRACK); ast4.setText("]"); ast.addChild(ast1); ast3.addChild(ast); ast1.setNextSibling(ast2); ast.setNextSibling(ast4); final FullIdent indent = FullIdent.createFullIdent(ast3); Assert.assertEquals("Invalid full indent", "int[][][15x14]", indent.toString()); }</code><technical_language>Please extend need this test. try avoid tests possible, please case in compilable sources if need. test coverage real Java files , a fake trees</technical_language>

Target:
public void testWithArrayCreateFullIdentWithArrayDeclare() throws Exception { final FileText testFileText = new FileText( new File(getPath("InputFullIdentTestArrayType.java")).getAbsoluteFile(), System.getProperty("file.encoding", StandardCharsets.UTF_8.name())); final DetailAST packageDefinitionNode = JavaParser.parse(new FileContents(testFileText)); final DetailAST arrayDeclarator = packageDefinitionNode.getNextSibling() .findFirstToken(TokenTypes.OBJBLOCK) .findFirstToken(TokenTypes.VARIABLE_DEF) .findFirstToken(TokenTypes.TYPE) .getFirstChild(); final FullIdent ident = FullIdent.createFullIdent(arrayDeclarator); Assert.assertEquals("Invalid full indent", "int[][][5x12]", ident.toString()); }
Source:
<code>private void checkForTVFileConversion(String externalID) { <START> if (SageConstants.PVR <END> && Sage.getBoolean("enable_converting_imported_videos_to_tv_recordings", true) && (externalID.startsWith("EP") || externalID.startsWith("SH") || externalID.startsWith("SP") || externalID.startsWith("MV") || externalID.startsWith("DT") || externalID.startsWith("IE") || externalID.startsWith("IM"))) { if (generalType != MEDIAFILE_LOCAL_PLAYBACK) generalType = MEDIAFILE_TV; addMediaMask(MEDIA_MASK_TV); } }</code><technical_language>(!Sage.EMBEDDED || SageConstants.PVR) evaluates true in code. remove SageConstants.PVR</technical_language>

Target:
private void checkForTVFileConversion(String externalID) { if (Sage.getBoolean("enable_converting_imported_videos_to_tv_recordings", true) && (externalID.startsWith("EP") || externalID.startsWith("SH") || externalID.startsWith("SP") || externalID.startsWith("MV") || externalID.startsWith("DT") || externalID.startsWith("IE") || externalID.startsWith("IM"))) { if (generalType != MEDIAFILE_LOCAL_PLAYBACK) generalType = MEDIAFILE_TV; addMediaMask(MEDIA_MASK_TV); } }
Source:
<code>public static PypiWheelArtifactCoordinates parse(String path) { String[] splitArray = path.split("-"); if (splitArray.length != 5 && splitArray.length != 6) { throw new IllegalArgumentException("Invalid Wheel filename specified"); } String distribution = splitArray[0]; String version = splitArray[1]; <START> String build = ""; <END> String lang_impl_version = ""; String abi = ""; String platform = ""; if (splitArray.length == 5) { lang_impl_version = splitArray[2]; abi = splitArray[3]; platform = splitArray[4].substring(0, splitArray[4].indexOf(".whl")); } else if (splitArray.length == 6) { build = splitArray[2]; lang_impl_version = splitArray[3]; abi = splitArray[4]; platform = splitArray[5].substring(0, splitArray[5].indexOf(".whl")); } return new PypiWheelArtifactCoordinates(distribution, version, build, lang_impl_version, abi, platform); }</code><technical_language>Unnecessary variable initialization (here below)</technical_language>

Target:
public static PypiWheelArtifactCoordinates parse(String path) { String[] splitArray = path.split("-"); if (splitArray.length != 5 && splitArray.length != 6) { throw new IllegalArgumentException("Invalid Wheel filename specified"); } String distribution = splitArray[0]; String version = splitArray[1]; String build = ""; String languageImplementationVersion; String abi; String platform; if (splitArray.length == 5) { languageImplementationVersion = splitArray[2]; abi = splitArray[3]; platform = splitArray[4].substring(0, splitArray[4].indexOf(".whl")); } else { build = splitArray[2]; languageImplementationVersion = splitArray[3]; abi = splitArray[4]; platform = splitArray[5].substring(0, splitArray[5].indexOf(".whl")); } return new PypiWheelArtifactCoordinates(distribution, version, build, languageImplementationVersion, abi, platform); }
Source:
<code>private void reply(final HttpServletResponse rsp, final byte[] result) throws IOException { nocache(rsp); rsp.setContentType(RSP_TYPE); rsp.setContentLength(result.length); final OutputStream os = rsp.getOutputStream(); try { <START> os.write(result); <END> } finally { os.close(); } }</code><technical_language>Worth a flush well</technical_language>

Target:
private void reply(final HttpServletResponse rsp, final byte[] result) throws IOException { nocache(rsp); rsp.setContentType(RSP_TYPE); rsp.setContentLength(result.length); final OutputStream os = rsp.getOutputStream(); try { os.write(result); os.flush(); } finally { os.close(); } }
Source:
<code>public void teardown() throws Exception { if (lifeCycleManager != null) { <START> lifeCycleManager.stop(); <END> } }</code><technical_language>per-method needs assign null lifeCycleManager</technical_language>

Target:
public void teardown() throws Exception { if (lifeCycleManager != null) { lifeCycleManager.stop(); lifeCycleManager = null; } }
Source:
<code>private URI createContentRoot(URI contentUri) { String contentRootString = URIUtil.join( contentUri, RepositoryPathConstants.CONTENT_ROOT_ID); URI contentRootUri = URI.create(contentRootString); if (objectExists(contentRootUri)) { <START> return contentUri; <END> } Model model = ModelFactory.createDefaultModel(); Resource resc = model.createResource(contentRootString); resc.addProperty(DC.title, "Content Collections Root"); objFactory.createContentRootObject(contentRootUri, model); return contentRootUri; }</code><technical_language>this return contentRootUri</technical_language>

Target:
private URI createContentRoot(URI contentUri) { String contentRootString = URIUtil.join( contentUri, RepositoryPathConstants.CONTENT_ROOT_ID); URI contentRootUri = URI.create(contentRootString); if (objectExists(contentRootUri)) { return contentRootUri; } Model model = ModelFactory.createDefaultModel(); Resource resc = model.createResource(contentRootString); resc.addProperty(DC.title, "Content Collections Root"); objFactory.createContentRootObject(contentRootUri, model); return contentRootUri; }
Source:
<code>public static void setUpTsc() throws Exception { if (!TSC.toFile().exists()) { System.err.println("Installing typescript..."); <START> runChecked("npm", "install", "typescript@1.8.0"); <END> } }</code><technical_language>this a separate change</technical_language>

Target:
public static void setUpTsc() throws Exception { if (!TSC.toFile().exists()) { System.err.println("Installing typescript..."); runChecked("npm", "install", "typescript@1.8.7"); } }
Source:
<code>private Sets.SetView<Symbol> extractInliningTargets(ProjectNode parent, ProjectNode child) { Set<Symbol> childOutputSet = ImmutableSet.copyOf(child.getOutputSymbols()); Map<Symbol, Long> dependencies = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> SymbolsExtractor.extractAll(expression).stream()) .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Set<Symbol> constants = dependencies.keySet().stream() .filter(input -> child.getAssignments().get(input) instanceof Literal) .collect(toSet()); Set<Symbol> tryArguments = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> extractTryArguments(expression).stream()) .collect(toSet()); Set<Symbol> singletons = dependencies.entrySet().stream() .filter(entry -> entry.getValue() == 1) .filter(entry -> !tryArguments.contains(entry.getKey())) .filter(entry -> !child.getAssignments().isIdentity(entry.getKey())) <START> .filter(entry -> !(child.getAssignments().get(entry.getKey()) instanceof DereferenceExpression)) END> .map(Map.Entry::getKey) .collect(toSet()); return Sets.union(singletons, constants); }</code><technical_language>is so</technical_language>

Target:
private Sets.SetView<Symbol> extractInliningTargets(ProjectNode parent, ProjectNode child) { Set<Symbol> childOutputSet = ImmutableSet.copyOf(child.getOutputSymbols()); Map<Symbol, Long> dependencies = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> SymbolsExtractor.extractAll(expression).stream()) .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Set<Symbol> constants = dependencies.keySet().stream() .filter(input -> child.getAssignments().get(input) instanceof Literal) .collect(toSet()); Set<Symbol> tryArguments = parent.getAssignments() .getExpressions().stream() .flatMap(expression -> extractTryArguments(expression).stream()) .collect(toSet()); Set<Symbol> singletons = dependencies.entrySet().stream() .filter(entry -> entry.getValue() == 1) .filter(entry -> !tryArguments.contains(entry.getKey())) .filter(entry -> !child.getAssignments().isIdentity(entry.getKey())) .map(Map.Entry::getKey) .collect(toSet()); return Sets.union(singletons, constants); }
Source:
<code>public void run() { try { if (!pickledGraphite.isConnected()) { log.info("trying to connect to graphite server"); pickledGraphite.connect(); } while (eventsQueue.size() > 0 && !exec.isShutdown()) { try { <START> final GraphiteEvent graphiteEvent = eventsQueue.poll(graphiteEmitterConfig.getEmitWaitTime(), TimeUnit.MILLISECONDS); <END> if (graphiteEvent != null) { log.debug( "sent [%s] with value [%s] and time [%s]", graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); pickledGraphite.send( graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); } } catch (InterruptedException | IOException e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } pickledGraphite.flush(); } catch (Exception e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } }</code><technical_language>this a config offer timeout. I guess reason this is is periodically check for emitter stopped. I people wanting offer a 0 timeout poll some nonzero timeout</technical_language>

Target:
public void run() { try { if (!pickledGraphite.isConnected()) { log.info("trying to connect to graphite server"); pickledGraphite.connect(); } while (eventsQueue.size() > 0 && !exec.isShutdown()) { try { final GraphiteEvent graphiteEvent = eventsQueue.poll( graphiteEmitterConfig.getWaitForEventTime(), TimeUnit.MILLISECONDS ); if (graphiteEvent != null) { log.debug( "sent [%s] with value [%s] and time [%s]", graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); pickledGraphite.send( graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); } } catch (InterruptedException | IOException e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } pickledGraphite.flush(); } catch (Exception e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } }
Source:
<code>private ModelAndView generateJsonLd(FullBean bean, RequestData data, HttpServletResponse response) { OutputStream outputStream = new ByteArrayOutputStream(); String rdf = EdmUtils.toEDM((FullBeanImpl) bean); try (InputStream rdfInput = IOUtils.toInputStream(rdf)) { Model modelResult = ModelFactory.createDefaultModel().read(rdfInput, "", "RDF/XML"); <START> if (StringUtils.equalsIgnoreCase(data.profile, "compacted")) { DatasetGraph graph = DatasetFactory.wrap(modelResult).asDatasetGraph(); PrefixMap pm = RiotLib.prefixMap(graph); JsonLDWriteContext ctx = new JsonLDWriteContext(); ctx.setJsonLDContext(ObjectController.jsonldContext); WriterDatasetRIOT writer = RDFDataMgr.createDatasetWriter(RDFFormat.JSONLD_FLATTEN_PRETTY); writer.write(outputStream, graph, pm, null, ctx); } else if (StringUtils.equalsIgnoreCase(data.profile, "flattened")) { RDFDataMgr.write(outputStream, modelResult, RDFFormat.JSONLD_FLAT); } else if (StringUtils.equalsIgnoreCase(data.profile, "normalized")) { END> RDFDataMgr.write(outputStream, modelResult, RDFFormat.JSONLD_PRETTY); } } catch (IOException e) { LOG.error("Error parsing JSON-LD data", e); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return JsonUtils.toJson(new ApiError(data.wskey, e.getClass().getSimpleName() + ": " + e.getMessage()), data.callback); } return JsonUtils.toJsonLd(outputStream.toString(), data.callback); }</code><technical_language>removed completely for json-ld. format **JSONLD_FLATTEN_PRETTY** results in default format output get currently for json-ld</technical_language>

Target:
private ModelAndView generateJsonLd(FullBean bean, RequestData data, HttpServletResponse response) { String rdf = EdmUtils.toEDM((FullBeanImpl) bean); try (InputStream rdfInput = IOUtils.toInputStream(rdf); OutputStream outputStream = new ByteArrayOutputStream()) { Model modelResult = ModelFactory.createDefaultModel().read(rdfInput, "", "RDF/XML"); DatasetGraph graph = DatasetFactory.wrap(modelResult).asDatasetGraph(); PrefixMap pm = RiotLib.prefixMap(graph); JsonLDWriteContext ctx = new JsonLDWriteContext(); ctx.setJsonLDContext(ObjectController.jsonldContext); WriterDatasetRIOT writer = RDFDataMgr.createDatasetWriter(RDFFormat.JSONLD_FLAT); writer.write(outputStream, graph, pm, null, ctx); return JsonUtils.toJsonLd(outputStream.toString(), data.callback); } catch (IOException e) { LOG.error("Error parsing JSON-LD data", e); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return JsonUtils.toJson(new ApiError(data.apikey, e.getClass().getSimpleName() + ": " + e.getMessage()), data.callback); } }
Source:
<code>public PatientData<String> load(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); Map<String, String> result = new LinkedHashMap<String, String>(); <START> SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd"); <END> result.put(DOCUMENT_NAME, doc.getDocumentReference().getName()); result.put(REFERRER, (doc.getCreatorReference() != null) ? doc.getCreatorReference().getName() : UNKNOWN_USER); result.put(CREATION_DATE, format.format(doc.getCreationDate())); result.put(AUTHOR, (doc.getAuthorReference() != null) ? doc.getAuthorReference().getName() : UNKNOWN_USER); result.put(DATE, format.format(doc.getDate())); return new DictionaryPatientData<>(getName(), result); } catch (Exception e) { this.logger.error("Could not find requested document or some unforeseen" + " error has occurred during controller loading ", e.getMessage()); } return null; }</code><technical_language>this custom format, standard ISO date-time one</technical_language>

Target:
public PatientData<String> load(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); Map<String, String> result = new LinkedHashMap<String, String>(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); result.put(DOCUMENT_NAME, doc.getDocumentReference().getName()); result.put(REFERRER, (doc.getCreatorReference() != null) ? doc.getCreatorReference().getName() : UNKNOWN_USER); result.put(CREATION_DATE, format.format(doc.getCreationDate())); result.put(AUTHOR, (doc.getAuthorReference() != null) ? doc.getAuthorReference().getName() : UNKNOWN_USER); result.put(DATE, format.format(doc.getDate())); return new DictionaryPatientData<>(getName(), result); } catch (Exception e) { this.logger.error("Could not find requested document or some unforeseen" + " error has occurred during controller loading ", e.getMessage()); } return null; }
Source:
<code>public boolean keyPressed(KeyEvent event) { AdvancedScrollingGraphicalViewer viewer = (AdvancedScrollingGraphicalViewer) getViewer(); <START> if (event.keyCode == SWT.ARROW_DOWN) { <END> viewer.scrollByOffset(0, 400); return true; } if (event.keyCode == SWT.ARROW_UP) { viewer.scrollByOffset(0, -400); return true; } if (event.keyCode == SWT.ARROW_RIGHT) { viewer.scrollByOffset(400, 0); return true; } if (event.keyCode == SWT.ARROW_LEFT) { viewer.scrollByOffset(-400, 0); return true; } if (event.keyCode == SWT.PAGE_DOWN) { org.eclipse.swt.graphics.Point canvasSize = viewer.getFigureCanvasSize(); if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { viewer.scrollByOffset(0, canvasSize.y); return true; } else { viewer.scrollByOffset(canvasSize.x, 0); return true; } } if (event.keyCode == SWT.PAGE_UP) { org.eclipse.swt.graphics.Point canvasSize = viewer.getFigureCanvasSize(); if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { viewer.scrollByOffset(0, -canvasSize.y); return true; } else { viewer.scrollByOffset(-canvasSize.x, 0); return true; } } return super.keyPressed(event); }</code><technical_language>a switch case nicer read here? default part reeturn super.keyPressed() call return true moved end of method</technical_language>

Target:
public boolean keyPressed(KeyEvent event) { switch (event.keyCode) { case SWT.ARROW_DOWN: getViewer().scrollByOffset(0, 400); return true; case SWT.ARROW_UP: getViewer().scrollByOffset(0, -400); return true; case SWT.ARROW_RIGHT: getViewer().scrollByOffset(400, 0); return true; case SWT.ARROW_LEFT: getViewer().scrollByOffset(-400, 0); return true; case SWT.PAGE_DOWN: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(getViewer().getFigureCanvasSize().x, 0); } return true; case SWT.PAGE_UP: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, -getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(-getViewer().getFigureCanvasSize().x, 0); } return true; default: return super.keyPressed(event); } }
Source:
<code>public void publishSegments(final String tableName, final List<DataSegment> segments, final ObjectMapper mapper) { dbi.withHandle( new HandleCallback<Void>() { @Override public Void withHandle(Handle handle) throws Exception { final PreparedBatch batch = handle.prepareBatch( String.format( "INSERT INTO %s (id, dataSource, created_date, start, \"end\", partitioned, version, used, payload) " + "VALUES (:id, :dataSource, :created_date, :start, :end, :partitioned, :version, :used, :payload)", tableName ) ); for (final DataSegment segment : segments) { batch.add( new ImmutableMap.Builder<String, Object>() .put("id", segment.getIdentifier()) .put("dataSource", segment.getDataSource()) .put("created_date", new DateTime().toString()) .put("start", segment.getInterval().getStart().toString()) .put("end", segment.getInterval().getEnd().toString()) .put("partitioned", (segment.getShardSpec() instanceof NoneShardSpec) ? false : true) .put("version", segment.getVersion()) .put("used", true) <START> .put("payload", mapper.writeValueAsString(segment).getBytes()) <END> .build() ); log.info("Published %s", segment.getIdentifier()); } batch.execute(); return null; } } ); }</code><technical_language>do character encoding. writeValueAsBytes instead</technical_language>

Target:
public void publishSegments(final String tableName, final List<DataSegment> segments, final ObjectMapper mapper) { dbi.withHandle( new HandleCallback<Void>() { @Override public Void withHandle(Handle handle) throws Exception { final PreparedBatch batch = handle.prepareBatch( String.format( "INSERT INTO %s (id, dataSource, created_date, start, \"end\", partitioned, version, used, payload) " + "VALUES (:id, :dataSource, :created_date, :start, :end, :partitioned, :version, :used, :payload)", tableName ) ); for (final DataSegment segment : segments) { batch.add( new ImmutableMap.Builder<String, Object>() .put("id", segment.getIdentifier()) .put("dataSource", segment.getDataSource()) .put("created_date", new DateTime().toString()) .put("start", segment.getInterval().getStart().toString()) .put("end", segment.getInterval().getEnd().toString()) .put("partitioned", (segment.getShardSpec() instanceof NoneShardSpec) ? false : true) .put("version", segment.getVersion()) .put("used", true) .put("payload", mapper.writeValueAsBytes(segment)) .build() ); log.info("Published %s", segment.getIdentifier()); } batch.execute(); return null; } } ); }
Source:
<code>public Template update(Template incoming) { validateEnums(Template.class, incoming); if (incoming.isSetPlacementPolicy() && incoming.getPlacementPolicy().isSetHost()) { Host host = incoming.getPlacementPolicy().getHost(); if (host.isSetName() && !host.isSetId()) { host.setId(getHostId(host).toString()); } <START> } <END> return performUpdate(incoming, new QueryIdResolver<Guid>(VdcQueryType.GetVmTemplate, GetVmTemplateParameters.class), VdcActionType.UpdateVmTemplate, new UpdateParametersProvider()); }</code><technical_language>addressing a isFiltered() flow (as done in vm.update())</technical_language>

Target:
public Template update(Template incoming) { validateEnums(Template.class, incoming); if (!isFiltered()) { if (incoming.isSetPlacementPolicy() && incoming.getPlacementPolicy().isSetHost() && incoming.getPlacementPolicy().getHost().isSetName() && !incoming.getPlacementPolicy().getHost().isSetId()) { incoming.getPlacementPolicy().getHost().setId(getHostId(incoming.getPlacementPolicy().getHost()).toString()); } } else { incoming.setPlacementPolicy(null); } return performUpdate(incoming, new QueryIdResolver<Guid>(VdcQueryType.GetVmTemplate, GetVmTemplateParameters.class), VdcActionType.UpdateVmTemplate, new UpdateParametersProvider()); }
Source:
<code>public boolean hasNext() { <START> while (next == null && iterator.isValid()) { <END> next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(iterator.key()), null), serializer.deserialize(Unpooled.wrappedBuffer(iterator.value()), null)); iterator.next(); checkInvariants(); } return next != null; }</code><technical_language>looping here? give a use-case</technical_language>

Target:
public boolean hasNext() { if (next == null && wrappedRocksIterator.isOpen() && wrappedRocksIterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(wrappedRocksIterator.key()), null), serializer.deserialize(Unpooled.wrappedBuffer(wrappedRocksIterator.value()), null)); wrappedRocksIterator.next(); } if (next == null && wrappedRocksIterator.isOpen()) { wrappedRocksIterator.close(); readOptions.close(); } return next != null; }
Source:
<code>public static Retryer<Boolean> makeSlackMessageSendingRetryer() { return RetryerBuilder.<Boolean>newBuilder() .retryIfResult(Predicates.equalTo(Boolean.FALSE)) <START> .withWaitStrategy(WaitStrategies.exponentialWait(3000, TimeUnit.MILLISECONDS)) <END> .build(); }</code><technical_language>I discover this wait strategy work expected</technical_language>

Target:
public static Retryer<Boolean> makeSlackMessageSendingRetryer() { return RetryerBuilder.<Boolean>newBuilder() .retryIfResult(Predicates.equalTo(Boolean.FALSE)) .withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS)) .withStopStrategy(StopStrategies.stopAfterAttempt(3)) .build(); }
Source:
<code><START> public static NotificationTag create(DownloadBatch batch, String packageName) { <END> if (batch.isQueuedForWifi()) { return new NotificationTag(DownloadNotifier.TYPE_WAITING, packageName); } else if (batch.isRunning() && batch.shouldShowActiveItem()) { return new NotificationTag(DownloadNotifier.TYPE_ACTIVE, packageName); } else if (batch.isError() && !batch.isCancelled() && batch.shouldShowCompletedItem()) { return new NotificationTag(DownloadNotifier.TYPE_FAILED, String.valueOf(batch.getBatchId())); } else if (batch.isCancelled() && batch.shouldShowCompletedItem()) { return new NotificationTag(DownloadNotifier.TYPE_CANCELLED, String.valueOf(batch.getBatchId())); } else if (batch.isSuccess() && batch.shouldShowCompletedItem()) { return new NotificationTag(DownloadNotifier.TYPE_SUCCESS, String.valueOf(batch.getBatchId())); } else { return null; } }</code><technical_language>return null in else, this super explicit clients of this method add @Nullable annotation</technical_language>

Target:
static NotificationTag create(DownloadBatch batch, String packageName) { if (batch.isQueuedForWifi()) { return new NotificationTag(SynchronisedDownloadNotifier.TYPE_WAITING, packageName); } else if (batch.isRunning() && batch.shouldShowActiveItem()) { return new NotificationTag(SynchronisedDownloadNotifier.TYPE_ACTIVE, packageName); } else if (batch.isError() && !batch.isCancelled() && batch.shouldShowCompletedItem()) { return new NotificationTag(SynchronisedDownloadNotifier.TYPE_FAILED, String.valueOf(batch.getBatchId())); } else if (batch.isCancelled() && batch.shouldShowCompletedItem()) { return new NotificationTag(SynchronisedDownloadNotifier.TYPE_CANCELLED, String.valueOf(batch.getBatchId())); } else if (batch.isSuccess() && batch.shouldShowCompletedItem()) { return new NotificationTag(SynchronisedDownloadNotifier.TYPE_SUCCESS, String.valueOf(batch.getBatchId())); } else { return null; } }
Source:
<code>public synchronized Optional<List<String>> getPartitionNames(String databaseName, String tableName) { <START> return doGetPartitionNames(databaseName, tableName, null); <END> }</code><technical_language>pass / accept nulls. Please Optional, simply pass TuppleDomain.all() predicate</technical_language>

Target:
public synchronized Optional<List<String>> getPartitionNames(String databaseName, String tableName) { return doGetPartitionNames(databaseName, tableName, ImmutableMap.of()); }
Source:
<code>private Set<Type> interfacesWithSubstitution(Symbol.TypeSymbol symbol, TypeSubstitution substitution) { return symbol.interfaces().stream() <START> .map(interfaceType -> applySubstitution(interfaceType, substitution)) <END> .flatMap(substitutedInterfaceType -> supertypes(substitutedInterfaceType).stream()) .collect(Collectors.toSet()); }</code><technical_language>2 operations ? flatmap is sufficient</technical_language>

Target:
private Set<Type> interfacesWithSubstitution(Symbol.TypeSymbol symbol, TypeSubstitution substitution) { return symbol.interfaces().stream() .flatMap(interfaceType -> supertypes(applySubstitution(interfaceType, substitution)).stream()) .collect(Collectors.toSet()); }
Source:
<code>public void testLoadFailure() throws Exception { <START> SyncRequestProcessor.setSnapCount(50); <END> ZooKeeper zk = createZKClient(hostPort); try { for (int i = 0; i< NUM_MESSAGES; i++) { zk.create("/data-", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL); } } finally { zk.close(); } stopServer(); File logDir = new File(tmpDir, FileTxnSnapLog.version + FileTxnSnapLog.VERSION); File[] logFiles = FileTxnLog.getLogFiles(logDir.listFiles(), 0); Assert.assertTrue(logFiles.length > 4); Assert.assertTrue("delete the first log file", logFiles[0].delete()); long secondStartZxid = Util.getZxidFromName(logFiles[1].getName(), "log"); FileTxnLog txnLog = new FileTxnLog(logDir); TxnIterator itr = txnLog.read(1, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); itr = txnLog.read(secondStartZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); Assert.assertTrue(itr.next()); long nextZxid = itr.getHeader().getZxid(); itr = txnLog.read(nextZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); long thirdStartZxid = Util.getZxidFromName(logFiles[2].getName(), "log"); itr = txnLog.read(thirdStartZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); Assert.assertTrue(itr.next()); nextZxid = itr.getHeader().getZxid(); itr = txnLog.read(nextZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); }</code><technical_language>iiuc server started in setUp method a result this effect. I reading right. Instead need set this call setUp</technical_language>

Target:
public void testLoadFailure() throws Exception { ZooKeeper zk = createZKClient(hostPort); try { for (int i = 0; i< NUM_MESSAGES; i++) { zk.create("/data-", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL); } } finally { zk.close(); } stopServer(); File logDir = new File(tmpDir, FileTxnSnapLog.version + FileTxnSnapLog.VERSION); File[] logFiles = FileTxnLog.getLogFiles(logDir.listFiles(), 0); Assert.assertTrue(logFiles.length > NUM_MESSAGES / 100); Assert.assertTrue("delete the first log file", logFiles[0].delete()); long secondStartZxid = Util.getZxidFromName(logFiles[1].getName(), "log"); FileTxnLog txnLog = new FileTxnLog(logDir); TxnIterator itr = txnLog.read(1, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); itr = txnLog.read(secondStartZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); Assert.assertTrue(itr.next()); long nextZxid = itr.getHeader().getZxid(); itr = txnLog.read(nextZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); long thirdStartZxid = Util.getZxidFromName(logFiles[2].getName(), "log"); itr = txnLog.read(thirdStartZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); Assert.assertTrue(itr.next()); nextZxid = itr.getHeader().getZxid(); itr = txnLog.read(nextZxid, false); Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid()); }
Source:
<code>void onInsertChunkD3() { <START> onInsertChunk("```{d3}\n\n```\n", 1, 0); <END> }</code><technical_language>Do want include data= (since required) similar include connection= for SQL? nice if cursor end of data= (as do for connection=)</technical_language>

Target:
void onInsertChunkD3() { if (notebook_ != null) { Scope setupScope = notebook_.getSetupChunkScope(); if (setupScope == null) { onInsertChunk("```{r setup}\nlibrary(r2d3)\n```\n\n```{d3 data=}\n\n```\n", 4, 12); } else { onInsertChunk("```{d3 data=}\n\n```\n", 0, 12); } } }
Source:
<code>private Set<ConstraintViolation<?>> validate(final String typeName, final String propertyName, final JsonElement propertyElement) { Assert.requireNonNull(propertyElement, "propertyElement"); if (!propertyElement.isJsonPrimitive() && !propertyElement.isJsonNull()) { throw new IllegalArgumentException("Only primitive or null properties supported. Wrong type for " + typeName + "." + propertyName); } if (propertyElement.isJsonNull()) { return remoteValidator.validateValue(typeName, propertyName, null); } <START> JsonPrimitive primitiveValue = propertyElement.getAsJsonPrimitive(); <END> if (primitiveValue.isBoolean()) { return remoteValidator.validateValue(typeName, propertyName, primitiveValue.getAsBoolean()); } else if (primitiveValue.isNumber()) { return remoteValidator.validateValue(typeName, propertyName, primitiveValue.getAsNumber()); } else if (primitiveValue.isString()) { return remoteValidator.validateValue(typeName, propertyName, primitiveValue.getAsString()); } throw new IllegalArgumentException("Not supported type for " + typeName + "." + propertyName); }</code><technical_language>Add final keyword</technical_language>

Target:
private Set<ConstraintViolation<?>> validate(final String typeName, final String propertyName, final JsonElement propertyElement) { Assert.requireNonNull(propertyElement, "propertyElement"); if (!propertyElement.isJsonPrimitive() && !propertyElement.isJsonNull()) { throw new IllegalArgumentException("Only primitive or null properties supported. Wrong type for " + typeName + "." + propertyName); } if (propertyElement.isJsonNull()) { return remoteValidator.validateValue(typeName, propertyName, null); } final JsonPrimitive primitiveValue = propertyElement.getAsJsonPrimitive(); if (primitiveValue.isBoolean()) { return remoteValidator.validateValue(typeName, propertyName, primitiveValue.getAsBoolean()); } else if (primitiveValue.isNumber()) { return remoteValidator.validateValue(typeName, propertyName, primitiveValue.getAsNumber()); } else if (primitiveValue.isString()) { return remoteValidator.validateValue(typeName, propertyName, primitiveValue.getAsString()); } throw new IllegalArgumentException("Not supported type for " + typeName + "." + propertyName); }
Source:
<code>private SignedJWTInfo getSignedJwtInfo(String accessToken) throws ParseException { String signature = accessToken.split("\\.")[2]; SignedJWTInfo signedJWTInfo = new SignedJWTInfo(); Cache gatewaySignedJWTParseCache = CacheProvider.getGatewaySignedJWTParseCache(); if (gatewaySignedJWTParseCache != null) { Object cachedEntry = gatewaySignedJWTParseCache.get(signature); if (cachedEntry != null) { signedJWTInfo = (SignedJWTInfo) cachedEntry; } else { SignedJWT signedJWT = SignedJWT.parse(accessToken); <START> signedJWTInfo.setSignedJWT(signedJWT); <END> signedJWTInfo.setJwtClaimsSet(signedJWT.getJWTClaimsSet()); signedJWTInfo.setToken(accessToken); gatewaySignedJWTParseCache.put(signature, signedJWTInfo); } } else { SignedJWT signedJWT = SignedJWT.parse(accessToken); signedJWTInfo.setSignedJWT(signedJWT); signedJWTInfo.setJwtClaimsSet(signedJWT.getJWTClaimsSet()); signedJWTInfo.setToken(accessToken); } return signedJWTInfo; }</code><technical_language>This part SignedJWTInfo. SignedJWTInfo a constructor accepts a string constructor. signedJWT is created. while calling SignedJWTInfo.getClaimSet method, getClaimSet method of signedJWT is called resulting claims cached SignedJWTInfo layer. getClaimSet is called prematurely needed. ClaimSet is saved for subsequent calls</technical_language>

Target:
private SignedJWTInfo getSignedJwtInfo(String accessToken) throws ParseException { String signature = accessToken.split("\\.")[2]; SignedJWTInfo signedJWTInfo; Cache gatewaySignedJWTParseCache = CacheProvider.getGatewaySignedJWTParseCache(); if (gatewaySignedJWTParseCache != null) { Object cachedEntry = gatewaySignedJWTParseCache.get(signature); if (cachedEntry != null) { signedJWTInfo = (SignedJWTInfo) cachedEntry; } else { SignedJWT signedJWT = SignedJWT.parse(accessToken); JWTClaimsSet jwtClaimsSet = signedJWT.getJWTClaimsSet(); signedJWTInfo = new SignedJWTInfo(accessToken, signedJWT, jwtClaimsSet); gatewaySignedJWTParseCache.put(signature, signedJWTInfo); } } else { SignedJWT signedJWT = SignedJWT.parse(accessToken); JWTClaimsSet jwtClaimsSet = signedJWT.getJWTClaimsSet(); signedJWTInfo = new SignedJWTInfo(accessToken, signedJWT, jwtClaimsSet); } return signedJWTInfo; }
Source:
<code>public static Predicate<Command> wereAfter(final Timestamp from) { return new Predicate<Command>() { @Override public boolean apply(@Nullable Command request) { checkNotNull(request); final Timestamp timestamp = getTimestamp(request); <START> return Timestamps.isLater(timestamp, from); <END> } }; }</code><technical_language>name change? Anyway, new name isLaterThan</technical_language>

Target:
public static Predicate<Command> wereAfter(final Timestamp from) { return new Predicate<Command>() { @Override public boolean apply(@Nullable Command request) { checkNotNull(request); final Timestamp timestamp = getTimestamp(request); return Timestamps.isLaterThan(timestamp, from); } }; }