auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public InstructorData(InstructorAttributes instructorAttributes) { <END> this.name = Optional.ofNullable(instructorAttributes.getName()).orElse("DEFAULT_NAME"); }</code><technical_language>In hindsight, a bad idea InstructorAttributes construct this object. Instead, I suggest rewrite constructor public InstructorData(String instructorName) set name directly. This require action updated too. responsibility of null check left action (which is, I missed review). reasoning: - InstructorAttributes directly, need put a null check + default this DTO. This considered business logic, belong in a _response_ DTO. responsibility of forming a valid response left action. - need name of instructor for this response. instructorName directly, is ambiguity is necessary create this DTO. - If InstructorAttributes, need click in is used, is annoying. - is dishonest, dependencies this DTO InstructorAttributes unclear strong enough warrant InstructorAttributes object</technical_language>

Target:
public InstructorData(InstructorAttributes instructorAttributes) { this.courseId = instructorAttributes.getCourseId(); this.email = instructorAttributes.getEmail(); this.isDisplayedToStudents = instructorAttributes.isDisplayedToStudents(); this.displayedToStudentsAs = instructorAttributes.getDisplayedName(); this.name = instructorAttributes.getName(); this.joinState = instructorAttributes.isRegistered() ? JoinState.JOINED : JoinState.NOT_JOINED; }
Source:
<code>public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); if (!feedbackSession.isPublished()) { return new JsonResult("Published email could not be resent " + "as the feedback session is not published.", HttpStatus.SC_BAD_REQUEST); } String usersToEmail = <START> getNonNullRequestParamValue(Const.ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST); <END> taskQueuer.scheduleFeedbackSessionResendPublishedEmail(courseId, feedbackSessionName, usersToEmail.split(",")); return new JsonResult("Reminders sent"); }</code><technical_language>request body request params for this. getAndValidateRequestBody method List<String> String[] type</technical_language>

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); if (!feedbackSession.isPublished()) { return new JsonResult("Published email could not be resent " + "as the feedback session is not published.", HttpStatus.SC_BAD_REQUEST); } FeedbackSessionStudentRemindRequest remindRequest = getAndValidateRequestBody(FeedbackSessionStudentRemindRequest.class); String[] usersToEmail = remindRequest.getUsersToRemind(); taskQueuer.scheduleFeedbackSessionResendPublishedEmail(courseId, feedbackSessionName, usersToEmail); return new JsonResult("Reminders sent"); }
Source:
<code>private static SiriusContext fromDAnalysis(DAnalysis dAnalysis) { <START> Session session = SessionManager.INSTANCE.getSession(dAnalysis); <END> return new SiriusContext(dAnalysis, session, null, null, dAnalysis); }</code><technical_language>get a Session is call Session.of(EObject). is more responsibility if session is found. I advice change occurrences in this class</technical_language>

Target:
private static SiriusContext fromDAnalysis(DAnalysis dAnalysis) { Session session = Session.of(dAnalysis).orElse(null); return new SiriusContext(dAnalysis, session, null, null, dAnalysis); }
Source:
<code>public byte[] convert(byte[] key, byte[] oldValue, Metadata oldMetadata, byte[] newValue, Metadata newMetadata, EventType eventType) { int capacity = UnsignedNumeric.sizeUnsignedInt(key.length) + key.length + (newValue != null ? UnsignedNumeric.sizeUnsignedInt(newValue.length) + newValue.length + 8 : 0); if (returnOldValue && oldValue != null) { capacity += UnsignedNumeric.sizeUnsignedInt(oldValue.length) + oldValue.length + 8; } byte[] out = new byte[capacity]; int offset = UnsignedNumeric.writeUnsignedInt(out, 0, key.length); offset += putBytes(key, offset, out); if (newValue != null) { offset += UnsignedNumeric.writeUnsignedInt(out, offset, newValue.length); offset += putBytes(newValue, offset, out); putLong(((NumericVersion) newMetadata.version()).getVersion(), offset, out); } if (returnOldValue && oldValue != null) { <START> offset += UnsignedNumeric.writeUnsignedInt(out, offset, oldValue.length); <END> offset += putBytes(oldValue, offset, out); putLong(((NumericVersion) newMetadata.version()).getVersion(), offset, out); } return out; }</code><technical_language>client is read event this way, client is supposed deal a missing new either. RemoteApplicationPublishedBridge assume event (remove) a new (create), corner cases (during rebalance, flags) a remove event value. listener cope missing values, if means throwing a nicer exception. OTOH change existing converter is risky break spark connector it, add minimal functionality need: if parameter include is set **and** new is null, write value, if values missing write anything, rely byte[] length in RemoteApplicationPublishedBridge if values missing throw exception return a dummy session throws exceptions access</technical_language>

Target:
public byte[] convert(byte[] key, byte[] oldValue, Metadata oldMetadata, byte[] newValue, Metadata newMetadata, EventType eventType) { int capacity = UnsignedNumeric.sizeUnsignedInt(key.length) + key.length + (newValue != null ? UnsignedNumeric.sizeUnsignedInt(newValue.length) + newValue.length + 8 : 0); if (newValue == null && returnOldValue && oldValue != null) { capacity += UnsignedNumeric.sizeUnsignedInt(oldValue.length) + oldValue.length + 8; } byte[] out = new byte[capacity]; int offset = UnsignedNumeric.writeUnsignedInt(out, 0, key.length); offset += putBytes(key, offset, out); if (newValue != null) { offset += UnsignedNumeric.writeUnsignedInt(out, offset, newValue.length); offset += putBytes(newValue, offset, out); putLong(((NumericVersion) newMetadata.version()).getVersion(), offset, out); } if (newValue == null && returnOldValue && oldValue != null) { offset += UnsignedNumeric.writeUnsignedInt(out, offset, oldValue.length); offset += putBytes(oldValue, offset, out); putLong(((NumericVersion) newMetadata.version()).getVersion(), offset, out); } return out; }
Source:
<code>private void waitElementIsStatic(FluentWait<WebDriver> webDriverWait, WebElement webElement) { <START> AtomicInteger dimensionSum = new AtomicInteger(0); <END> webDriverWait.until( (ExpectedCondition<Boolean>) driver -> { Dimension dimension = getAndWaitWebElement(webElement).getSize(); if (dimensionsAreEquivalent(dimensionSum, dimension)) { return true; } else { dimensionSum.set(getDimensionSumWithShift(dimension)); return false; } }); }</code><technical_language>dimension, please :-) Sum - is name of operation is calculate value</technical_language>

Target:
private void waitElementIsStatic(FluentWait<WebDriver> webDriverWait, WebElement webElement) { AtomicInteger sizeHashCode = new AtomicInteger(); webDriverWait.until( (ExpectedCondition<Boolean>) driver -> { Dimension newDimension = getAndWaitWebElement(webElement).getSize(); if (dimensionsAreEquivalent(sizeHashCode, newDimension)) { return true; } else { sizeHashCode.set(getSizeHashCode(newDimension)); return false; } }); }
Source:
<code>protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("UTF-8"); String baseURL = req.getRequestURL().toString(); String contentURL = baseURL.replaceFirst(Utils.SERVICE_CONTEXT, ""); String query = req.getQueryString(); if (query != null) contentURL += '?' + query; URL url = new URL(contentURL); URLConnection con = ProxyUtil.getConnection(url); con.setAllowUserInteraction(false); con.setDoInput(true); con.connect(); String contentType; ServletContext context = getServletContext(); String pathInfo = req.getPathInfo(); String mimeType = context.getMimeType(pathInfo); if (mimeType != null && !mimeType.equals("application/xhtml+xml")) { contentType = mimeType; } else { contentType = con.getContentType(); } resp.setContentType(contentType); <START> try (OutputStream out = resp.getOutputStream()) { <END> if (!contentType.equals("application/xhtml+xml") && !contentType.equals("text/html") && !con.getContentType().equals("text/html")) { try (InputStream is = con.getInputStream()) { Utils.transferContent(is, out); out.flush(); } } else { String response = Utils.convertStreamToString(ProxyUtil.getStream(url)); response = Utils.updateResponse(response); try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) { writer.write(response); } } } }</code><technical_language>In original version, "in" "out" closed end. do close now</technical_language>

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("UTF-8"); String baseURL = req.getRequestURL().toString(); String contentURL = baseURL.replaceFirst(Utils.SERVICE_CONTEXT, ""); String query = req.getQueryString(); if (query != null) contentURL += '?' + query; URL url = new URL(contentURL); URLConnection con = ProxyUtil.getConnection(url); con.setAllowUserInteraction(false); con.setDoInput(true); con.connect(); String contentType; ServletContext context = getServletContext(); String pathInfo = req.getPathInfo(); String mimeType = context.getMimeType(pathInfo); if (mimeType != null && !mimeType.equals("application/xhtml+xml")) { contentType = mimeType; } else { contentType = con.getContentType(); } resp.setContentType(contentType); @SuppressWarnings("resource") InputStream is = con.getInputStream(); OutputStream out = resp.getOutputStream(); if (!contentType.equals("application/xhtml+xml") && !contentType.equals("text/html") && !con.getContentType().equals("text/html")) { Utils.transferContent(is, out); out.flush(); } else { String response = Utils.convertStreamToString(ProxyUtil.getStream(url)); response = Utils.updateResponse(response); try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) { writer.write(response); } } }
Source:
<code>public void testHaltOnException() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); <START> treeWalkerConfig.addChild(checkConfig); <END> final DefaultConfiguration checkerConfig = createRootConfig(treeWalkerConfig); checkerConfig.addChild(treeWalkerConfig); checkerConfig.addAttribute("haltOnException", "true"); final String filePath = getPath("InputChecker.java"); try { verify(checkerConfig, filePath); fail("Exception is expected"); } catch (CheckstyleException ex) { assertEquals("Error message is not expected", "Exception was thrown while processing " + filePath, ex.getMessage()); } }</code><technical_language>replace 2 lines createTreeWalkerConfig</technical_language>

Target:
public void testHaltOnException() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); final String filePath = getPath("InputChecker.java"); try { verify(checkConfig, filePath); fail("Exception is expected"); } catch (CheckstyleException ex) { assertEquals("Error message is not expected", "Exception was thrown while processing " + filePath, ex.getMessage()); } }
Source:
<code><START> List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { <END> return AtlasFutures.getUnchecked(autobatcher.apply(count)); }</code><technical_language>want a test push 0 here. throw negative</technical_language>

Target:
List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { Preconditions.checkArgument(count > 0, "Cannot start 0 or fewer transactions"); return AtlasFutures.getUnchecked(autobatcher.apply(count)); }
Source:
<code>public String generate(Sample sample) throws MisoNamingException, IOException { if (!LimsUtils.isDetailedSample(sample)) { throw new IllegalArgumentException("Can only generate an alias for detailed samples"); } DetailedSample detailed = (DetailedSample) sample; for (DetailedSample parent = detailed.getParent(); parent != null; parent = parent.getParent()) { if (isAliquotSample(parent)) { return addSiblingTag(parent.getAlias(), detailed); } if (isTissueSample(parent)) { <START> if (isTissueSample(detailed) && isIdentitySample(parent.getParent())) { <END> return generateTissueAlias((SampleTissue) detailed, (SampleIdentity) LimsUtils.deproxify(parent.getParent())); } else { return addSiblingTag(parent.getAlias(), detailed); } } if (isIdentitySample(parent)) { if (!isTissueSample(detailed)) throw new IllegalArgumentException("Missing parent tissue"); return generateTissueAlias((SampleTissue) detailed, (SampleIdentity) parent); } } throw new IllegalArgumentException("Cannot generate alias for Identities"); }</code><technical_language>grand parent a tissue if multiple tissue-to-tissue layers possible. Stick this in LimsUtils: public static <T extends DetailedSample> getParent(Class<T> clazz, DetailedSample start) { for (DetailedSample current = start.getParent(); current != null; current = deproxify(current.getParent())) { if (clazz.isInstance(current)) { return (T) current; } } return null; } do: if (isTissueSample(detailed) && isIdentitySample(parent.getParent())) { // tissues parented tissues return generateTissueAlias((SampleTissue) detailed, LimsUtils.getParent(SampleIdentity.class, parent));</technical_language>

Target:
public String generate(Sample sample) throws MisoNamingException, IOException { if (!LimsUtils.isDetailedSample(sample)) { throw new IllegalArgumentException("Can only generate an alias for detailed samples"); } DetailedSample detailed = (DetailedSample) sample; for (DetailedSample parent = detailed.getParent(); parent != null; parent = parent.getParent()) { if (isAliquotSample(parent)) { return addSiblingTag(parent.getAlias(), detailed); } if (isTissueSample(parent)) { if (isTissueSample(detailed)) { return generateTissueAlias((SampleTissue) detailed, LimsUtils.getParent(SampleIdentity.class, parent)); } else { return addSiblingTag(parent.getAlias(), detailed); } } if (isIdentitySample(parent)) { if (!isTissueSample(detailed)) throw new IllegalArgumentException("Missing parent tissue"); return generateTissueAlias((SampleTissue) detailed, (SampleIdentity) parent); } } throw new IllegalArgumentException("Cannot generate alias for Identities"); }
Source:
<code>private void joinHelper(ETLStage filmStage, ETLStage filmActorStage, ETLStage filmCategoryStage, ETLStage joinStage, ETLStage joinSinkStage, String filmDatasetName, String filmActorDatasetName, String filmCategoryDatasetName, String joinedDatasetName, Schema outputSchema, BiFunction<Schema, TimePartitionedFileSet, Void> verifyOutput) throws Exception { ETLBatchConfig config = ETLBatchConfig.builder("* * * * *") .addStage(filmStage) .addStage(filmActorStage) .addStage(filmCategoryStage) .addStage(joinStage) .addStage(joinSinkStage) .addConnection(filmStage.getName(), joinStage.getName()) .addConnection(filmActorStage.getName(), joinStage.getName()) .addConnection(filmCategoryStage.getName(), joinStage.getName()) .addConnection(joinStage.getName(), joinSinkStage.getName()) .build(); <START> ApplicationManager appManager = deployETL(config, "joiner-test"); <END> ingestToFilmTable(filmDatasetName); ingestToFilmActorTable(filmActorDatasetName); ingestToFilmCategoryTable(filmCategoryDatasetName); runETLOnce(appManager); DataSetManager<TimePartitionedFileSet> outputManager = getDataset(joinedDatasetName); TimePartitionedFileSet fileSet = outputManager.get(); verifyOutput.apply(outputSchema, fileSet); }</code><technical_language>is issue if name is runs</technical_language>

Target:
private void joinHelper(ETLStage filmStage, ETLStage filmActorStage, ETLStage filmCategoryStage, ETLStage joinStage, ETLStage joinSinkStage, String filmDatasetName, String filmActorDatasetName, String filmCategoryDatasetName, String joinedDatasetName, Schema outputSchema, BiFunction<Schema, TimePartitionedFileSet, Void> verifyOutput) throws Exception { ETLBatchConfig config = ETLBatchConfig.builder() .addStage(filmStage) .addStage(filmActorStage) .addStage(filmCategoryStage) .addStage(joinStage) .addStage(joinSinkStage) .addConnection(filmStage.getName(), joinStage.getName()) .addConnection(filmActorStage.getName(), joinStage.getName()) .addConnection(filmCategoryStage.getName(), joinStage.getName()) .addConnection(joinStage.getName(), joinSinkStage.getName()) .build(); ApplicationManager appManager = deployETL(config, UUID.randomUUID().toString()); ingestToFilmTable(filmDatasetName); ingestToFilmActorTable(filmActorDatasetName); ingestToFilmCategoryTable(filmCategoryDatasetName); runETLOnce(appManager); DataSetManager<TimePartitionedFileSet> outputManager = getDataset(joinedDatasetName); TimePartitionedFileSet fileSet = outputManager.get(); verifyOutput.apply(outputSchema, fileSet); }
Source:
<code>protected void meetSP(final StatementPattern node) throws Exception { final Var subVar = node.getSubjectVar(); final Var predVar = node.getPredicateVar(); final Var objVar = node.getObjectVar(); final Var conVar = node.getContextVar(); if (predVar != null && objVar != null && objVar.getValue() != null && RDF.TYPE.equals(predVar.getValue()) && !EXPANDED.equals(conVar)) { final URI object = (URI) objVar.getValue(); if (inferenceEngine.isEnumeratedType(object)) { final Set<BindingSet> solutions = new LinkedHashSet<>(); final Set<Resource> enumeration = inferenceEngine.getEnumeration(object); <START> if (enumeration != null && !enumeration.isEmpty()) { <END> for (final Resource enumType : enumeration) { final QueryBindingSet qbs = new QueryBindingSet(); qbs.addBinding(subVar.getName(), enumType); solutions.add(qbs); } if (!solutions.isEmpty()) { final BindingSetAssignment enumNode = new BindingSetAssignment(); enumNode.setBindingSets(solutions); node.replaceWith(enumNode); log.trace("Replacing node with inferred one of enumeration: " + enumNode); } } } } }</code><technical_language>If getEnumeration returned empty Set (if enumerations existed), need this check. Also, isEnumeratedType(...) = true -> enumeration != null</technical_language>

Target:
protected void meetSP(final StatementPattern node) throws Exception { final Var subVar = node.getSubjectVar(); final Var predVar = node.getPredicateVar(); final Var objVar = node.getObjectVar(); final Var conVar = node.getContextVar(); if (predVar != null && objVar != null && objVar.getValue() != null && objVar.getValue() instanceof Resource && RDF.TYPE.equals(predVar.getValue()) && !EXPANDED.equals(conVar)) { final Resource object = (Resource) objVar.getValue(); if (inferenceEngine.isEnumeratedType(object)) { final Set<BindingSet> solutions = new LinkedHashSet<>(); final Set<Resource> enumeration = inferenceEngine.getEnumeration(object); for (final Resource enumType : enumeration) { final QueryBindingSet qbs = new QueryBindingSet(); qbs.addBinding(subVar.getName(), enumType); solutions.add(qbs); } if (!solutions.isEmpty()) { final BindingSetAssignment enumNode = new BindingSetAssignment(); enumNode.setBindingSets(solutions); node.replaceWith(enumNode); log.trace("Replacing node with inferred one of enumeration: " + enumNode); } } } }
Source:
<code>synchronized void completeRequest() { List<Map<Address, CacheEntry<K, V>>> retVal = keyReplicaMap.entrySet().stream() .map(Map.Entry::getValue) <START> .collect(Collectors.toList()); <END> clear(); future.complete(Collections.unmodifiableList(retVal)); }</code><technical_language>get returning keyReplicaMap.values() here</technical_language>

Target:
synchronized void completeRequest() { List<Map<Address, CacheEntry<K, V>>> retVal = new ArrayList<>(keyReplicaMap.values()); clear(); future.complete(Collections.unmodifiableList(retVal)); }
Source:
<code>public void writeHeader(final VCFHeader header) { if (isHeaderWritten) { throw new IllegalStateException("Header is already written"); <START> } <END> try { setVcfHeader(header); writeHeader(header, writer, getVersionLine(), getStreamName()); writeAndResetBuffer(); isHeaderWritten = true; } catch ( IOException e ) { throw new RuntimeIOException("Couldn't write file " + getStreamName(), e); } }</code><technical_language>redundant - setVcfHeader checks this</technical_language>

Target:
public void writeHeader(final VCFHeader header) { setVCFHeader(header); try { writeHeader(this.mHeader, writer, getVersionLine(), getStreamName()); writeAndResetBuffer(); outputHasBeenWritten = true; } catch ( IOException e ) { throw new RuntimeIOException("Couldn't write file " + getStreamName(), e); } }
Source:
<code><START> public void resolveSymbolicRef() throws IOException { <END> Reftable t = read(write( sym(HEAD, "refs/heads/tmp"), sym("refs/heads/tmp", MASTER), ref(MASTER, 1))); Ref head = t.exactRef(HEAD); assertNull(head.getObjectId()); assertEquals("refs/heads/tmp", head.getTarget().getName()); head = t.resolve(head); assertNotNull(head); assertEquals(id(1), head.getObjectId()); }</code><technical_language>Test resolving a non-symbolic ref returns identity</technical_language>

Target:
public void resolveSymbolicRef() throws IOException { Reftable t = read(write( sym(HEAD, "refs/heads/tmp"), sym("refs/heads/tmp", MASTER), ref(MASTER, 1))); Ref head = t.exactRef(HEAD); assertNull(head.getObjectId()); assertEquals("refs/heads/tmp", head.getTarget().getName()); head = t.resolve(head); assertNotNull(head); assertEquals(id(1), head.getObjectId()); Ref master = t.exactRef(MASTER); assertNotNull(master); assertSame(master, t.resolve(master)); }
Source:
<code>public boolean apply(Game game, Ability source) { boolean result = false; switch (game.getState().getZone(source.getSourceId())) { case BATTLEFIELD: Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && source.getSourceObjectZoneChangeCounter() == permanent.getZoneChangeCounter(game)) { result |= permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, onTop); } case GRAVEYARD: Card card = game.getCard(source.getSourceId()); <START> if (card != null && source.getSourceObjectZoneChangeCounter() == card.getZoneChangeCounter(game)) { <END> for (Player player : game.getPlayers().values()) { if (player.getGraveyard().contains(card.getId())) { player.getGraveyard().remove(card); result |= card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, onTop); } } } } return result; }</code><technical_language>standard call source.getSourceObjectIfItStillExists(game) instead manually ZCC compare</technical_language>

Target:
public boolean apply(Game game, Ability source) { MageObject sourceObject = source.getSourceObjectIfItStillExists(game); if (sourceObject == null) { return false; } if (sourceObject instanceof Permanent) { ((Permanent) sourceObject).moveToZone(Zone.LIBRARY, source.getSourceId(), game, onTop); return true; } else if (sourceObject instanceof Card && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { for (Player player : game.getPlayers().values()) { if (player.getGraveyard().contains(sourceObject.getId())) { player.getGraveyard().remove(((Card) sourceObject)); ((Card) sourceObject).moveToZone(Zone.LIBRARY, source.getSourceId(), game, onTop); return true; } } } return false; }
Source:
<code>protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception { String filename = m_directory_name.getStringValue(); List<URIContent> uris = new ArrayList<URIContent>(); File in = new File(convertToURL(filename).toURI()); if (!in.canRead()) { throw new Exception("Cannot read from input file: " + in.getAbsolutePath()); } String prefix = filename; if (filename.contains(".")) { prefix = prefix.split("\\.",2)[0]; } List<File> files_list_ext = listf(filename); if (files_list_ext.isEmpty()) { <START> throw new Exception("Could not find files"); <END> } for (File file : files_list_ext) { uris.add(new URIContent(file.toURI(), FilenameUtils.getExtension(file.toString()))); } IPrefixURIPortObject uri_prefix_object = null; uri_prefix_object = new PrefixURIPortObject(uris, prefix); return new PortObject[] { (URIPortObject) uri_prefix_object }; }</code><technical_language>"Could find files in selected directory" better</technical_language>

Target:
protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception { String directoryname = m_directory_name.getStringValue(); List<URIContent> uris = new ArrayList<URIContent>(); File in = new File(convertToURL(directoryname).toURI()); if (!in.canRead()) { throw new Exception("Cannot read from input file: " + in.getAbsolutePath()); } String prefix = directoryname; if (directoryname.contains(".")) { prefix = prefix.split("\\.",2)[0]; } List<File> files_list_ext = listf(directoryname); if (files_list_ext.isEmpty()) { throw new Exception("Could not find any files in the selected directory"); } for (File file : files_list_ext) { uris.add(new URIContent(file.toURI(), FilenameUtils.getExtension(file.toString()))); } IPrefixURIPortObject uri_prefix_object = null; uri_prefix_object = new PrefixURIPortObject(uris, prefix); return new PortObject[] { (URIPortObject) uri_prefix_object }; }
Source:
<code>@Test public void invalidCenterInside() { try { new RequestBuilder().centerInside(); fail("Center inside without resize should throw exception."); } catch (IllegalStateException expected) { } try { <START> new RequestBuilder().centerInside().centerCrop(); <END> fail("Calling center inside after center crop should throw exception."); } catch (IllegalStateException expected) { } }</code><technical_language>Need add a resize(10, 10) here. failure is due lack of resize</technical_language>

Target:
@Test public void invalidCenterInside() { try { new RequestBuilder().centerInside(); fail("Center inside without resize should throw exception."); } catch (IllegalStateException expected) { } try { new RequestBuilder().resize(10, 10).centerInside().centerCrop(); fail("Calling center inside after center crop should throw exception."); } catch (IllegalStateException expected) { } }
Source:
<code>private boolean isColdReboot() { boolean coldReboot = (getVm().isRunOnce() && <START> !getVm().isVolatileRun()) <END> || getVm().isNextRunConfigurationExists(); log.info("VM '{}' is performing reboot; run once: '{}', running as volatile: '{}', has next run configuration: '{}'", getVm().getName(), coldReboot ? "cold" : "warm", getVm().isRunOnce(), getVm().isVolatileRun(), getVm().isNextRunConfigurationExists()); return coldReboot; }</code><technical_language>perform cold reboot for volatile runs</technical_language>

Target:
private boolean isColdReboot() { boolean coldReboot = (getVm().isRunOnce() && getVm().isVolatileRun()) || getVm().isNextRunConfigurationExists(); log.info("VM '{}' is performing reboot; run once: '{}', running as volatile: '{}', has next run configuration: '{}'", getVm().getName(), coldReboot ? "cold" : "warm", getVm().isRunOnce(), getVm().isVolatileRun(), getVm().isNextRunConfigurationExists()); return coldReboot; }
Source:
<code>public void truncatePutJob() throws Exception { final int testTimeOutSeconds = 5; final String book1 = "beowulf.txt"; final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); try { final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); final UUID jobId = putJob.getJobId(); final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); <START> final TruncateJobSpectraS3Response failedResponse = client.truncateJobSpectraS3( <END> new TruncateJobSpectraS3Request(jobId.toString())); assertThat(failedResponse.getStatusCode(),is(204)); final GetJobSpectraS3Response truncatedJob = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId.toString())); assertEquals(truncatedJob.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); } finally { deleteAllContents(client, BUCKET_NAME); } }</code><technical_language>is called failed response if returns a 204</technical_language>

Target:
public void truncatePutJob() throws Exception { final int testTimeOutSeconds = 5; final String book1 = "beowulf.txt"; final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); try { final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); final UUID jobId = putJob.getJobId(); final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); final TruncateJobSpectraS3Response truncateJobSpectraS3Response = client.truncateJobSpectraS3( new TruncateJobSpectraS3Request(jobId.toString())); assertThat(truncateJobSpectraS3Response.getStatusCode(),is(204)); final GetJobSpectraS3Response truncatedJob = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId.toString())); assertEquals(truncatedJob.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
<code>public void getValueFromEntity(CallingContext cc) throws ODKDatastoreException { DynamicBase rel = (DynamicBase) repeatGroup.getFormDataModel().getBackingObjectPrototype(); Query q = cc.getDatastore().createQuery(rel, "RepeatSubmissionType.getValueFromEntity", cc.getCurrentUser()); q.addFilter(rel.parentAuri, FilterOperation.EQUAL, uriAssociatedRow); q.addSort(rel.parentAuri, Direction.ASCENDING); q.addSort(rel.ordinalNumber, Direction.ASCENDING); <START> long maxOrdinalNumber = 0; <END> Map<Long, List<DynamicBase>> rowsPerOrdinalNumber = new HashMap<>(); for (CommonFieldsBase cb : q.executeQuery()) { DynamicBase db = (DynamicBase) cb; Long ordinalNumber = db.getOrdinalNumber(); maxOrdinalNumber = Math.max(maxOrdinalNumber, ordinalNumber); if (!rowsPerOrdinalNumber.containsKey(ordinalNumber)) rowsPerOrdinalNumber.put(ordinalNumber, new ArrayList<DynamicBase>()); rowsPerOrdinalNumber.get(ordinalNumber).add(db); } if (rowsPerOrdinalNumber.size() != maxOrdinalNumber) LOGGER.error("Repeat table " + rel.getTableName() + " has dupes or missing rows for top level auri " + rel.getTopLevelAuri() + " and parent auri " + rel.getParentAuri()); for (List<DynamicBase> dbs : rowsPerOrdinalNumber.values()) submissionSets.add(new SubmissionSet(enclosingSet, chooseOne(dbs), repeatGroup, form, cc)); }</code><technical_language>tend mark this final a small thing</technical_language>

Target:
public void getValueFromEntity(CallingContext cc) throws ODKDatastoreException { DynamicBase submission = (DynamicBase) repeatGroup.getFormDataModel().getBackingObjectPrototype(); List<CommonFieldsBase> repeatRows = getRepeatRows(cc, submission); for (List<DynamicBase> groupOfRepeatRows : groupPerOrdinalNumber(submission, repeatRows)) submissionSets.add(new SubmissionSet(enclosingSet, chooseOneFrom(groupOfRepeatRows), repeatGroup, form, cc)); }
Source:
<code>public static Metric from(String fullName, double value, MetricType metricType) { String[] pieces = fullName.split("\\."); Preconditions.checkArgument(pieces.length > 1, "Incorrect metrics name: %s.", fullName); int len = pieces.length; String hostname = null; int tagEndIndex = len; if (!pieces[0].equals(MetricsSystem.InstanceType.MASTER.toString()) && !pieces[0].equals(MetricsSystem.CLUSTER)) { <START> hostname = pieces[len - 1]; <END> tagEndIndex = len - 1; } MetricsSystem.InstanceType instance = MetricsSystem.InstanceType.fromString(pieces[0]); Metric metric = new Metric(instance, hostname, metricType, pieces[1], value); for (int i = 2; i < tagEndIndex; i++) { String tagStr = pieces[i]; if (!tagStr.contains(TAG_SEPARATOR)) { continue; } int tagSeparatorIdx = tagStr.indexOf(TAG_SEPARATOR); metric.addTag(tagStr.substring(0, tagSeparatorIdx), tagStr.substring(tagSeparatorIdx + 1)); } return metric; }</code><technical_language>hostname a descriptive variable name for this anymore, right</technical_language>

Target:
public static Metric from(String fullName, double value, MetricType metricType) { String[] pieces = fullName.split("\\."); Preconditions.checkArgument(pieces.length > 1, "Incorrect metrics name: %s.", fullName); int len = pieces.length; String source = null; int tagEndIndex = len; if (!pieces[0].equals(MetricsSystem.InstanceType.MASTER.toString()) && !pieces[0].equals(MetricsSystem.CLUSTER)) { source = pieces[len - 1]; tagEndIndex = len - 1; } MetricsSystem.InstanceType instance = MetricsSystem.InstanceType.fromString(pieces[0]); Metric metric = new Metric(instance, source, metricType, pieces[1], value); for (int i = 2; i < tagEndIndex; i++) { String tagStr = pieces[i]; if (!tagStr.contains(TAG_SEPARATOR)) { continue; } int tagSeparatorIdx = tagStr.indexOf(TAG_SEPARATOR); metric.addTag(tagStr.substring(0, tagSeparatorIdx), tagStr.substring(tagSeparatorIdx + 1)); } return metric; }
Source:
<code>public void generateChunk(CoreChunk chunk, Region chunkRegion) { FloraFacet facet = chunkRegion.getFacet(FloraFacet.class); Block air = BlockManager.getAir(); <START> Random rng = new FastRandom(chunk.getPosition().hashCode()); <END> Map<Vector3i, FloraType> entries = facet.getRelativeEntries(); for (Vector3i pos : entries.keySet()) { if (chunk.getBlock(pos).equals(air)) { FloraType type = entries.get(pos); Block block = getBlock(rng, type); chunk.setBlock(pos, block); } } }</code><technical_language>This flora deterministic anymore if size of facet changes. I matters in this case. out loud</technical_language>

Target:
public void generateChunk(CoreChunk chunk, Region chunkRegion) { FloraFacet facet = chunkRegion.getFacet(FloraFacet.class); Block air = BlockManager.getAir(); NoiseTable noise = new NoiseTable(chunk.getPosition().hashCode()); Map<Vector3i, FloraType> entries = facet.getRelativeEntries(); for (Vector3i pos : entries.keySet()) { if (chunk.getBlock(pos).equals(air)) { FloraType type = entries.get(pos); List<Block> list = flora.get(type); int blockIdx = noise.noise(pos.x, pos.y, pos.z) % list.size(); Block block = list.get(blockIdx); chunk.setBlock(pos, block); } } }
Source:
<code>public CreateServerWithKeyPair(String username, String apiKey) { Iterable<Module> modules = ImmutableSet.<Module> of(new SshjSshClientModule()); Properties overrides = new Properties(); overrides.setProperty(POLL_INITIAL_PERIOD, POLL_PERIOD_TWENTY_SECONDS); overrides.setProperty(POLL_MAX_PERIOD, POLL_PERIOD_TWENTY_SECONDS); ComputeServiceContext context = ContextBuilder.newBuilder(PROVIDER) .credentials(username, apiKey) .overrides(overrides) .modules(modules) .buildView(ComputeServiceContext.class); computeService = context.getComputeService(); <START> nova = computeService.getContext().unwrap(); <END> }</code><technical_language>guessing unwrapApi of jclouds version</technical_language>

Target:
public CreateServerWithKeyPair(String username, String apiKey) { Iterable<Module> modules = ImmutableSet.<Module> of(new SshjSshClientModule()); Properties overrides = new Properties(); overrides.setProperty(POLL_INITIAL_PERIOD, POLL_PERIOD_TWENTY_SECONDS); overrides.setProperty(POLL_MAX_PERIOD, POLL_PERIOD_TWENTY_SECONDS); ComputeServiceContext context = ContextBuilder.newBuilder(PROVIDER) .credentials(username, apiKey) .overrides(overrides) .modules(modules) .buildView(ComputeServiceContext.class); computeService = context.getComputeService(); novaContext = context.unwrap(); }
Source:
<code><START> public MongoDbOutboundGatewaySpec queryExpression(String queryExpression) { <END> this.mongoDbOutboundGateway.setMongoDbQueryExpression(PARSER.parseExpression(queryExpression)); return this; }</code><technical_language>I queryFunction(Function<Message<P>, Query>) awesome addition</technical_language>

Target:
public MongoDbOutboundGatewaySpec queryExpression(String queryExpression) { this.target.setQueryExpressionString(queryExpression); return this; }
Source:
<code>public void removeShare() throws VersionException, LockException, ConstraintViolationException, RepositoryException { checkSession(); AbstractJcrNode parent = null; try { parent = getParent(); } catch (ItemNotFoundException e) { throw new InvalidItemStateException(e); } Path path = null; try { parent.checkForLock(); path = path(); <START> session.addContextData(JCR_CONTENT, JCR_CONTENT); <END> session.checkPermission(path, ModeShapePermissions.REMOVE); session.checkPermission(parent.getPath(), ModeShapePermissions.REMOVE_CHILD_NODES); } catch (NodeNotFoundInParentException e) { throw new InvalidItemStateException(e); } if (!parent.isCheckedOut()) { NodeDefinition defn = getDefinition(); int opv = defn.getOnParentVersion(); if (opv != OnParentVersionAction.IGNORE) { String opvStr = OnParentVersionAction.nameFromValue(opv); I18n msg = JcrI18n.cannotRemoveChildOnCheckedInNodeSinceOpvOfChildDefinitionIsNotIgnore; throw new VersionException(msg.text(path, defn.getName(), opvStr)); } } doRemove(); }</code><technical_language>is this done? add session's data map</technical_language>

Target:
public void removeShare() throws VersionException, LockException, ConstraintViolationException, RepositoryException { checkSession(); AbstractJcrNode parent = null; try { parent = getParent(); } catch (ItemNotFoundException e) { throw new InvalidItemStateException(e); } Path path = null; try { parent.checkForLock(); path = path(); session.checkPermission(path, ModeShapePermissions.REMOVE); session.checkPermission(parent.getPath(), ModeShapePermissions.REMOVE_CHILD_NODES); } catch (NodeNotFoundInParentException e) { throw new InvalidItemStateException(e); } if (!parent.isCheckedOut()) { NodeDefinition defn = getDefinition(); int opv = defn.getOnParentVersion(); if (opv != OnParentVersionAction.IGNORE) { String opvStr = OnParentVersionAction.nameFromValue(opv); I18n msg = JcrI18n.cannotRemoveChildOnCheckedInNodeSinceOpvOfChildDefinitionIsNotIgnore; throw new VersionException(msg.text(path, defn.getName(), opvStr)); } } doRemove(); }
Source:
<code>private Sequence<Row> postAggregate(final GroupByQuery query, IncrementalIndex index) { <START> return Sequences.simple(index.iterableWithPostAggregations(query.getPostAggregatorSpecs())); <END> }</code><technical_language>if this change is needed. If leave this in, need changes IncrementalIndex</technical_language>

Target:
private Sequence<Row> postAggregate(final GroupByQuery query, IncrementalIndex index) { return Sequences.map( Sequences.simple(index.iterableWithPostAggregations(query.getPostAggregatorSpecs())), new Function<Row, Row>() { @Override public Row apply(Row input) { final MapBasedRow row = (MapBasedRow) input; return new MapBasedRow( query.getGranularity() .toDateTime(row.getTimestampFromEpoch()), row.getEvent() ); } } ); }
Source:
<code>public void stop() { <START> if (scheduledTask != null) { scheduledTask.cancel(true); } <END> }</code><technical_language>I guess work queue listens stop event cancels tasks. this verified</technical_language>

Target:
public void stop() { }
Source:
<code><START> private Callable<Integer> getSleepCallable(int durationMillis) { <END> return () -> { Thread.sleep(durationMillis); return durationMillis; }; }</code><technical_language>this a constant, static</technical_language>

Target:
private static Callable<Integer> getSleepCallable(int durationMillis) { return () -> { Thread.sleep(durationMillis); return durationMillis; }; }
Source:
<code>public void testWriteTimeout() throws Exception { final int port = SocketUtils.findAvailableServerSocket(); TcpNioClientConnectionFactory factory = new TcpNioClientConnectionFactory("localhost", port); factory.setSoTimeout(1000); factory.start(); final CountDownLatch latch = new CountDownLatch(1); final CountDownLatch done = new CountDownLatch(1); Executors.newSingleThreadExecutor().execute(new Runnable() { @Override @SuppressWarnings("unused") public void run() { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(port); latch.countDown(); Socket s = server.accept(); done.await(10, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); } } }); assertTrue(latch.await(10000, TimeUnit.MILLISECONDS)); try { TcpConnection connection = factory.getConnection(); connection.send(MessageBuilder.withPayload(new byte[1000000]).build()); } catch (Exception e) { assertTrue("Expected SocketTimeoutException, got " + e.getClass().getSimpleName() + ":" + e.getMessage(), e instanceof SocketTimeoutException); } <START> done.countDown(); <END> }</code><technical_language>Cool! waiting Thread stuff, waits untill send socket. work before? close server cocket here</technical_language>

Target:
public void testWriteTimeout() throws Exception { final int port = SocketUtils.findAvailableServerSocket(); TcpNioClientConnectionFactory factory = new TcpNioClientConnectionFactory("localhost", port); factory.setSoTimeout(1000); factory.start(); final CountDownLatch latch = new CountDownLatch(1); final CountDownLatch done = new CountDownLatch(1); final AtomicReference<ServerSocket> serverSocket = new AtomicReference<ServerSocket>(); Executors.newSingleThreadExecutor().execute(new Runnable() { @Override @SuppressWarnings("unused") public void run() { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(port); serverSocket.set(server); latch.countDown(); Socket s = server.accept(); done.await(10, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); } } }); assertTrue(latch.await(10000, TimeUnit.MILLISECONDS)); try { TcpConnection connection = factory.getConnection(); connection.send(MessageBuilder.withPayload(new byte[1000000]).build()); } catch (Exception e) { assertTrue("Expected SocketTimeoutException, got " + e.getClass().getSimpleName() + ":" + e.getMessage(), e instanceof SocketTimeoutException); } done.countDown(); serverSocket.get().close(); }
Source:
<code>private static Map<String, String> mapParams(Map<String, String>fieldsMap, Map<String, String> params) { Map<String, String> mapped = new HashMap<>(); for (String k: params.keySet()) { <START> String fk = fieldsMap.get(k); <END> mapped.put(fk, params.get(k)); } return mapped; }</code><technical_language>This null, handle this if JIRA api changes</technical_language>

Target:
private static Map<String, String> mapParams(Map<String, String>fieldsMap, Map<String, String> params) { Map<String, String> mapped = new HashMap<>(); for (String k: params.keySet()) { String fk = fieldsMap.get(k); if (fk == null) { throw new JiraClientException(String.format("Could not map field name '%s'", k)); } mapped.put(fk, params.get(k)); } return mapped; }
Source:
<code>public void project(ICause cause) throws ContradictionException { switch (op) { case ADD: e1.intersect(RealUtils.sub(this, e2), cause); e2.intersect(RealUtils.sub(this, e1), cause); break; case SUB: e1.intersect(RealUtils.add(this, e2), cause); e2.intersect(RealUtils.sub(e1, this), cause); break; case MUL: RealInterval res = RealUtils.odiv_wrt(this, e2, e1); if (res.getLB() > res.getUB()) { throw model.getSolver().getContradictionException().set(cause, null, ""); } e1.intersect(res, cause); res = RealUtils.odiv_wrt(this, e1, e2); if (res.getLB() > res.getUB()) { throw model.getSolver().getContradictionException().set(cause, null, ""); } e2.intersect(res, cause); break; case DIV: e1.intersect(RealUtils.mul(this, e2), cause); <START> e2.intersect(RealUtils.mul(this, e1), cause); <END> break; case POW: case MIN: case MAX: case ATAN2: default: throw new UnsupportedOperationException("Equation does not support " + op.name()); } }</code><technical_language>I think, e2.intersect(RealUtils.odiv_wrt(e1, this, e2), cause);</technical_language>

Target:
public void project(ICause cause) throws ContradictionException { switch (op) { case ADD: e1.intersect(RealUtils.sub(this, e2), cause); e2.intersect(RealUtils.sub(this, e1), cause); break; case SUB: e1.intersect(RealUtils.add(this, e2), cause); e2.intersect(RealUtils.sub(e1, this), cause); break; case MUL: e1.intersect(RealUtils.odiv_wrt(this, e2, e1), cause); e2.intersect(RealUtils.odiv_wrt(this, e1, e2), cause); break; case DIV: e1.intersect(RealUtils.mul(this, e2), cause); e2.intersect(RealUtils.odiv_wrt(e1, this, e2), cause); break; case MIN: e1.intersect(this.getLB(), RealUtils.nextFloat(e1.getUB()), cause); e2.intersect(this.getLB(), RealUtils.nextFloat(e2.getUB()), cause); if (e2.getLB() > this.getUB()) { e1.intersect(RealUtils.prevFloat(e1.getLB()), this.getUB(), cause); } if (e1.getLB() > this.getUB()) { e2.intersect(RealUtils.prevFloat(e2.getLB()), this.getUB(), cause); } break; case MAX: e1.intersect(RealUtils.prevFloat(e1.getLB()), this.getUB(), cause); e2.intersect(RealUtils.prevFloat(e2.getLB()), this.getUB(), cause); if (e2.getUB() < this.getLB()) { e1.intersect(this.getLB(), RealUtils.nextFloat(e1.getUB()), cause); } if (e1.getUB() < this.getLB()) { e2.intersect(this.getLB(), RealUtils.nextFloat(e2.getUB()), cause); } break; case POW: case ATAN2: default: throw new UnsupportedOperationException("Equation does not support " + op.name()+". Consider using Ibex instead."); } }
Source:
<code>void shouldUpdateChargeToCaptured_IfEpdqStatusIs9() { final String payload = notificationPayloadForTransaction(payId, EPDQ_PAYMENT_REQUESTED); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); <START> final boolean result = notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES); assertTrue(result); <END> verify(mockChargeNotificationProcessor).invoke(payId, charge, CAPTURED, null); }</code><technical_language>inlined</technical_language>

Target:
void shouldUpdateChargeToCaptured_IfEpdqStatusIs9() { final String payload = notificationPayloadForTransaction(payId, EPDQ_PAYMENT_REQUESTED); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); assertTrue(notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES)); verify(mockChargeNotificationProcessor).invoke(payId, charge, CAPTURED, null); }
Source:
<code>public void suggestReviewNow() { long delay = TimeUnit.SECONDS.toMillis(1) - (System.currentTimeMillis() - lastSuggestedReview); <START> if (delay < 0) { <END> lastSuggestedReview = System.currentTimeMillis(); Computer.threadPoolForRemoting.submit(() -> { LOGGER.fine(() -> "running suggested review for " + label); update(); }); } else if (!queuedReview) { queuedReview = true; LOGGER.fine(() -> "running suggested review in " + delay + " ms for " + label); Timer.get().schedule(() -> { lastSuggestedReview = System.currentTimeMillis(); LOGGER.fine(() -> "running suggested review for " + label + " after " + delay + " ms"); update(); }, delay, TimeUnit.MILLISECONDS); } else { LOGGER.fine(() -> "ignoring suggested review for " + label); } }</code><technical_language>If a queued review call suggestReviewNow possibly call update()</technical_language>

Target:
public void suggestReviewNow() { if (!queuedReview) { long delay = TimeUnit.SECONDS.toMillis(1) - (System.currentTimeMillis() - lastSuggestedReview); if (delay < 0) { lastSuggestedReview = System.currentTimeMillis(); Computer.threadPoolForRemoting.submit(() -> { LOGGER.fine(() -> "running suggested review for " + label); update(); }); } else { queuedReview = true; LOGGER.fine(() -> "running suggested review in " + delay + " ms for " + label); Timer.get().schedule(() -> { lastSuggestedReview = System.currentTimeMillis(); LOGGER.fine(() -> "running suggested review for " + label + " after " + delay + " ms"); update(); }, delay, TimeUnit.MILLISECONDS); } } else { LOGGER.fine(() -> "ignoring suggested review for " + label); } }