auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static List<StartIdentifiedAtlasDbTransactionResponse> getStartTransactionResponses( <START> LockLeaseService lockLeaseService, LockWatchEventCache lockWatchEventCache, int numberOfTransactions) { <END> List<StartIdentifiedAtlasDbTransactionResponse> result = new ArrayList<>(); while (result.size() < numberOfTransactions) { StartTransactionResponseV5 response = lockLeaseService.startTransactionsWithWatches( lockWatchEventCache.lastKnownVersion().version(), numberOfTransactions - result.size()); lockWatchEventCache.processStartTransactionsUpdate( response.timestamps().stream().boxed().collect(Collectors.toSet()), response.lockWatchUpdate()); result.addAll(split(response)); } return result; }</code><technical_language>suggestion LockLeaseService lockLeaseService, LockWatchEventCache lockWatchEventCache, int numberOfTransactions) {</technical_language>

Target:
private static List<StartIdentifiedAtlasDbTransactionResponse> getStartTransactionResponses( LockLeaseService lockLeaseService, LockWatchEventCache lockWatchEventCache, int numberOfTransactions) { List<StartIdentifiedAtlasDbTransactionResponse> result = new ArrayList<>(); while (result.size() < numberOfTransactions) { ConjureStartTransactionsResponse response = lockLeaseService.startTransactionsWithWatches( lockWatchEventCache.lastKnownVersion().version(), numberOfTransactions - result.size()); lockWatchEventCache.processStartTransactionsUpdate( response.getTimestamps().stream().boxed().collect(Collectors.toSet()), response.getLockWatchUpdate()); result.addAll(split(response)); } return result; }
Source:
<code>public void createTopic(Topic topic) { <START> if (Topic.ContentType.AVRO == topic.getContentType() || !isNullOrEmpty(topic.getMessageSchema())) { <END> schemaValidatorProvider.provide(topic.getContentType()).check(topic.getMessageSchema()); } topicRepository.createTopic(topic); try { multiDCAwareService.manageTopic(brokerTopicManagement -> brokerTopicManagement.createTopic(topic.getName(), topic.getRetentionTime()) ); } catch (Exception exception) { logger.error( String.format("Could not create topic %s, rollback topic creation.", topic.getQualifiedName()), exception ); topicRepository.removeTopic(topic.getName()); } }</code><technical_language>explicitly ask Topic if validated..</technical_language>

Target:
public void createTopic(Topic topic) { if (topic.isSchemaValidationRequired()) { schemaValidatorProvider.provide(topic.getContentType()).check(topic.getMessageSchema()); } topicRepository.createTopic(topic); try { multiDCAwareService.manageTopic(brokerTopicManagement -> brokerTopicManagement.createTopic(topic.getName(), topic.getRetentionTime()) ); } catch (Exception exception) { logger.error( String.format("Could not create topic %s, rollback topic creation.", topic.getQualifiedName()), exception ); topicRepository.removeTopic(topic.getName()); } }
Source:
<code>public HierarchyElementView(Context context, HierarchyElement it) { super(context); RelativeLayout layout = (RelativeLayout)inflate(context, R.layout.hierarchy_element_view, null); setBackgroundColor(it.getBgColor()); mPrimaryTextView = ((TextView)layout.findViewById(R.id.hev_primary_text)); mPrimaryTextView.setText(it.getPrimaryText()); mPrimaryTextView.setTextColor(it.getTextColor()); mSecondaryTextView = ((TextView)layout.findViewById(R.id.hev_secondary_text)); <START> mSecondaryTextView.setText(it.getSecondaryText()); <END> mSecondaryTextView.setTextColor(it.getTextColor()); mIcon = ((ImageView)layout.findViewById(R.id.hev_icon)); mIcon.setImageDrawable(it.getIcon()); addView(layout); }</code><technical_language>this (and above) setPrimaryText() setTextcolor() respectively</technical_language>

Target:
public HierarchyElementView(Context context, HierarchyElement it) { super(context); RelativeLayout layout = (RelativeLayout)inflate(context, R.layout.hierarchy_element_view, null); mPrimaryTextView = ((TextView)layout.findViewById(R.id.hev_primary_text)); mSecondaryTextView = ((TextView)layout.findViewById(R.id.hev_secondary_text)); mIcon = ((ImageView)layout.findViewById(R.id.hev_icon)); setFromHierarchyElement(it); addView(layout); }
Source:
<code>public void testServerSpanWithURL() throws RetryAttemptException { SpanCache spanCacheMock = Mockito.mock(SpanCache.class); NodeDetailsDeriver nodeDetailsDeriver = new NodeDetailsDeriver(spanCacheMock); Annotation sr = new Annotation(); sr.setValue("sr"); sr.setTimestamp(0); Annotation ss = new Annotation(); ss.setTimestamp(1000); ss.setValue("ss"); BinaryAnnotation httpAddress = new BinaryAnnotation(); httpAddress.setKey(Constants.ZIPKIN_BIN_ANNOTATION_HTTP_URL); httpAddress.setValue("http://localhost/hello"); Span serverSpan = new Span(Arrays.asList(httpAddress), Arrays.asList(sr, ss)); serverSpan.setId("2"); serverSpan.setTraceId("1"); serverSpan.setTimestamp(0L); <START> serverSpan.setDuration(ss.getTimestamp() - sr.getTimestamp()); <END> NodeDetails result = nodeDetailsDeriver.processOneToOne(null, serverSpan); assertEquals("/hello", result.getUri()); }</code><technical_language>please remove this(and timestamp too) if is objective of this test</technical_language>

Target:
public void testServerSpanWithURL() throws RetryAttemptException { SpanCache spanCacheMock = Mockito.mock(SpanCache.class); NodeDetailsDeriver nodeDetailsDeriver = new NodeDetailsDeriver(spanCacheMock); Annotation sr = new Annotation(); sr.setValue("sr"); Annotation ss = new Annotation(); ss.setValue("ss"); BinaryAnnotation httpAddress = new BinaryAnnotation(); httpAddress.setKey(Constants.ZIPKIN_BIN_ANNOTATION_HTTP_URL); httpAddress.setValue("http://localhost/hello"); Span serverSpan = new Span(Arrays.asList(httpAddress), Arrays.asList(sr, ss)); serverSpan.setId("2"); serverSpan.setTraceId("1"); NodeDetails result = nodeDetailsDeriver.processOneToOne(null, serverSpan); assertEquals("/hello", result.getUri()); }
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (ServletException ex) { <START> LogFactory.getLog(PNGGenarateServlet.class).error("Unable to process GET request", ex); <END> } }</code><technical_language>define a log object for this</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (ServletException ex) { log.error("Unable to process GET request", ex); } }
Source:
<code>private Info getInfo() { Info info = new Info(); info.setTitle("KIE-Server API"); <START> info.setVersion("7.8.0"); <END> return info; }</code><technical_language>remove version completely</technical_language>

Target:
private Info getInfo() { Info info = new Info(); info.setVersion("7.0"); return info; }
Source:
<code>public void cancelRequest(ImageView view) { if (view == null) { <START> throw new AssertionError("view cannot be null."); <END> } cancelExistingRequest(view); }</code><technical_language>pretty IllegalArgumentException for else</technical_language>

Target:
public void cancelRequest(ImageView view) { if (view == null) { throw new IllegalArgumentException("view cannot be null."); } cancelExistingRequest(view); }
Source:
<code><START> public void setValue(CharSequence value) { <END> setValue(value, 0, value.length()); }</code><technical_language>I suggest this check, a more specific error message</technical_language>

Target:
public void setValue(CharSequence value) { Validate.notNull(value); setValue(value, 0, value.length()); }
Source:
<code>private static ListenableFuture<?> firstFinishedFuture(List<ListenableFuture<?>> futures) { <START> if (futures.size() == 1) { <END> return futures.get(0); } SettableFuture<?> result = SettableFuture.create(); ExecutorService executor = newDirectExecutorService(); for (ListenableFuture<?> future : futures) { future.addListener(() -> result.set(null), executor); } return result; }</code><technical_language>This function appears duplicate of whenAnyComplete in airlift MoreFutures. instead</technical_language>

Target:
private static ListenableFuture<?> firstFinishedFuture(List<ListenableFuture<?>> futures) { SettableFuture<?> result = SettableFuture.create(); ExecutorService executor = newDirectExecutorService(); for (ListenableFuture<?> future : futures) { future.addListener(() -> result.set(null), executor); } return result; }
Source:
<code>static Set<Long> longEntityNamespaces(UpdateOptions updateOptions) { if (updateOptions.entityNamespaces() == null) return DEFAULT_ENTITY_NAMESPACES; return <START> splitByComma(Collections.singletonList(updateOptions.entityNamespaces())) <END> .stream() .map(Long::parseLong) .collect(toImmutableSet()); }</code><technical_language>static import</technical_language>

Target:
static Set<Long> longEntityNamespaces(UpdateOptions updateOptions) { if (updateOptions.entityNamespaces() == null) return DEFAULT_ENTITY_NAMESPACES; return splitByComma(singletonList(updateOptions.entityNamespaces())) .stream() .map(Long::parseLong) .collect(toImmutableSet()); }
Source:
<code>private void onMessage(StreamMessage message, Observer<StreamMessage> emitter) { Qualifier qualifier = Qualifier.fromString(message.qualifier()); if (Qualifier.Q_ON_COMPLETED.asString().equalsIgnoreCase(qualifier.asString())) { emitter.onCompleted(); <START> System.err.println("onCompleted" + message); <END> return; } if (Qualifier.Q_ERROR_NAMESPACE.equalsIgnoreCase(qualifier.getNamespace())) { emitter.onError(exceptionMapper.toException(qualifier, message.data())); System.err.println("onError" + message); return; } emitter.onNext(message); System.err.println("onNext" + message); }</code><technical_language>println here</technical_language>

Target:
private void onMessage(StreamMessage message, Observer<StreamMessage> emitter) { Qualifier qualifier = Qualifier.fromString(message.qualifier()); if (Qualifier.Q_ON_COMPLETED.asString().equalsIgnoreCase(qualifier.asString())) { emitter.onCompleted(); return; } if (Qualifier.Q_ERROR_NAMESPACE.equalsIgnoreCase(qualifier.getNamespace())) { emitter.onError(exceptionMapper.toException(qualifier, message.data())); return; } emitter.onNext(message); }
Source:
<code>public StyledString getStyledText(Object element) { String rawText = getText(element); if (element.getClass().equals(GitModelCommit.class)) { GitModelCommit commit = (GitModelCommit) element; StyledString string = new StyledString(rawText); String commitId = commit.getRemoteCommit().getName(); <START> String format = " [" + commitId.substring(0, 6) + "]"; END> string.append(format, StyledString.DECORATIONS_STYLER); return string; } return new StyledString(rawText); }</code><technical_language>AbbreviatedObjectId ensure abbreviated IDs unique repo</technical_language>

Target:
public StyledString getStyledText(Object element) { String rawText = getText(element); if (element.getClass().equals(GitModelCommit.class)) { StyledString string = new StyledString(rawText); GitModelCommit commit = (GitModelCommit) element; String format = " [" + getAbbreviatedId(commit) + "]"; string.append(format, StyledString.DECORATIONS_STYLER); return string; } return new StyledString(rawText); }
Source:
<code>public void testSerdeMetadataStorageTablesConfig() throws Exception { Injector injector = Guice.createInjector(new TestTableModule()); ObjectMapper mapper = injector.getInstance(ObjectMapper.class); Properties props = injector.getInstance(Properties.class); MetadataStorageTablesConfig config = injector.getInstance(MetadataStorageTablesConfig.class); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.base"), config.getBase()); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.segments"), config.getSegmentsTable()); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.rules"), config.getRulesTable()); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.config"), config.getConfigTable()); Assert.assertEquals( props.getProperty("druid.metadata.storage.tables.tasks"), config.getEntryTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE) ); Assert.assertEquals( props.getProperty("druid.metadata.storage.tables.taskLog"), config.getLogTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE) ); Assert.assertEquals( props.getProperty("druid.metadata.storage.tables.taskLock"), config.getLockTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE) ); <START> Assert.assertEquals( <END> "{\"base\":\"druid\",\"segments\":\"aaa_segments\",\"rules\":\"bbb_rules\",\"config\":\"ccc_config\",\"tasks\":\"ddd_tasks\",\"taskLog\":\"eee_tasklog\",\"taskLock\":\"fff_tasklock\",\"audit\":\"ggg_audit\"}", mapper.writeValueAsString(config) ); }</code><technical_language>this check is fragile, individual asserts good enough</technical_language>

Target:
public void testSerdeMetadataStorageTablesConfig() throws Exception { Injector injector = Guice.createInjector( new Module() { @Override public void configure(Binder binder) { binder.install(new PropertiesModule(Arrays.asList("test.runtime.properties"))); binder.install(new ConfigModule()); binder.install(new DruidGuiceExtensions()); JsonConfigProvider.bind(binder, "druid.metadata.storage.tables", MetadataStorageTablesConfig.class); } @Provides @LazySingleton public ObjectMapper jsonMapper() { return new DefaultObjectMapper(); } } ); Properties props = injector.getInstance(Properties.class); MetadataStorageTablesConfig config = injector.getInstance(MetadataStorageTablesConfig.class); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.base"), config.getBase()); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.segments"), config.getSegmentsTable()); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.rules"), config.getRulesTable()); Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.config"), config.getConfigTable()); Assert.assertEquals( props.getProperty("druid.metadata.storage.tables.tasks"), config.getEntryTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE) ); Assert.assertEquals( props.getProperty("druid.metadata.storage.tables.taskLog"), config.getLogTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE) ); Assert.assertEquals( props.getProperty("druid.metadata.storage.tables.taskLock"), config.getLockTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE) ); }
Source:
<code>public static void registerFluid(Fluid fluid, String name) { <START> name = name.toLowerCase(); <END> if (FLUID_TO_NAMES.containsKey(fluid)) { FLUID_TO_NAMES.get(fluid).add(name); } else { FLUID_TO_NAMES.put(fluid, NonNullList.<String>withSize(1, name)); } if (NAME_TO_FLUIDS.containsKey(name)) { NAME_TO_FLUIDS.get(name).add(fluid); } else { NAME_TO_FLUIDS.put(name, NonNullList.<Fluid>withSize(1, fluid)); } }</code><technical_language>com.google.common.base.Preconditions#checkArgument top of method fluid is in fluid registry first, prevent some confusion</technical_language>

Target:
public static void registerFluid(Fluid fluid, String name) { Preconditions.checkArgument(ForgeRegistries.FLUIDS.containsValue(fluid), "Cannot register FluidDictionary entry for unregistered fluid %s", fluid); name = name.toLowerCase(Locale.ENGLISH); if (FLUID_TO_NAMES.containsKey(fluid)) { FLUID_TO_NAMES.get(fluid).add(name); } else { FLUID_TO_NAMES.put(fluid, NonNullList.<String>withSize(1, name)); } if (NAME_TO_FLUIDS.containsKey(name)) { NAME_TO_FLUIDS.get(name).add(fluid); } else { NAME_TO_FLUIDS.put(name, NonNullList.<Fluid>withSize(1, fluid)); } }
Source:
<code>public int prepare(final Xid xid) throws XAException { prepareCalled = true; <START> return XAResource.XA_OK; <END> }</code><technical_language>need like: recoveryXids = new Xid[1]; recoveryXids[0] = xid; in here. this class is serializable saved in basic action save_state. forget remove Xid commit is called</technical_language>

Target:
public int prepare(final Xid xid) throws XAException { System.out.println("[" + Thread.currentThread().getName() + "] DummyXAResource XA_PREPARE [" + xid + "]"); File dir = new File("DummyXAResource/"); dir.mkdirs(); file = new File(dir, new Uid().fileStringForm() + "_"); try { file.createNewFile(); final int formatId = xid.getFormatId(); final byte[] gtrid = xid.getGlobalTransactionId(); final int gtrid_length = gtrid.length; final byte[] bqual = xid.getBranchQualifier(); final int bqual_length = bqual.length; DataOutputStream fos = new DataOutputStream(new FileOutputStream(file)); fos.writeInt(formatId); fos.writeInt(gtrid_length); fos.write(gtrid, 0, gtrid_length); fos.writeInt(bqual_length); fos.write(bqual, 0, bqual_length); fos.flush(); fos.close(); } catch (IOException e) { throw new XAException(XAException.XAER_RMERR); } return XA_OK; }
Source:
<code>public static Index setUp(List<Object> fieldNames, String indexName, <START> String indexType, <END> Map<String, String> indexSettings) { if (fieldNames == null || fieldNames.isEmpty()) { logger.log(Level.SEVERE, "No field names were provided."); return null; } if (indexName == null || indexName.isEmpty()) { logger.log(Level.SEVERE, "No index name was provided."); return null; } if (indexType == null || indexType.isEmpty()) { logger.log(Level.SEVERE, "No index type was provided."); return null; } if (!validTypes.contains(indexType.toLowerCase())) { logger.log(Level.SEVERE, String.format("Invalid index type %s.", indexType)); return null; } if (indexType.equalsIgnoreCase(JSON_TYPE) && indexSettings != null) { logger.log(Level.WARNING, String.format("Index type is %s, index settings %s ignored.", indexType, indexSettings.toString())); indexSettings = null; } else if (indexType.equalsIgnoreCase(TEXT_TYPE)) { if (indexSettings == null) { indexSettings = new HashMap<String, String>(); indexSettings.put(TOKENIZE, DEFAULT_TOKENIZER); logger.log(Level.INFO, String.format("Index type is %s, defaulting settings to %s.", indexType, indexSettings.toString())); } else { for (String parameter : indexSettings.keySet()) { if (!validSettings.contains(parameter.toLowerCase())) { String msg = String.format("Invalid parameter %s in index settings %s.", parameter, indexSettings); logger.log(Level.SEVERE, msg); return null; } } } } return new Index(fieldNames, indexName, indexType, indexSettings); }</code><technical_language>I index type enumeration, save some validation code need check if index type is a valid index type</technical_language>

Target:
public static Index setUp(List<Object> fieldNames, String indexName, String indexType, Map<String, String> indexSettings) { if (fieldNames == null || fieldNames.isEmpty()) { logger.log(Level.SEVERE, "No field names were provided."); return null; } if (indexName == null || indexName.isEmpty()) { logger.log(Level.SEVERE, "No index name was provided."); return null; } if (indexType == null || indexType.isEmpty()) { logger.log(Level.SEVERE, "No index type was provided."); return null; } if (!validTypes.contains(indexType.toLowerCase())) { logger.log(Level.SEVERE, String.format("Invalid index type %s.", indexType)); return null; } if (indexType.equalsIgnoreCase(JSON_TYPE) && indexSettings != null) { logger.log(Level.WARNING, String.format("Index type is %s, index settings %s ignored.", indexType, indexSettings.toString())); indexSettings = null; } else if (indexType.equalsIgnoreCase(TEXT_TYPE)) { if (indexSettings == null) { indexSettings = new HashMap<String, String>(); indexSettings.put(TEXT_TOKENIZE, TEXT_DEFAULT_TOKENIZER); logger.log(Level.FINE, String.format("Index type is %s, defaulting settings to %s.", indexType, indexSettings.toString())); } else { for (String parameter : indexSettings.keySet()) { if (!validSettings.contains(parameter.toLowerCase())) { String msg = String.format("Invalid parameter %s in index settings %s.", parameter, indexSettings); logger.log(Level.SEVERE, msg); return null; } } } } return new Index(fieldNames, indexName, indexType, indexSettings); }
Source:
<code>private static Matcher<Object> withProjectName(final Matcher<String> expectedName) { return new BoundedMatcher<Object, ProjectData>(ProjectData.class) { @Override public boolean matchesSafely(final ProjectData actualObject) { <START> return expectedName.matches(actualObject.projectName); <END> } @Override public void describeTo(final Description description) { description.appendText("project name matches"); } }; }</code><technical_language>please rename actualObject actualProjectData</technical_language>

Target:
private static Matcher<Object> withProjectName(final Matcher<String> expectedName) { return new BoundedMatcher<Object, ProjectData>(ProjectData.class) { @Override public boolean matchesSafely(final ProjectData actualProjectData) { return expectedName.matches(actualProjectData.projectName); } @Override public void describeTo(final Description description) { description.appendText("project name matches"); } }; }
Source:
<code>public void blockedUserShouldBeAbleToChangeEmail() { String username = Configuration.getCredentials().emailQaart2; <START> String password = Configuration.getCredentials().emailPasswordQaart2; <END> EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection(); editPrefPage.verifyUserLoggedIn(User.BLOCKED_USER); editPrefPage.openEmailSection(); MailFunctions.deleteAllEmails(username, password); String newEmailAddress = MailFunctions.getEmail(editPrefPage.getEmailAdress()); editPrefPage.changeEmail(newEmailAddress); PreferencesPageObject prefPage = editPrefPage.clickSaveButton(); Assertion.assertTrue(prefPage.getBannerNotifications().isNotificationMessageVisible(), "Notification message is not visible"); prefPage.enterEmailChangeLink(username, password); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress); }</code><technical_language>For future: a User Configuration.getCredentials() function</technical_language>

Target:
public void blockedUserShouldBeAbleToChangeEmail() { String username = Configuration.getCredentials().emailQaart2; String password = Configuration.getCredentials().emailPasswordQaart2; EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection(); editPrefPage.verifyUserLoggedIn(User.BLOCKED_USER); editPrefPage.openEmailSection(); EmailUtils.deleteAllEmails(username, password); String newEmailAddress = EmailUtils.getEmail(editPrefPage.getEmailAdress()); editPrefPage.changeEmail(newEmailAddress); PreferencesPageObject prefPage = editPrefPage.clickSaveButton(); Assertion.assertTrue(prefPage.getBannerNotifications().isNotificationMessageVisible(), "Notification message is not visible"); prefPage.enterEmailChangeLink(username, password); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress); }
Source:
<code>public TimeGraphScale(Composite parent, TimeGraphColorScheme colors, int style) { super(parent, colors, SWT.NO_BACKGROUND | SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED); TmfSignalManager.register(this); addMouseListener(this); addMouseMoveListener(this); TimeDraw.updateTimeZone(); addDisposeListener((e) -> { TmfSignalManager.deregister(TimeGraphScale.this); }); GC gc = new GC(parent.getDisplay()); fDigitWidth = gc.getCharWidth('0'); gc.dispose(); <START> fAlign = style & SWT.TOP | style & SWT.BOTTOM; <END> }</code><technical_language>a default if style is none, both, of these</technical_language>

Target:
public TimeGraphScale(Composite parent, TimeGraphColorScheme colors, int style) { super(parent, colors, SWT.NO_BACKGROUND | SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED); TmfSignalManager.register(this); addMouseListener(this); addMouseMoveListener(this); TimeDraw.updateTimeZone(); addDisposeListener((e) -> { TmfSignalManager.deregister(TimeGraphScale.this); }); GC gc = new GC(parent.getDisplay()); fDigitWidth = gc.getCharWidth('0'); gc.dispose(); int styleMask = SWT.TOP | SWT.BOTTOM; fAlign = (style & styleMask) == 0 ? SWT.BOTTOM : style & styleMask; }
Source:
<code><START> public List<PermissionSubject> getPermissionCheckSubjects() { <END> List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); permissionList.addAll(super.getPermissionCheckSubjects()); permissionList.add(new PermissionSubject( getParameters().getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup())); return permissionList; }</code><technical_language>permissionList private variable, permissionList created</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { if (permissionCheckSubjects == null) { permissionCheckSubjects = new ArrayList<PermissionSubject>(); permissionCheckSubjects.addAll(super.getPermissionCheckSubjects()); permissionCheckSubjects.add(new PermissionSubject( getParameters().getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup())); } return permissionCheckSubjects; }
Source:
<code><START> private <T extends FrameworkMember<T>> void addToAnnotationLists(T member, <END> Map<Class<? extends Annotation>, List<T>> map) { for (Annotation each : member.getAnnotations()) { Class<? extends Annotation> type = each.annotationType(); List<T> members = getAnnotatedMembers(map, type, true); if (member.isShadowedBy(members)) { return; } if (runsTopToBottom(type)) { members.add(0, member); } else { members.add(member); } } }</code><technical_language>change this static non-static? Calling non-static methods in a constructor dangerous. lose guarantees of "final"</technical_language>

Target:
private static <T extends FrameworkMember<T>> void addToAnnotationLists(T member, Map<Class<? extends Annotation>, List<T>> map) { for (Annotation each : member.getAnnotations()) { Class<? extends Annotation> type = each.annotationType(); List<T> members = getAnnotatedMembers(map, type, true); if (member.isShadowedBy(members)) { return; } if (runsTopToBottom(type)) { members.add(0, member); } else { members.add(member); } } }
Source:
<code><START> public ObservationDetails(PricingEnvironment env, OvernightCompoundedRateObservation observation) { <END> this.env = env; index = observation.getIndex(); fixingCalendar = index.getFixingCalendar(); indexFixingDateSeries = env.timeSeries(index); firstFixing = observation.getStartDate(); lastFixingP1 = observation.getEndDate(); lastFixing = fixingCalendar.previous(lastFixingP1); cutoffOffset = observation.getRateCutOffDays() > 1 ? observation.getRateCutOffDays() : 1; accrualFactorCutoff = new double[cutoffOffset-1]; LocalDate currentFixing = lastFixing; for(int i = 0 ; i < cutoffOffset-1; i++) { currentFixing = fixingCalendar.previous(currentFixing); LocalDate effectiveDate = index.calculateEffectiveFromFixing(currentFixing); LocalDate maturityDate = index.calculateMaturityFromEffective(effectiveDate); accrualFactorCutoff[i] = index.getDayCount().yearFraction(effectiveDate, maturityDate); } lastFixingNonCutoff = currentFixing; LocalDate startUnderlyingPeriod = index.calculateEffectiveFromFixing(firstFixing); LocalDate endUnderlyingPeriod = index.calculateMaturityFromEffective(index.calculateEffectiveFromFixing(lastFixing)); accrualFactorTotal = index.getDayCount().yearFraction(startUnderlyingPeriod, endUnderlyingPeriod); }</code><technical_language>methods (including constructor) private</technical_language>

Target:
private ObservationDetails(PricingEnvironment env, OvernightCompoundedRateObservation observation) { this.env = env; index = observation.getIndex(); fixingCalendar = index.getFixingCalendar(); indexFixingDateSeries = env.timeSeries(index); firstFixing = observation.getStartDate(); lastFixingP1 = observation.getEndDate(); lastFixing = fixingCalendar.previous(lastFixingP1); cutoffOffset = Math.max(observation.getRateCutOffDays(), 1); accrualFactorCutoff = new double[cutoffOffset - 1]; LocalDate currentFixing = lastFixing; for (int i = 0; i < cutoffOffset - 1; i++) { currentFixing = fixingCalendar.previous(currentFixing); LocalDate effectiveDate = index.calculateEffectiveFromFixing(currentFixing); LocalDate maturityDate = index.calculateMaturityFromEffective(effectiveDate); accrualFactorCutoff[i] = index.getDayCount().yearFraction(effectiveDate, maturityDate); } lastFixingNonCutoff = currentFixing; LocalDate startUnderlyingPeriod = index.calculateEffectiveFromFixing(firstFixing); LocalDate endUnderlyingPeriod = index.calculateMaturityFromEffective(index.calculateEffectiveFromFixing(lastFixing)); accrualFactorTotal = index.getDayCount().yearFraction(startUnderlyingPeriod, endUnderlyingPeriod); }
Source:
<code>private CommandStatus runWithDocker(final CommandContext context, final CommandRequest request) throws IOException { final Process p = startDockerProcess(context, request); clog.copyStdout(p, System.out); try { p.waitFor(); } catch (InterruptedException e) { throw Throwables.propagate(e); } <START> return SimpleCommandStatus.of(request.getIoDirectory().toString(), p); <END> }</code><technical_language>toString() unnecessary</technical_language>

Target:
private CommandStatus runWithDocker(final CommandContext context, final CommandRequest request) throws IOException { final Process p = startDockerProcess(context, request); clog.copyStdout(p, System.out); try { p.waitFor(); } catch (InterruptedException e) { throw Throwables.propagate(e); } return SimpleCommandStatus.of(p, request.getIoDirectory()); }
Source:
<code>public void hasSameOrderableAs_shouldReturnTrueIfTheConceptsMatchAndHaveSameDrugNonCoded() throws Exception { DrugOrder order = new DrugOrder(); Concept concept = new Concept(); Drug drug1 = new Drug(); drug1.setConcept(concept); <START> order.setDrug(drug1); <END> order.setDrugNonCoded("Chrocine"); DrugOrder otherOrder = new DrugOrder(); otherOrder.setConcept(concept); otherOrder.setDrug(drug1); otherOrder.setDrugNonCoded("chrocine"); assertTrue(order.hasSameOrderableAs(otherOrder)); }</code><technical_language>I thought drug null for a nonCoded order, i setting</technical_language>

Target:
public void hasSameOrderableAs_shouldReturnTrueIfTheConceptsMatchAndHaveSameDrugNonCoded() throws Exception { DrugOrder order = new DrugOrder(); Concept concept = new Concept(); order.setConcept(concept); order.setDrugNonCoded("Chrocine"); DrugOrder otherOrder = new DrugOrder(); otherOrder.setConcept(concept); otherOrder.setDrugNonCoded("chrocine"); assertTrue(order.hasSameOrderableAs(otherOrder)); }
Source:
<code>private void dispatchUploadAction(@NonNull final MediaModel media, @NonNull final SiteModel site) { <START> if (media != null && site != null) { <END> AppLog.i(AppLog.T.MEDIA, "Dispatching upload action for media with local id: " + media.getId() + " and path: " + media.getFilePath()); media.setUploadState(UploadState.UPLOADING.name()); mDispatcher.dispatch(MediaActionBuilder.newUpdateMediaAction(media)); MediaPayload payload = new MediaPayload(site, media); mDispatcher.dispatch(MediaActionBuilder.newUploadMediaAction(payload)); } }</code><technical_language>Adding null checks top of existing @NonNull annotations generates lint warnings. Additionally, leaves lint warnings methods called null checking. In this case, [here](<LINK_0> I remove null checks annotation guide earlier points check for unexpected nulls log (we're handling in straightforward cases)</technical_language>

Target:
private void dispatchUploadAction(@NonNull final MediaModel media, @NonNull final SiteModel site) { AppLog.i(AppLog.T.MEDIA, "Dispatching upload action for media with local id: " + media.getId() + " and path: " + media.getFilePath()); media.setUploadState(UploadState.UPLOADING.name()); mDispatcher.dispatch(MediaActionBuilder.newUpdateMediaAction(media)); MediaPayload payload = new MediaPayload(site, media); mDispatcher.dispatch(MediaActionBuilder.newUploadMediaAction(payload)); }
Source:
<code>static Path resolvePath(Path file, String workingDirectory) { <START> return file == null ? null : (file.isAbsolute() ? file : (file.getFileName().startsWith(File.separator) ? file.toAbsolutePath() : (Paths.get(workingDirectory, <END> file.getFileName().toString())))); }</code><technical_language>works OK, for hard read. I readable return</technical_language>

Target:
static Path resolvePath(Path file, String workingDirectory) { if(file == null){ return null; }else if(file.isAbsolute()){ return file; }else if(file.getFileName().startsWith(File.separator)){ return file.toAbsolutePath(); }else{ return Paths.get(workingDirectory, file.getFileName().toString()); } }
Source:
<code>public void usbSerialDeviceDiscovered(UsbSerialDeviceInformation usbSerialDeviceInformation) { <START> logger.debug("Discovered new usb-serial device: {}", usbSerialDeviceInformation); <END> previouslyDiscovered.add(usbSerialDeviceInformation); for (UsbSerialDiscoveryParticipant participant : discoveryParticipants) { DiscoveryResult result = participant.createResult(usbSerialDeviceInformation); if (result != null) { thingDiscovered(result); } } }</code><technical_language>**USB**-serial</technical_language>

Target:
public void usbSerialDeviceDiscovered(UsbSerialDeviceInformation usbSerialDeviceInformation) { logger.debug("Discovered new USB-Serial device: {}", usbSerialDeviceInformation); previouslyDiscovered.add(usbSerialDeviceInformation); for (UsbSerialDiscoveryParticipant participant : discoveryParticipants) { DiscoveryResult result = participant.createResult(usbSerialDeviceInformation); if (result != null) { thingDiscovered(result); } } }
Source:
<code>private synchronized void runWriteRequest(GPIORequestInfo requestInfo) { ChannelRecord record = requestInfo.channelRecord; if (!GPIOChannelDescriptor.DEFAULT_RESOURCE_NAME.equals(requestInfo.resourceName) && requestInfo.resourceDirection != null) { try { final TypedValue<Boolean> value = getBooleanValue(record.getValue()); this.gpioNames.add(requestInfo.resourceName); KuraGPIOPin pin = getPin(requestInfo.resourceName, requestInfo.resourceDirection, requestInfo.resourceMode, requestInfo.resourceTrigger); if (pin != null) { pin.setValue((boolean) value.getValue()); record.setChannelStatus(new ChannelStatus(SUCCESS)); record.setTimestamp(System.currentTimeMillis()); } } catch (IOException | KuraUnavailableDeviceException | KuraClosedDeviceException e) { record.setChannelStatus(new ChannelStatus(ChannelFlag.FAILURE, message.readFailed(), null)); record.setTimestamp(System.currentTimeMillis()); logger.warn(message.writeFailed()); } } else { <START> record.setChannelStatus(new ChannelStatus(ChannelFlag.FAILURE, message.readFailed(), null)); <END> record.setTimestamp(System.currentTimeMillis()); } }</code><technical_language>this code externalised a method prevent code duplication</technical_language>

Target:
private synchronized void runWriteRequest(GPIORequestInfo requestInfo) { ChannelRecord record = requestInfo.channelRecord; if (!GPIOChannelDescriptor.DEFAULT_RESOURCE_NAME.equals(requestInfo.resourceName) && requestInfo.resourceDirection != null) { try { final TypedValue<Boolean> value = getBooleanValue(record.getValue()); this.gpioNames.add(requestInfo.resourceName); KuraGPIOPin pin = getPin(requestInfo.resourceName, requestInfo.resourceDirection, requestInfo.resourceMode, requestInfo.resourceTrigger); if (pin != null) { pin.setValue((boolean) value.getValue()); record.setChannelStatus(new ChannelStatus(SUCCESS)); record.setTimestamp(System.currentTimeMillis()); } } catch (IOException | KuraUnavailableDeviceException | KuraClosedDeviceException e) { setFailureRecord(record, WRITE_FAILED_MESSAGE); } } else { setFailureRecord(record, WRITE_FAILED_MESSAGE); } }
Source:
<code>protected Date convertDateTimeStringToDate(String dateString, boolean defaultUTC) { String localTimeRegex = "^(.*)([+-]{1}\\d\\d:\\d\\d)$"; Pattern localTimePattern = Pattern.compile(localTimeRegex); String utcPattern = "yyyy-MM-dd'T'HH:mm:ss'Z'"; String utcPattern1 = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"; String localPattern = "yyyy-MM-dd'T'HH:mm:ssz"; String localPattern1 = "yyyy-MM-dd'Z'"; String pattern = "yyyy-MM-ddz"; String localPattern2 = "yyyy-MM-dd'T'HH:mm:ss"; Date dt = null; if (dateString == null || dateString.isEmpty()) { return null; } else { if (dateString.endsWith("Z")) { dt = parseDateTimeString(dateString, defaultUTC, utcPattern, pattern, localPattern1, utcPattern1); } else if (dateString.endsWith("z")) { dt = parseDateTimeString(dateString, defaultUTC, "yyyy-MM-dd'T'HH:mm:ss'z'"); } else { Matcher localTimeMatcher = localTimePattern.matcher(dateString); if (localTimeMatcher.find()) { <START> log.debug("Pattern matched"); <END> String date = localTimeMatcher.group(1); String zone = localTimeMatcher.group(2); dateString = String.format("%sGMT%s", date, zone); dt = parseDateTimeString(dateString, defaultUTC, localPattern, pattern); } else { dt = parseDateTimeString(dateString, defaultUTC, localPattern2); } } return dt; } }</code><technical_language>This logging information pattern. removed, I guess..</technical_language>

Target:
protected Date convertDateTimeStringToDate(String dateString, boolean defaultUTC) { String localTimeRegex = "^(.*)([+-]{1}\\d\\d:\\d\\d)$"; Pattern localTimePattern = Pattern.compile(localTimeRegex); String utcPattern = "yyyy-MM-dd'T'HH:mm:ss'Z'"; String utcPattern1 = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"; String localPattern = "yyyy-MM-dd'T'HH:mm:ssz"; String localPattern1 = "yyyy-MM-dd'Z'"; String pattern = "yyyy-MM-ddz"; String localPattern2 = "yyyy-MM-dd'T'HH:mm:ss"; Date dt = null; if (dateString == null || dateString.isEmpty()) { return null; } else { if (dateString.endsWith("Z")) { dt = parseDateTimeString(dateString, defaultUTC, utcPattern, pattern, localPattern1, utcPattern1); } else if (dateString.endsWith("z")) { dt = parseDateTimeString(dateString, defaultUTC, "yyyy-MM-dd'T'HH:mm:ss'z'"); } else { Matcher localTimeMatcher = localTimePattern.matcher(dateString); if (localTimeMatcher.find()) { String date = localTimeMatcher.group(1); String zone = localTimeMatcher.group(2); dateString = String.format("%sGMT%s", date, zone); dt = parseDateTimeString(dateString, defaultUTC, localPattern, pattern); } else { dt = parseDateTimeString(dateString, defaultUTC, localPattern2); } } return dt; } }
Source:
<code>GermplasmList createGermplasmList(final SaveListForm saveListForm, final Integer currentUserId) { final String listName = saveListForm.getListName().trim(); final String listType = saveListForm.getListType(); final String description = saveListForm.getListDescription(); GermplasmList parent = null; Integer parentId = null; GermplasmList gpList = null; if (saveListForm.getParentId() != null && !GermplasmTreeController.PROGRAM_LISTS.equals(saveListForm.getParentId()) && !GermplasmTreeController.CROP_LISTS.equals(saveListForm.getParentId())) { parentId = Integer.valueOf(saveListForm.getParentId()); gpList = this.germplasmListManager.getGermplasmListById(parentId); } if (gpList != null && gpList.isFolder()) { parent = gpList; } final Integer status = 1; final Long dateLong = Long .valueOf(DateUtil.convertToDBDateFormat(TermId.DATE_VARIABLE.getId(), saveListForm.getListDate())); final GermplasmList germplasmList = new GermplasmList(null, listName, dateLong, listType, currentUserId, description, parent, status, saveListForm.getListNotes()); if (!GermplasmTreeController.CROP_LISTS.equals(saveListForm.getParentId())) { germplasmList.setProgramUUID(this.getCurrentProgramUUID()); } else { <START> germplasmList.setStatus(101); <END> } return germplasmList; }</code><technical_language>Extract 101 (locked status) a constant refer in tests</technical_language>

Target:
GermplasmList createGermplasmList(final SaveListForm saveListForm, final Integer currentUserId) { final String listName = saveListForm.getListName().trim(); final String listType = saveListForm.getListType(); final String description = saveListForm.getListDescription(); GermplasmList parent = null; Integer parentId = null; GermplasmList gpList = null; if (saveListForm.getParentId() != null && !GermplasmTreeController.PROGRAM_LISTS.equals(saveListForm.getParentId()) && !GermplasmTreeController.CROP_LISTS.equals(saveListForm.getParentId())) { parentId = Integer.valueOf(saveListForm.getParentId()); gpList = this.germplasmListManager.getGermplasmListById(parentId); } if (gpList != null && gpList.isFolder()) { parent = gpList; } final Integer status = 1; final Long dateLong = Long.valueOf(DateUtil.convertToDBDateFormat(TermId.DATE_VARIABLE.getId(), saveListForm.getListDate())); final GermplasmList germplasmList = new GermplasmList(null, listName, dateLong, listType, currentUserId, description, parent, status, saveListForm.getListNotes()); if (GermplasmTreeController.CROP_LISTS.equals(saveListForm.getParentId())) { germplasmList.setStatus(LOCKED_LIST_STATUS); } else { germplasmList.setProgramUUID(this.getCurrentProgramUUID()); } return germplasmList; }
Source:
<code>private void log(QueryResponse queryResponse) { LOGGER.trace("AfterPostQueryFilter result size: {}", queryResponse.getResults().size()); LOGGER.trace("Total Hit count: {}", queryResponse.getHits()); if (LOGGER.isTraceEnabled() && queryResponse.getProcessingDetails() != null) { LOGGER.trace("Processing details count: {}", queryResponse.getProcessingDetails().size()); for (ProcessingDetails details : queryResponse.getProcessingDetails()) { if (details.getException() != null) { LOGGER.trace( "Source query exception", details.getSourceId(), details.getException()); } <START> if (details.getWarnings() != null && details.getWarnings().size() > 0) { <END> LOGGER.trace( "Source warnings: {}", details.getSourceId(), String.join(", ", details.getWarnings())); } } } }</code><technical_language>!isEmpty() instead of size check</technical_language>

Target:
private void log(QueryResponse queryResponse) { LOGGER.trace("AfterPostQueryFilter result size: {}", queryResponse.getResults().size()); LOGGER.trace("Total Hit count: {}", queryResponse.getHits()); if (LOGGER.isTraceEnabled() && queryResponse.getProcessingDetails() != null) { LOGGER.trace("Processing details count: {}", queryResponse.getProcessingDetails().size()); for (ProcessingDetails details : queryResponse.getProcessingDetails()) { if (details.getException() != null) { LOGGER.trace( "Source query exception", details.getSourceId(), details.getException()); } if (details.getWarnings() != null && !details.getWarnings().isEmpty()) { LOGGER.trace( "Source warnings: {}", details.getSourceId(), String.join(", ", details.getWarnings())); } } } }
Source:
<code>public void deleteGroups(PerunSession perunSession, List<Group> groups, boolean forceDelete) throws GroupNotExistsException, InternalErrorException, PrivilegeException, GroupAlreadyRemovedException, RelationExistsException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException { Utils.checkPerunSession(perunSession); Utils.notNull(groups, "groups"); for(Group group: groups) { getGroupsManagerBl().checkGroupExists(perunSession, group); if(getGroupsManagerBl().isGroupInStructureSynchronizationTree(perunSession, group) || getGroupsManagerBl().hasGroupSynchronizedChild(perunSession, group)) { <START> throw new ExternallyManagedException("Group " + group + "or som of the subGroups are externally managed!"); <END> } if(!AuthzResolver.isAuthorized(perunSession, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(perunSession, Role.GROUPADMIN, group)) { throw new PrivilegeException(perunSession, "deleteGroups"); } } getGroupsManagerBl().deleteGroups(perunSession, groups, forceDelete); }</code><technical_language>Typo</technical_language>

Target:
public void deleteGroups(PerunSession perunSession, List<Group> groups, boolean forceDelete) throws GroupNotExistsException, InternalErrorException, PrivilegeException, GroupAlreadyRemovedException, RelationExistsException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException { Utils.checkPerunSession(perunSession); Utils.notNull(groups, "groups"); for(Group group: groups) { getGroupsManagerBl().checkGroupExists(perunSession, group); if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(perunSession, group) || getGroupsManagerBl().hasGroupSynchronizedChild(perunSession, group)) { throw new ExternallyManagedException("Group " + group + " or some of the subGroups are externally managed!"); } if(!AuthzResolver.isAuthorized(perunSession, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(perunSession, Role.GROUPADMIN, group)) { throw new PrivilegeException(perunSession, "deleteGroups"); } } getGroupsManagerBl().deleteGroups(perunSession, groups, forceDelete); }
Source:
<code>public void updateBeforeModel() { <START> beforeModel.setId(model.getId()); <END> beforeModel.setTitle(model.getTitle()); beforeModel.setDescription(model.getDescription()); beforeModel.setEstimatedEffort(model.getEstimatedEffort()); beforeModel.setAssignedTo(model.getAssignedTo()); beforeModel.setActualEffort(model.getActualEffort()); beforeModel.setDueDate(model.getDueDate()); beforeModel.setStatus(model.getStatus()); beforeModel.setLabelColor(model.getLabelColor()); }</code><technical_language>This unrelated testing</technical_language>

Target:
public void updateBeforeModel() { beforeModel.setTitle(model.getTitle()); beforeModel.setDescription(model.getDescription()); beforeModel.setEstimatedEffort(model.getEstimatedEffort()); beforeModel.setAssignedTo(model.getAssignedTo()); beforeModel.setActualEffort(model.getActualEffort()); beforeModel.setDueDate(model.getDueDate()); beforeModel.setStatus(model.getStatus()); beforeModel.setLabelColor(model.getLabelColor()); }
Source:
<code>public static boolean isEmptyIndex(String indexName) { try (RestHighLevelClient client = restHighLevelClient()) { return 0L == client .search(new SearchRequest(indexName) .source(SearchSourceBuilder.searchSource().query(QueryBuilders.matchAllQuery())), RequestOptions.DEFAULT) <START> .getHits().getTotalHits().value; <END> } }</code><technical_language>add some utility class fetch total hits value. bad design Lucene API leak ES code. a single utility method fetch total hits instead spreading access Lucene API code base</technical_language>

Target:
public static boolean isEmptyIndex(String indexName) { try (RestHighLevelClient client = restHighLevelClient()) { return 0L == SearchHitsUtil.getTotalCount(client .search(new SearchRequest(indexName) .source(SearchSourceBuilder.searchSource().query(QueryBuilders.matchAllQuery())), RequestOptions.DEFAULT) .getHits()); } }
Source:
<code>public String getOperationDescription() { <START> StringBuilder builder = new StringBuilder(); <END> builder.append("The ").append(operationName).append(" operation concatenates all source fields "); builder.append("with the given concatenation string."); return builder.toString(); }</code><technical_language>operation name simply cange here? (see setter). In addition I a simple direct string option easier read</technical_language>

Target:
public String getOperationDescription() { return theOperation().does("concatenates all source fields with the given concatenation string.") .toString(); }
Source:
<code>public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .sweptTimestamp(Math.min(getSweptTimestamp(), other.getSweptTimestamp())) .nextStartRow(other.getNextStartRow()) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) <START> .timeSweepStarted(getTimeSweepStarted()) <END> .build(); }</code><technical_language>this minimum of 2 start times? I this approach get answer do results1.accumulateWith(results2) results2.accumulateWith(results1). Need startRow too</technical_language>

Target:
public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow())) .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .minSweptTimestamp(Math.min(getMinSweptTimestamp(), other.getMinSweptTimestamp())) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) .timeSweepStarted(Math.min(getTimeSweepStarted(), other.getTimeSweepStarted())) .build(); }