auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static RenderScript create(Context ctx, ContextType ct, int flags) { int v = ctx.getApplicationInfo().targetSdkVersion; if (v < 23) { return internalCreate(ctx, v, ct, flags); } <START> for (RenderScript prs : mProcessContextList) { <END> if ((prs.mContextType == ct) && (prs.mContextFlags == flags) && (prs.mContextSdkVersion == v)) { return prs; } } RenderScript prs = internalCreate(ctx, v, ct, flags); prs.mIsProcessContext = true; mProcessContextList.add(prs); return prs; }</code><technical_language>need accesses mProcessContextList synchronized</technical_language>

Target:
public static RenderScript create(Context ctx, ContextType ct, int flags) { int v = ctx.getApplicationInfo().targetSdkVersion; if (v < 23) { return internalCreate(ctx, v, ct, flags); } synchronized (mProcessContextList) { for (RenderScript prs : mProcessContextList) { if ((prs.mContextType == ct) && (prs.mContextFlags == flags) && (prs.mContextSdkVersion == v)) { return prs; } } } RenderScript prs = internalCreate(ctx, v, ct, flags); synchronized (mProcessContextList) { prs.mIsProcessContext = true; mProcessContextList.add(prs); } return prs; }
Source:
<code>private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix, int reqWidth, int reqHeight) { int matrixWidth = matrix.getWidth(); int matrixHeight = matrix.getHeight(); int outputWidth = Math.max(reqWidth, matrixWidth); int outputHeight = Math.max(reqHeight, matrixHeight); int multiple = Math.min(outputWidth / matrixWidth, outputHeight / matrixHeight); int leftPadding = (outputWidth - (matrixWidth * multiple)) / 2 ; int topPadding = (outputHeight - (matrixHeight * multiple)) / 2 ; BitMatrix output; if (reqHeight < matrixHeight || reqWidth < matrixWidth) { <START> leftPadding = topPadding = 0 ; <END> output = new BitMatrix(matrixWidth, matrixHeight); } else { output = new BitMatrix(reqWidth, reqHeight); } output.clear(); for (int inputY = 0, outputY = topPadding; inputY < matrixHeight; inputY++, outputY += multiple) { for (int inputX = 0, outputX = leftPadding; inputX < matrixWidth; inputX++, outputX += multiple) { if (matrix.get(inputX, inputY) == 1) { output.setRegion(outputX, outputY, multiple, multiple); } } } return output; }</code><technical_language>separate statements remove space ;</technical_language>

Target:
private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix, int reqWidth, int reqHeight) { int matrixWidth = matrix.getWidth(); int matrixHeight = matrix.getHeight(); int outputWidth = Math.max(reqWidth, matrixWidth); int outputHeight = Math.max(reqHeight, matrixHeight); int multiple = Math.min(outputWidth / matrixWidth, outputHeight / matrixHeight); int leftPadding = (outputWidth - (matrixWidth * multiple)) / 2 ; int topPadding = (outputHeight - (matrixHeight * multiple)) / 2 ; BitMatrix output; if (reqHeight < matrixHeight || reqWidth < matrixWidth) { leftPadding = 0; topPadding = 0; output = new BitMatrix(matrixWidth, matrixHeight); } else { output = new BitMatrix(reqWidth, reqHeight); } output.clear(); for (int inputY = 0, outputY = topPadding; inputY < matrixHeight; inputY++, outputY += multiple) { for (int inputX = 0, outputX = leftPadding; inputX < matrixWidth; inputX++, outputX += multiple) { if (matrix.get(inputX, inputY) == 1) { output.setRegion(outputX, outputY, multiple, multiple); } } } return output; }
Source:
<code>public void testPredicateOnPartitionSymbolsPushedThroughWindow() { <START> PlanMatchPattern tableScan = tableScan("orders", <END> ImmutableMap.of("CUST_KEY", "custkey", "ORDER_KEY", "orderkey")); assertPlan( "SELECT * FROM (" + "SELECT custkey, orderkey, rank() OVER (PARTITION BY custkey ORDER BY orderdate ASC)" + "FROM orders" + ") WHERE custkey = 0 AND orderkey > 0", anyTree( filter("ORDER_KEY > BIGINT '0'", anyTree( window(builder -> {}, anyTree(filter("CUST_KEY = BIGINT '0'", tableScan))))))); }</code><technical_language>Move "orders" new line, e.g: arguments in new line</technical_language>

Target:
public void testPredicateOnPartitionSymbolsPushedThroughWindow() { PlanMatchPattern tableScan = tableScan( "orders", ImmutableMap.of( "CUST_KEY", "custkey", "ORDER_KEY", "orderkey")); assertPlan( "SELECT * FROM (" + "SELECT custkey, orderkey, rank() OVER (PARTITION BY custkey ORDER BY orderdate ASC)" + "FROM orders" + ") WHERE custkey = 0 AND orderkey > 0", anyTree( filter("ORDER_KEY > BIGINT '0'", anyTree( node(WindowNode.class, anyTree( filter("CUST_KEY = BIGINT '0'", tableScan))))))); }
Source:
<code>public boolean checkAndStartUnsentFormsTask(SyncCapableCommCareActivity activity, final boolean syncAfterwards, boolean userTriggered) { SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class); FormRecord[] records = StorageUtils.getUnsentRecordsForCurrentApp(storage); <START> HiddenPreferences.updateLastUploadAttemptTime(); <END> if (records.length > 0) { processAndSendForms(activity, records, syncAfterwards, userTriggered); return true; } else { return false; } }</code><technical_language>want this invocation: this (or below) get triggered **automatic** sends (the happen in background), **blocking** sends (the happen user presses 'sync', and/or app triggers autosync)? want attempt send forms invalidate forced sync attempt, app send forms time user completes one. want users get 'credit' for a sync attempt form submissions if blocking Modal Dialog up, submissions run in background</technical_language>

Target:
public boolean checkAndStartUnsentFormsTask(SyncCapableCommCareActivity activity, final boolean syncAfterwards, boolean userTriggered) { SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class); FormRecord[] records = StorageUtils.getUnsentRecordsForCurrentApp(storage); if (syncAfterwards) { HiddenPreferences.updateLastUploadSyncAttemptTime(); } if (records.length > 0) { processAndSendForms(activity, records, syncAfterwards, userTriggered); return true; } else { return false; } }
Source:
<code><START> public void rememeberFilter() { <END> MetadataMap filters = (MetadataMap) getSession().getAttribute(FILTER_INPUTS); if (filter.getDefaultModelObjectAsString().isEmpty() && filters != null) { filters.put(dataProvider.getClass().getName(), null); return; } if (filters == null) { filters = new MetadataMap(); getSession().setAttribute(FILTER_INPUTS, filters); } filters.put(dataProvider.getClass().getName(), filter.getDefaultModelObjectAsString()); }</code><technical_language>new methods public</technical_language>

Target:
private void rememeberFilter() { MetadataMap filters = getMetaDataMapFromSession(FILTER_INPUTS); if (filter.getDefaultModelObjectAsString().isEmpty() && filters != null) { filters.put(dataProvider.getClass().getName(), null); return; } if (filters == null) { filters = new MetadataMap(); getSession().setAttribute(FILTER_INPUTS, filters); } filters.put(dataProvider.getClass().getName(), filter.getDefaultModelObjectAsString()); }
Source:
<code><START> public void onExecutionStart() { <END> if (onStartInvoked.compareAndSet(false, true)) { for (ExecutionListener<I, O> listener : listeners) { try { listener.onExecutionStart(context.getChildContext(listener)); } catch (Throwable e) { if (e instanceof AbortExecutionException) { throw (AbortExecutionException) e; } logger.error("Error invoking listener " + listener, e); } } } }</code><technical_language>calling this more throw exception? invalid state</technical_language>

Target:
public void onExecutionStart() { onExecutionStart(this.context); }
Source:
<code>protected void run(@Nonnull List<String> cmdLine) { ExecuteFile exec = new ExecuteFile(cmdLine.toArray(new String[cmdLine.size()])); <START> String userHome = System.getProperty("user.home"); <END> if (userHome == null) { throw new RuntimeException("'user.home' is not defined"); } String userName = System.getProperty("user.name"); if (userName == null) { throw new RuntimeException("'user.name' is not defined"); } exec.addEnvVar("HOME", userHome); exec.addEnvVar("USER", userName); exec.setErr(errRedirectStream); exec.setOut(outRedirectStream); exec.setVerbose(isVerbose); try { if (exec.run() != 0) { throw new RuntimeException("Jack compiler exited with an error"); } } catch (ExecFileException e) { throw new RuntimeException("An error occurred while running Jack", e); } }</code><technical_language>this? not</technical_language>

Target:
protected void run(@Nonnull List<String> cmdLine) { ExecuteFile exec = new ExecuteFile(cmdLine.toArray(new String[cmdLine.size()])); exec.addEnvVar("HOME", System.getenv("HOME")); exec.addEnvVar("USER", System.getenv("USER")); exec.setErr(errRedirectStream); exec.setOut(outRedirectStream); exec.setVerbose(isVerbose); try { if (exec.run() != 0) { throw new RuntimeException("Jack compiler exited with an error"); } } catch (ExecFileException e) { throw new RuntimeException("An error occurred while running Jack", e); } }
Source:
<code>private static void assertBufferStringAndVariables(String expected, TemplateBuffer buffer) { assertEquals(expected, buffer.getString()); for (TemplateVariable v : buffer.getVariables()) { <START> assertEquals(true, v.isResolved()); <END> assertEquals(true, v.isUnambiguous()); } }</code><technical_language>assertTrue</technical_language>

Target:
private static void assertBufferStringAndVariables(String expected, TemplateBuffer buffer) { assertEquals(expected, buffer.getString()); for (TemplateVariable v : buffer.getVariables()) { assertTrue(v.isResolved()); assertTrue(v.isUnambiguous()); } }
Source:
<code>public void testCLIFsckWithParam() throws Exception { final int result = run(S3GuardTool.Fsck.NAME, "-check", "s3a://" + getFileSystem().getBucket()); <START> assertEquals("The result should be success when fsck is running with " <END> + "correct parameters.", SUCCESS, result); }</code><technical_language>this test failed for a parallel run. This parallelizable test a path is is private this test; another invokes a missing path. full root scan run in ITestS3GuardDDBRootOperations test, cleanup</technical_language>

Target:
public void testCLIFsckWithParam() throws Exception { final int result = run(S3GuardTool.Fsck.NAME, "-check", "s3a://" + getFileSystem().getBucket()); LOG.info("This test serves the purpose to run fsck with the correct " + "parameters, so there will be no exception thrown. " + "The return value of the run: {}", result); }
Source:
<code><START> public StreamSerializerAdapter(InternalSerializationService service, StreamSerializer serializer) { <END> this.service = service; this.serializer = serializer; }</code><technical_language>instead of changing visibility of constructor static factory method SerializationUtil#createSerializerAdapter public client code Jet side work SerializerAdapter interface</technical_language>

Target:
StreamSerializerAdapter(InternalSerializationService service, StreamSerializer serializer) { this.service = service; this.serializer = serializer; }
Source:
<code>public Callable<Course> getFullCourseInfoTask(final Course courseStub) { return wrapWithNotLoggedInException(new Callable<Course>() { @Override public Course call() throws Exception { try { URI serverUrl = addApiCallQueryParameters(courseStub.getDetailsUrl()); Course returnedFromServer = getCourseInfo(serverUrl); try { URI skillifierUrl = getSkillifierUrl("/course/" + courseStub.getName()); Course returnedFromSkillifier = getCourseInfo(skillifierUrl); returnedFromServer.getExercises().addAll(returnedFromSkillifier.getExercises()); } catch (Exception e) { <START> LOG.log(Level.WARNING, "Downloading adaptive exercise info from skillifier failed."); <END> } addAdaptiveExercisesFromStub(returnedFromServer, courseStub); returnedFromServer.generateThemes(); return returnedFromServer; } catch (FailedHttpResponseException ex) { return checkForObsoleteClient(ex); } } }); }</code><technical_language>Log original exception well</technical_language>

Target:
public Callable<Course> getFullCourseInfoTask(final Course courseStub) { return wrapWithNotLoggedInException(new Callable<Course>() { @Override public Course call() throws Exception { try { URI serverUrl = addApiCallQueryParameters(courseStub.getDetailsUrl()); Course returnedFromServer = getCourseInfo(serverUrl); try { URI skillifierUrl = getSkillifierUrl("/course/" + courseStub.getName()); Course returnedFromSkillifier = getCourseInfo(skillifierUrl); returnedFromServer.getExercises().addAll(returnedFromSkillifier.getExercises()); } catch (Exception e) { LOG.log(Level.WARNING, "Downloading adaptive exercise info from skillifier failed.", e); } addAdaptiveExercisesFromStub(returnedFromServer, courseStub); returnedFromServer.generateThemes(); return returnedFromServer; } catch (FailedHttpResponseException ex) { return checkForObsoleteClient(ex); } } }); }
Source:
<code>protected void assertEvaluationEquals(String expectedValue) throws Exception { IValue value = getValue(); CStringValue cstrValue = <START> (CStringValue) value; <END> assertEquals(expectedValue, cstrValue.cStringValue()); }</code><technical_language>assertInstance(value, CStringValue.class) first. This way, if is of wrong kind, test fails assertion failure exception</technical_language>

Target:
protected void assertEvaluationEquals(String expectedValue) throws Exception { IValue value = getValue(); assertInstance(value, CStringValue.class); CStringValue cstrValue = (CStringValue) value; assertEquals(expectedValue, cstrValue.cStringValue()); }
Source:
<code><START> protected TimeGraphPresentationProvider getPresentationProvider() { <END> return fPresentation; }</code><technical_language>sense return ITimeGraphPresentationProvider2 instead</technical_language>

Target:
protected ITimeGraphPresentationProvider2 getPresentationProvider() { return fPresentation; }
Source:
<code>public void testUpsertSelectDoesntSeeUpsertedData() throws Exception { String tableName = "TBL_" + generateUniqueName(); String indexName = "IDX_" + generateUniqueName(); String seqName = "SEQ_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(tableName, tableName); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); props.setProperty(QueryServices.MUTATE_BATCH_SIZE_BYTES_ATTRIB, Integer.toString(512)); props.setProperty(QueryServices.SCAN_CACHE_SIZE_ATTRIB, Integer.toString(3)); props.setProperty(QueryServices.SCAN_RESULT_CHUNK_SIZE, Integer.toString(3)); Connection conn = getConnection(props); conn.setAutoCommit(true); conn.createStatement().execute("CREATE SEQUENCE "+seqName); conn.createStatement().execute("CREATE TABLE " + fullTableName + "(pk INTEGER PRIMARY KEY, val INTEGER)"+tableDDLOptions); conn.createStatement().execute("CREATE "+(localIndex? "LOCAL " : "")+"INDEX " + indexName + " ON " + fullTableName + "(val)"); conn.createStatement().execute("UPSERT INTO " + fullTableName + " VALUES (NEXT VALUE FOR " + seqName + ",1)"); <START> PreparedStatement stmt = comm.prepareStatement("UPSERT INTO " + fullTableName + " SELECT NEXT VALUE FOR " + seqName + ", val FROM " + fullTableName); <END> for (int i=0; i<6; i++) { int upsertCount = stmt.executeUpdate(); assertEquals((int)Math.pow(2, i), upsertCount); } conn.close(); }</code><technical_language>incorrect variable name</technical_language>

Target:
public void testUpsertSelectDoesntSeeUpsertedData() throws Exception { String tableName = "TBL_" + generateUniqueName(); String indexName = "IDX_" + generateUniqueName(); String seqName = "SEQ_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(tableName, tableName); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); props.setProperty(QueryServices.MUTATE_BATCH_SIZE_BYTES_ATTRIB, Integer.toString(512)); props.setProperty(QueryServices.SCAN_CACHE_SIZE_ATTRIB, Integer.toString(3)); props.setProperty(QueryServices.SCAN_RESULT_CHUNK_SIZE, Integer.toString(3)); Connection conn = getConnection(props); conn.setAutoCommit(true); Statement stmt = conn.createStatement(); stmt.execute("CREATE SEQUENCE "+seqName); stmt.execute("CREATE TABLE " + fullTableName + "(pk INTEGER PRIMARY KEY, val INTEGER)"+tableDDLOptions); stmt.execute("CREATE "+(localIndex? "LOCAL " : "")+"INDEX " + indexName + " ON " + fullTableName + "(val)"); stmt.execute("UPSERT INTO " + fullTableName + " VALUES (NEXT VALUE FOR " + seqName + ",1)"); String sqlStr = "UPSERT INTO " + fullTableName + " SELECT NEXT VALUE FOR " + seqName + ", val FROM " + fullTableName; PreparedStatement pstmt = conn.prepareStatement(sqlStr); for (int i=0; i<6; i++) { int upsertCount = pstmt.executeUpdate(); assertEquals((int)Math.pow(2, i), upsertCount); } conn.close(); }
Source:
<code>private String getResourceAsString(String resourceName) { StringBuilder resourceContent = new StringBuilder(); InputStream resourceInputStream = getClass().getClassLoader().getResourceAsStream(resourceName); if (resourceInputStream != null) { try { InputStreamReader inR = new InputStreamReader(resourceInputStream); BufferedReader buf = new BufferedReader(inR); String line; while ((line = buf.readLine()) != null) { resourceContent.append(line).append('\n'); } <START> } catch (IOException e) { <END> } finally { try { resourceInputStream.close(); } catch (IOException e) { } } } return resourceContent.toString(); }</code><technical_language>logging</technical_language>

Target:
private String getResourceAsString(String resourceName) { StringBuilder resourceContent = new StringBuilder(); InputStream resourceInputStream = getClass().getClassLoader().getResourceAsStream(resourceName); if (resourceInputStream != null) { try { InputStreamReader inR = new InputStreamReader(resourceInputStream); BufferedReader buf = new BufferedReader(inR); String line; while ((line = buf.readLine()) != null) { resourceContent.append(line).append('\n'); } } catch (IOException ioe) { log.error("Failed to embed resource: " + resourceName, ioe); } finally { try { resourceInputStream.close(); } catch (IOException ioe) { log.error("Failed to close resource: " + resourceName, ioe); } } } return resourceContent.toString(); }
Source:
<code>private void setGutenbergEnabledIfNeeded() { <START> if (AppPrefs.isGutenbergAutoEnabledForTheNewPosts() <END> && !mIsNewPost && !SiteUtils.isBlockEditorDefaultForNewPost(mSite, mAccountStore)) { AppPrefs.setGutenbergDefaultForNewPosts(true); mDispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorAction( new DesignateMobileEditorPayload(mSite, "gutenberg"))); AppPrefs.setGutenbergAutoEnabledForTheNewPosts(false); showGutenbergInformativeDialog(); } }</code><technical_language>Kinda a I part of changeset in this PR but, I find isGutenbergAutoEnabledForTheNewPosts name a bit confusing, especially of tense in Enabled. Reading I thought true if Gutenberg enabled automatically in implementation. change shouldAutoEnableGutenbergForTheNewPosts</technical_language>

Target:
private void setGutenbergEnabledIfNeeded() { if ((TextUtils.isEmpty(mSite.getMobileEditor()) && !mIsNewPost) || AppPrefs.shouldShowGutenbergInfoPopup(mSite.getUrl())) { SiteUtils.enableBlockEditor(mDispatcher, mSite); AnalyticsUtils.trackWithSiteDetails(Stat.EDITOR_GUTENBERG_ENABLED, mSite); showGutenbergInformativeDialog(); } }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CacheRoleImpl cacheRole = (CacheRoleImpl) o; if (mask != cacheRole.mask) return false; if (name != null ? !name.equals(cacheRole.name) : cacheRole.name != null) return false; <START> return permissions != null ? permissions.equals(cacheRole.permissions) : cacheRole.permissions == null; <END> }</code><technical_language>permissions null, constructor throw a NPE</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CacheRoleImpl cacheRole = (CacheRoleImpl) o; if (mask != cacheRole.mask) return false; if (!name.equals(cacheRole.name)) return false; return permissions.equals(cacheRole.permissions); }
Source:
<code><START> public AppInstallStatus checkAndPrepareUpgradeResources(String profileRef) { <END> synchronized (updateLock) { this.profileRef = profileRef; try { instantiateLatestProfile(); if (isUpgradeTableStaged()) { return AppInstallStatus.UpdateStaged; } if (updateIsntNewer(getMasterProfile())) { Logger.log(AndroidLogger.TYPE_RESOURCES, "App Resources up to Date"); upgradeTable.clear(); return AppInstallStatus.UpToDate; } prepareUpgradeResources(); } catch (InstallCancelledException e) { return AppInstallStatus.UnknownFailure; } catch (LocalStorageUnavailableException e) { ResourceInstallUtils.logInstallError(e, "Couldn't install file to local storage|"); return AppInstallStatus.NoLocalStorage; } catch (UnfullfilledRequirementsException e) { if (e.isDuplicateException()) { return AppInstallStatus.DuplicateApp; } else { ResourceInstallUtils.logInstallError(e, "App resources are incompatible with this device|"); return AppInstallStatus.IncompatibleReqs; } } catch (UnresolvedResourceException e) { return ResourceInstallUtils.processUnresolvedResource(e); } return AppInstallStatus.UpdateStaged; } }</code><technical_language>this section a clearer if this method "check" part -- need add another AppInstallStatus called "UpdateNeeded" returned end of try block instead of calling prepareUpgradeResources(). in stageUpdate(), check for return of call checkForUpgrade(), call prepareUpgradeResources() iff returned AppInstallStatus.UpdateNeeded</technical_language>

Target:
public AppInstallStatus checkAndPrepareUpgradeResources(String profileRef) { synchronized (updateLock) { this.profileRef = profileRef; try { instantiateLatestUpgradeProfile(); if (isUpgradeTableStaged()) { return AppInstallStatus.UpdateStaged; } if (updateNotNewer(getMasterProfile())) { Logger.log(AndroidLogger.TYPE_RESOURCES, "App Resources up to Date"); upgradeTable.clear(); return AppInstallStatus.UpToDate; } prepareUpgradeResources(); } catch (InstallCancelledException e) { return AppInstallStatus.UnknownFailure; } catch (LocalStorageUnavailableException e) { ResourceInstallUtils.logInstallError(e, "Couldn't install file to local storage|"); return AppInstallStatus.NoLocalStorage; } catch (UnfullfilledRequirementsException e) { ResourceInstallUtils.logInstallError(e, "App resources are incompatible with this device|"); return AppInstallStatus.IncompatibleReqs; } catch (UnresolvedResourceException e) { return ResourceInstallUtils.processUnresolvedResource(e); } return AppInstallStatus.UpdateStaged; } }
Source:
<code>public void completeTaskCmdExecutorTest() { Map<String, Object> variables = new HashMap<>(); CompleteTaskCmd completeTaskCmd = new CompleteTaskCmd("taskId", variables); <START> assertThat(completeTaskCmdExecutor).isNotNull(); <END> assertThat(completeTaskCmdExecutor.getHandledType()).isEqualTo(CompleteTaskCmd.class); completeTaskCmdExecutor.execute(completeTaskCmd); verify(processEngine).completeTask(completeTaskCmd); verify(commandResults).send(ArgumentMatchers.<Message<CompleteTaskResults>>any()); }</code><technical_language>removed</technical_language>

Target:
public void completeTaskCmdExecutorTest() { Map<String, Object> variables = new HashMap<>(); CompleteTaskCmd completeTaskCmd = new CompleteTaskCmd("taskId", variables); assertThat(completeTaskCmdExecutor.getHandledType()).isEqualTo(CompleteTaskCmd.class); completeTaskCmdExecutor.execute(completeTaskCmd); verify(processEngine).completeTask(completeTaskCmd); verify(commandResults).send(ArgumentMatchers.<Message<CompleteTaskResults>>any()); }
Source:
<code><START> private static void addUpgradeHeader(HttpRequestHeader httpRequestHeader){ <END> httpRequestHeader.addHeader(UPGRADE_HEADER,UPGRADE_PARAMETER); }</code><technical_language>Others public, this public others private</technical_language>

Target:
public static void addUpgradeHeader(HttpRequestHeader httpRequestHeader){ httpRequestHeader.addHeader(UPGRADE_HEADER,UPGRADE_PARAMETER); }
Source:
<code><START> private CinderDisk getInitialCinderVolumeToDelete(DiskImage cinderVolume) { <END> CinderDisk cinderVolumeToRemove = null; List<DiskImage> snapshotsForParent = getDiskImageDao().getAllSnapshotsForParent(cinderVolume.getParentId()); for (DiskImage diskImage : snapshotsForParent) { if (!diskImage.getImageId().equals(cinderVolume.getImageId())) { cinderVolumeToRemove = (CinderDisk) diskImage; break; } } return cinderVolumeToRemove; }</code><technical_language>please add java-doc explain logic for extracting volume</technical_language>

Target:
private CinderDisk getInitialCinderVolumeToDelete(DiskImage cinderVolume) { List<DiskImage> snapshotsForParent = getDiskImageDao().getAllSnapshotsForParent(cinderVolume.getParentId()); CinderDisk cinderVolumeToRemove = (CinderDisk) snapshotsForParent.stream().findFirst().filter( diskImage -> !diskImage.getImageId().equals(cinderVolume.getImageId())).get(); return cinderVolumeToRemove; }
Source:
<code>public void showHtmlForm(Model model, HttpSession httpSession, @ModelAttribute("htmlForm") HtmlForm htmlForm) { HtmlForm hf = (HtmlForm) model.asMap().get("htmlForm"); if (hf.getId() == null) { model.addAttribute("previewHtml", ""); } else { try { Patient demo = HtmlFormEntryUtil.getFakePerson(); FormEntrySession fes = new FormEntrySession(demo, hf.getXmlData(), httpSession); String html = fes.getHtmlToDisplay(); FormEntryContext formEntryContext = fes.getContext(); if (fes.getFieldAccessorJavascript() != null) { html += "<script>" + fes.getFieldAccessorJavascript() + "</script>"; } if (!formEntryContext.getInvalidObsGroupConceptIds().isEmpty()) { model.addAttribute("invalidObsGroupConceptIds", formEntryContext.getInvalidObsGroupConceptIds()); } if (!formEntryContext.getInvalidSetMemberConceptIds().isEmpty()) { model.addAttribute("invalidSetMemberConceptIds", formEntryContext.getInvalidSetMemberConceptIds()); } <START> model.addAttribute("previewHtml", html); <END> } catch (Exception ex) { log.warn("Error rendering html form", ex); model.addAttribute("previewHtml", "Error! " + ex); } } }</code><technical_language>testing calling saveHtmlForm method</technical_language>

Target:
public void showHtmlForm(Model model, HttpSession httpSession, @ModelAttribute("htmlForm") HtmlForm htmlForm) { HtmlForm hf = (HtmlForm) model.asMap().get("htmlForm"); if (hf.getId() == null) { model.addAttribute("previewHtml", ""); } else { try { Patient demo = HtmlFormEntryUtil.getFakePerson(); FormEntrySession fes = new FormEntrySession(demo, hf.getXmlData(), httpSession); String html = fes.getHtmlToDisplay(); if (fes.getFieldAccessorJavascript() != null) { html += "<script>" + fes.getFieldAccessorJavascript() + "</script>"; } model.addAttribute("previewHtml", html); } catch (Exception ex) { log.warn("Error rendering html form", ex); model.addAttribute("previewHtml", "Error! " + ex); } } }
Source:
<code>private void ensureConnectionState() { while (!Thread.currentThread().isInterrupted() && stopped == false) { boolean connectionEstablished = false; try { connectionManagerLock.lock(); if (reconnectNeeded()) { connectionEstablished = connectionManager.tryToEstablishConnection(); if (connectionEstablished) { waitTillConnectionIsLost(); } } } catch (InterruptedException e) { LOGGER.debug("connect thread was interrupted while waiting", e); <START> Thread.currentThread().interrupt(); <END> return; } finally { connectionManagerLock.unlock(); } if (!connectionEstablished && (!Thread.currentThread().isInterrupted() && stopped == false)) { waitForRetry(); } } }</code><technical_language>do call interrupt() a interrupted thread here</technical_language>

Target:
private void ensureConnectionState() { while (!Thread.currentThread().isInterrupted() && !stopped) { boolean connectionEstablished = false; try { connectionManagerLock.lock(); if (reconnectNeeded()) { connectionEstablished = connectionManager.tryToEstablishConnection(); if (connectionEstablished) { waitTillConnectionIsLost(); } } } catch (InterruptedException e) { LOGGER.debug("connect thread was interrupted while waiting", e); Thread.currentThread().interrupt(); return; } finally { connectionManagerLock.unlock(); } if (!connectionEstablished && (!Thread.currentThread().isInterrupted() && !stopped)) { waitForRetry(); } } }
Source:
<code>private Object valueOf( IndexEntryUpdate<SchemaIndexDescriptor> update ) { <START> return update.values()[0]; <END> }</code><technical_language>method return type Value, is more specific Object</technical_language>

Target:
private Value valueOf( IndexEntryUpdate<SchemaIndexDescriptor> update ) { return update.values()[0]; }
Source:
<code>private void extractSubjectConfirmation(Map<String, Object> requestContext, AssertionType assertion) { List<SubjectConfirmationDataBean> senderBeans = new ArrayList<>(); List<SubjectConfirmationDataBean> bearBeans = new ArrayList<>(); DateTimeFormatter dateFormat = ISODateTimeFormat.dateTimeParser(); for (SamlSubjectsType samlSubject : assertion.getSamlSubjects()){ String method = samlSubject.getMethod(); SubjectConfirmationDataBean bean = new SubjectConfirmationDataBean(); bean.setAddress(samlSubject.getAddress()); bean.setInResponseTo(samlSubject.getInResponseTo()); bean.setRecipient(samlSubject.getRecipient()); SamlConditionsType subjectCondition = samlSubject.getSubjectCondition(); if (subjectCondition != null) { bean.setNotAfter(dateFormat.parseDateTime(subjectCondition.getNotOnOrAfter())); <START> bean.setNotBefore(dateFormat.parseDateTime(subjectCondition.getNotBefore())); <END> } if (SubjectConfirmation.METHOD_SENDER_VOUCHES.equalsIgnoreCase(method)){ senderBeans.add(bean); } if (SubjectConfirmation.METHOD_BEARER.equalsIgnoreCase(method)){ bearBeans.add(bean); } } requestContext.put(SamlConstants.SUBJECT_SENDER_VOUCHES, senderBeans); requestContext.put(SamlConstants.SUBJECT_BEARER, bearBeans); }</code><technical_language>Check for null for getNotOnOrAfter getNotBefore parsing</technical_language>

Target:
private static void extractSubjectConfirmation(Map<String, Object> requestContext, AssertionType assertion) { List<SAMLSubjectConfirmation> samlSubjectConfirmations = new ArrayList<>(); DateTimeFormatter dateFormat = ISODateTimeFormat.dateTimeParser(); for (SamlSubjectConfirmationType samlSubject : assertion.getSamlSubjectConfirmations()) { SAMLSubjectConfirmation bean = new SAMLSubjectConfirmation(); bean.setMethod(samlSubject.getMethod()); bean.setAddress(samlSubject.getAddress()); bean.setInResponseTo(samlSubject.getInResponseTo()); bean.setRecipient(samlSubject.getRecipient()); SamlConditionsType subjectCondition = samlSubject.getSubjectCondition(); if (subjectCondition != null && subjectCondition.getNotOnOrAfter() != null) { bean.setNotAfter(dateFormat.parseDateTime(subjectCondition.getNotOnOrAfter())); } if (subjectCondition != null && subjectCondition.getNotBefore() != null) { bean.setNotBefore(dateFormat.parseDateTime(subjectCondition.getNotBefore())); } samlSubjectConfirmations.add(bean); } requestContext.put(SamlConstants.SUBJECT_CONFIRMATION, samlSubjectConfirmations); }
Source:
<code>protected void setStatusForException(Exception e) { isError = true; <START> String exceptionMessageForHtml = e.getMessage().replace(Const.EOL, "<br>"); <END> statusToUser.add(new StatusMessage(exceptionMessageForHtml, StatusMessageColor.DANGER)); statusToAdmin = Const.ACTION_RESULT_FAILURE + " : " + exceptionMessageForHtml; }</code><technical_language>extract <br> Const. this, changes ok :+1:</technical_language>

Target:
protected void setStatusForException(Exception e) { isError = true; String exceptionMessageForHtml = e.getMessage().replace(Const.EOL, Const.HTML_BR_TAG); statusToUser.add(new StatusMessage(exceptionMessageForHtml, StatusMessageColor.DANGER)); statusToAdmin = Const.ACTION_RESULT_FAILURE + " : " + exceptionMessageForHtml; }
Source:
<code>public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "{0} starting...", taskId); final AsyncWorkerDataSet[] asyncWorkerDataSets = divideDataSets(); final ExecutorService executorService = Executors.newFixedThreadPool(numWorkerThreads); final Future[] futures = new Future[numWorkerThreads]; LOG.log(Level.INFO, "Initializing {0} worker threads", numWorkerThreads); for (int index = 0; index < numWorkerThreads; index++) { final Injector forkedInjector = injector.forkInjector(); forkedInjector.bindVolatileInstance(DataSet.class, asyncWorkerDataSets[index]); final Worker worker = forkedInjector.getInstance(Worker.class); futures[index] = executorService.submit(new Runnable() { @Override public void run() { worker.initialize(); for (int iteration = 0; iteration < maxIterations; ++iteration) { if (abort.get()) { <START> LOG.log(Level.INFO, "Abort task"); <END> return; } worker.run(); } worker.cleanup(); } }); } for (int index = 0; index < numWorkerThreads; index++) { futures[index].get(); } return null; }</code><technical_language>elaborate this message a bit, specifically is this task aborted? Also, a bit concerned overhead caused. avoid checking iteration</technical_language>

Target:
public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "{0} starting...", taskId); final AsyncWorkerDataSet[] asyncWorkerDataSets = divideDataSets(); final ExecutorService executorService = Executors.newFixedThreadPool(numWorkerThreads); final Future[] futures = new Future[numWorkerThreads]; LOG.log(Level.INFO, "Initializing {0} worker threads", numWorkerThreads); for (int index = 0; index < numWorkerThreads; index++) { final Injector forkedInjector = injector.forkInjector(); forkedInjector.bindVolatileInstance(DataSet.class, asyncWorkerDataSets[index]); final Worker worker = forkedInjector.getInstance(Worker.class); futures[index] = executorService.submit(new Runnable() { @Override public void run() { worker.initialize(); for (int iteration = 0; iteration < maxIterations; ++iteration) { if (aborted) { LOG.log(Level.INFO, "Abort a thread to completely close the task"); return; } worker.run(); } worker.cleanup(); } }); } for (int index = 0; index < numWorkerThreads; index++) { futures[index].get(); } return null; }
Source:
<code>protected String getLogFileLocation() { <START> return format("${%s}/data/karaf.out", getRunDir()); <END> }</code><technical_language>Is supposed a $ start of this string</technical_language>

Target:
protected String getLogFileLocation() { return format("{%s}/data/karaf.out", getRunDir()); }
Source:
<code>public GeoCollection(AbstractGeoJsonObject firstGeoObject, AbstractGeoJsonObject... additionalGeoObjects) { super( TYPE ); Contracts.assertNotNull( firstGeoObject, "firstPoint" ); <START> Contracts.assertNotNull( additionalGeoObjects, "additionalPoints" ); <END> this.geometries = new ArrayList<>( Arrays.asList( ArrayHelper.concat( firstGeoObject, additionalGeoObjects ) ) ); }</code><technical_language>parameter names changed in 2 calls above</technical_language>

Target:
public GeoCollection(AbstractGeoJsonObject firstGeoObject, AbstractGeoJsonObject... additionalGeoObjects) { super( TYPE ); Contracts.assertNotNull( firstGeoObject, "firstGeoObject" ); Contracts.assertNotNull( additionalGeoObjects, "additionalGeoObjects" ); this.geometries = new ArrayList<>( Arrays.asList( ArrayHelper.concat( firstGeoObject, additionalGeoObjects ) ) ); }
Source:
<code>public static void cleanUp() { fLogger.removeAllAppenders(); fFileLocation.delete(); <START> tearDown(); <END> }</code><technical_language>here, move code</technical_language>

Target:
public static void cleanUp() { fLogger.removeAllAppenders(); fFileLocation.delete(); fBot.closeAllEditors(); SWTBotUtils.deleteProject(PROJECT_NAME, fBot); SWTBotUtils.closeViewById(ColorsView.ID, fBot); }
Source:
<code>private void initMembers(){ executedUpdatedMetadataForStoragePool = new HashMap<Guid, Map<Guid, KeyValuePairCompat<String, List<Guid>>>>(); executedRemovedIds = new HashMap<Guid, List<Guid>>(); executedUpdatedOvfGenerationIdsInDb = new HashMap<Guid, Map<Guid, Long>>(); vms = new HashMap<Guid, VM>(); templates = new HashMap<Guid, VmTemplate>(); executedUpdatedMetadataForStoragePool.put(pool1.getId(), new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>()); executedUpdatedMetadataForStoragePool.put(pool2.getId(), new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>()); executedUpdatedMetadataForStoragePool.put(pool3.getId(), new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>()); executedRemovedIds.put(pool1.getId(), new LinkedList<Guid>()); executedRemovedIds.put(pool2.getId(), new LinkedList<Guid>()); executedRemovedIds.put(pool3.getId(), new LinkedList<Guid>()); executedUpdatedOvfGenerationIdsInDb.put(pool1.getId(), new HashMap<Guid, Long>()); executedUpdatedOvfGenerationIdsInDb.put(pool2.getId(), new HashMap<Guid, Long>()); <START> executedUpdatedOvfGenerationIdsInDb.put(pool3.getId(), new HashMap<Guid, Long>()); <END> }</code><technical_language>Instead of copy-pasting line 3 times 3 pools, a for loop</technical_language>

Target:
private void initMembers() { executedUpdatedMetadataForStoragePool = new HashMap<Guid, Map<Guid, KeyValuePairCompat<String, List<Guid>>>>(); executedRemovedIds = new HashMap<Guid, List<Guid>>(); executedUpdatedOvfGenerationIdsInDb = new HashMap<Guid, Map<Guid, Long>>(); vms = new HashMap<Guid, VM>(); templates = new HashMap<Guid, VmTemplate>(); pool1 = new storage_pool("first sp", Guid.NewGuid(), "storage_pool1", StorageType.NFS.getValue(), StoragePoolStatus.Up.getValue()); pool2 = new storage_pool("second sp", Guid.NewGuid(), "storage_pool2", StorageType.NFS.getValue(), StoragePoolStatus.Up.getValue()); pool3 = new storage_pool("third sp", Guid.NewGuid(), "storage_pool3", StorageType.NFS.getValue(), StoragePoolStatus.Maintanance.getValue()); performStoragePoolInitOps(pool1); performStoragePoolInitOps(pool2); performStoragePoolInitOps(pool3); }
Source:
<code><START> public static MergeOptions createFromRequest(List<RenderedImage> imageStack, int dx, int dy, int margin, <END> GetLegendGraphicRequest req, boolean forceLabelsOn, boolean forceLabelsOff) { return new LegendMerger.MergeOptions(imageStack, dx, dy, margin, LegendUtils.getBackgroundColor(req), req.isTransparent(), LegendUtils.isFontAntiAliasing(req), LegendUtils.getLayout(req), LegendUtils.getRowWidth(req), LegendUtils.getRows(req), LegendUtils.getColumnHeight(req), LegendUtils.getColumns(req), LegendUtils.getLabelFont(req), forceLabelsOn, forceLabelsOff); }</code><technical_language>want create a constructor this signature? constructor call "this" ..</technical_language>

Target:
public static MergeOptions createFromRequest(List<RenderedImage> imageStack, int dx, int dy, int margin, GetLegendGraphicRequest req, boolean forceLabelsOn, boolean forceLabelsOff) { return new LegendMerger.MergeOptions(imageStack, dx, dy, margin, req, forceLabelsOn, forceLabelsOff); }
Source:
<code>private Network getOrCreateNetwork(GoogleComputeEngineTemplateOptions templateOptions, String sharedResourceName) { String networkName = templateOptions.getNetworkName().isPresent() ? templateOptions.getNetworkName().get() : sharedResourceName; Network network = api.getNetworkApiForProject(userProject.get()).get(networkName); if (network != null) { return network; } <START> checkArgument(!templateOptions.getNetwork().isPresent(), "requested network %s does not exist", <END> templateOptions.getNetwork().orNull()); AtomicReference<Operation> operation = new AtomicReference<Operation>(api.getNetworkApiForProject(userProject .get()).createInIPv4Range(sharedResourceName, DEFAULT_INTERNAL_NETWORK_RANGE)); retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval, MILLISECONDS).apply(operation); checkState(!operation.get().getHttpError().isPresent(),"Could not create network, operation failed" + operation); return checkNotNull(api.getNetworkApiForProject(userProject.get()).get(sharedResourceName), "no network with name %s was found", sharedResourceName); }</code><technical_language>Erm...or that, ;-) // TODO: Find A Champion!!</technical_language>

Target:
private Network getOrCreateNetwork(GoogleComputeEngineTemplateOptions templateOptions, String sharedResourceName) { String networkName = templateOptions.getNetworkName().or(sharedResourceName); Network network = api.getNetworkApiForProject(userProject.get()).get(networkName); if (network != null) { return network; } else if (templateOptions.getNetwork().isPresent()) { throw new IllegalArgumentException("requested network " + networkName + " does not exist"); } AtomicReference<Operation> operation = new AtomicReference<Operation>(api.getNetworkApiForProject(userProject .get()).createInIPv4Range(sharedResourceName, DEFAULT_INTERNAL_NETWORK_RANGE)); retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval, MILLISECONDS).apply(operation); checkState(!operation.get().getHttpError().isPresent(),"Could not create network, operation failed" + operation); return checkNotNull(api.getNetworkApiForProject(userProject.get()).get(sharedResourceName), "no network with name %s was found", sharedResourceName); }
Source:
<code>public static void setup() throws IOException { final Configuration conf = new Configuration(); <START> conf.set(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES, SnapshotCodecV2.class.getName()); <END> conf.set(TxConstants.Manager.CFG_TX_SNAPSHOT_DIR, tmpFolder.newFolder().getAbsolutePath()); Injector injector = Guice.createInjector( new ConfigModule(conf), new DiscoveryModules().getInMemoryModules(), Modules.override( new TransactionModules().getInMemoryModules()).with(new AbstractModule() { @Override protected void configure() { TransactionManager txManager = new TransactionManager(conf); txManager.startAndWait(); bind(TransactionManager.class).toInstance(txManager); bind(TransactionSystemClient.class).to(DummyTxClient.class).in(Singleton.class); } })); txClient = (DummyTxClient) injector.getInstance(TransactionSystemClient.class); }</code><technical_language>SnapshotCodecV4 is latest. explicitly testing upgrade of formats</technical_language>

Target:
public static void setup() throws IOException { final Configuration conf = new Configuration(); conf.set(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES, SnapshotCodecV4.class.getName()); conf.set(TxConstants.Manager.CFG_TX_SNAPSHOT_DIR, tmpFolder.newFolder().getAbsolutePath()); Injector injector = Guice.createInjector( new ConfigModule(conf), new DiscoveryModules().getInMemoryModules(), Modules.override( new TransactionModules().getInMemoryModules()).with(new AbstractModule() { @Override protected void configure() { TransactionManager txManager = new TransactionManager(conf); txManager.startAndWait(); bind(TransactionManager.class).toInstance(txManager); bind(TransactionSystemClient.class).to(DummyTxClient.class).in(Singleton.class); } })); txClient = (DummyTxClient) injector.getInstance(TransactionSystemClient.class); }
Source:
<code>private Symbol[] loadSymbolsBySection(Section section) throws IOException { int numSyms = 1; if (section.sh_entsize != 0) { numSyms = (int) section.sh_size / (int) section.sh_entsize; } section.makeSureNotCompressed(); ArrayList<Symbol> symList = new ArrayList<>(numSyms); ElfSectionIterator elfIterator = symbolIterator(section); while (elfIterator.hasNext()) { Symbol symbol = elfIterator.next(); if (symbol.st_info == 0) continue; symList.add(symbol); } <START> elfIterator.close(); <END> Symbol[] results = symList.toArray(new Symbol[0]); Arrays.sort(results); return results; }</code><technical_language>try-with-resources leak in case of IOException</technical_language>

Target:
private Symbol[] loadSymbolsBySection(Section section) throws IOException { int numSyms = 1; if (section.sh_entsize != 0) { numSyms = (int) section.sh_size / (int) section.sh_entsize; } section.makeSureNotCompressed(); ArrayList<Symbol> symList = new ArrayList<>(numSyms); try (ElfSectionIterator elfIterator = symbolIterator(section)) { while (elfIterator.hasNext()) { Symbol symbol = elfIterator.next(); if (symbol.st_info == 0) continue; symList.add(symbol); } } Symbol[] results = symList.toArray(new Symbol[0]); Arrays.sort(results); return results; }
Source:
<code>protected void delete(EncounterProvider delegate, String reason, RequestContext context) throws ResponseException { <START> throw new ResourceDoesNotSupportOperationException(); <END> }</code><technical_language>I delete call delegate.getEncounter().removeProvider(delegate.getEncounterRole(),delegate.getProvider()); void EncounterProvider</technical_language>

Target:
protected void delete(EncounterProvider delegate, String reason, RequestContext context) throws ResponseException { delegate.getEncounter().removeProvider(delegate.getEncounterRole(), delegate.getProvider()); }
Source:
<code>public void testNewThreadSweepsNewTable() { int otherThreadIndex = THREAD_INDEX + 1; setProgress(ImmutableSweepProgress.builder() .tableRef(TABLE_REF) .staleValuesDeleted(3) .cellTsPairsExamined(11) .minimumSweptTimestamp(4567L) .startRow(new byte[] {1, 2, 3}) .startColumn(PtBytes.toBytes("unused")) .timeInMillis(10L) .startTimeInMillis(20L) .build()); setNoProgress(otherThreadIndex); setupTaskRunner(OTHER_TABLE, ImmutableSweepResults.builder() .staleValuesDeleted(2) .cellTsPairsExamined(10) .minSweptTimestamp(12345L) .nextStartRow(Optional.of(new byte[] {4, 5, 6})) .timeInMillis(20L) .timeSweepStarted(50L) .build()); <START> setNextTableToSweep(OTHER_TABLE); <END> BackgroundSweepThread otherThread = getBackgroundSweepThread(otherThreadIndex); otherThread.runOnce(); Mockito.verify(progressStore).saveProgress(eq(otherThreadIndex), eq(ImmutableSweepProgress.builder() .tableRef(OTHER_TABLE) .staleValuesDeleted(2) .cellTsPairsExamined(10) .minimumSweptTimestamp(12345L) .startRow(new byte[] {4, 5, 6}) .startColumn(PtBytes.toBytes("unused")) .timeInMillis(20L) .startTimeInMillis(50L) .build())); }</code><technical_language>A unclear code this test is covering, cross thread lock contention mocked skipped here</technical_language>

Target:
public void testNewThreadSweepsNewTable() { int otherThreadIndex = THREAD_INDEX + 1; setProgress(ImmutableSweepProgress.builder() .tableRef(TABLE_REF) .staleValuesDeleted(3) .cellTsPairsExamined(11) .minimumSweptTimestamp(4567L) .startRow(new byte[] {1, 2, 3}) .startColumn(PtBytes.toBytes("unused")) .timeInMillis(10L) .startTimeInMillis(20L) .build()); setNoProgress(OTHER_TABLE); setupTaskRunner(OTHER_TABLE, ImmutableSweepResults.builder() .staleValuesDeleted(2) .cellTsPairsExamined(10) .minSweptTimestamp(12345L) .nextStartRow(Optional.of(new byte[] {4, 5, 6})) .timeInMillis(20L) .timeSweepStarted(50L) .build()); setNextTableToSweep(OTHER_TABLE); BackgroundSweepThread otherThread = getBackgroundSweepThread(otherThreadIndex); otherThread.runOnce(); Mockito.verify(progressStore).saveProgress( eq(ImmutableSweepProgress.builder() .tableRef(OTHER_TABLE) .staleValuesDeleted(2) .cellTsPairsExamined(10) .minimumSweptTimestamp(12345L) .startRow(new byte[] {4, 5, 6}) .startColumn(PtBytes.toBytes("unused")) .timeInMillis(20L) .startTimeInMillis(50L) .build())); }
Source:
<code>public TimeSeriesValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); <START> TimeSeriesValue<V> kv = new TimeSeriesValue<>(next.getValue(), next.getKey().getTimestamp()); <END> return kv; }</code><technical_language>Minor: 'return new TimeSeriesValue...'</technical_language>

Target:
public TimestampedValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); return new TimestampedValue<>(next.getValue(), next.getKey().getTimestamp()); }