auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMultipleEntryStore() { Cell cell1 = Cell.create(new byte[] {1, 2, 3}, new byte[] {4, 5, 6}); Cell cell2 = Cell.create(new byte[] {7, 8, 9}, new byte[] {4, 5, 6}); Cell cell3 = Cell.create(new byte[] {1, 2, 3}, new byte[] {7, 8, 9}); TableReference ref1 = TableReference.fromString("foo.bar"); TableReference ref2 = TableReference.fromString("foo.baz"); long timestamp1 = 10; long timestamp2 = 20; scrubStore.queueCellsForScrubbing(ImmutableMultimap.of(cell1, ref1, cell2, ref1), timestamp1, 1000); scrubStore.queueCellsForScrubbing(ImmutableMultimap.of(cell1, ref1, cell3, ref2), timestamp2, 1000); Assert.assertEquals( ImmutableList.of(ImmutableSortedMap.of( timestamp1, ImmutableMultimap.of(ref1, cell2), timestamp2, ImmutableMultimap.of(ref2, cell3, ref1, cell1))), getScrubQueue()); scrubStore.markCellsAsScrubbed(ImmutableMap.of( ref2, ImmutableMultimap.of(cell3, timestamp2), <START> ref1, ImmutableMultimap.of(cell1, timestamp1)), 1000); <END> Assert.assertEquals( ImmutableList.of(ImmutableSortedMap.of( timestamp1, ImmutableMultimap.of(ref1, cell2), timestamp2, ImmutableMultimap.of(ref1, cell1))), getScrubQueue()); }</code><technical_language>mark cell1, timestamp2 scrubbed here, scrub queue returns cell timestamp2</technical_language>

Target:
public void testMultipleEntryStore() { Cell cell1 = Cell.create(new byte[] {1, 2, 3}, new byte[] {4, 5, 6}); Cell cell2 = Cell.create(new byte[] {7, 8, 9}, new byte[] {4, 5, 6}); Cell cell3 = Cell.create(new byte[] {1, 2, 3}, new byte[] {7, 8, 9}); TableReference ref1 = TableReference.fromString("foo.bar"); TableReference ref2 = TableReference.fromString("foo.baz"); long timestamp1 = 10; long timestamp2 = 20; scrubStore.queueCellsForScrubbing(ImmutableMultimap.of(cell1, ref1, cell2, ref1), timestamp1, 1000); scrubStore.queueCellsForScrubbing(ImmutableMultimap.of(cell1, ref1, cell3, ref2), timestamp2, 1000); Assert.assertEquals( ImmutableList.of(ImmutableSortedMap.of( timestamp1, ImmutableMultimap.of(ref1, cell2), timestamp2, ImmutableMultimap.of(ref2, cell3, ref1, cell1))), getScrubQueue()); scrubStore.markCellsAsScrubbed(ImmutableMap.of( ref2, ImmutableMultimap.of(cell3, timestamp2), ref1, ImmutableMultimap.of(cell1, timestamp1, cell1, timestamp2)), 1000); Assert.assertEquals( ImmutableList.of(ImmutableSortedMap.of( timestamp1, ImmutableMultimap.of(ref1, cell2))), getScrubQueue()); }
Source:
<code>default Collection<ServerName> getRegionServers(boolean excludeDecommissionedRS) throws IOException { List<ServerName> allServers = getClusterMetrics(EnumSet.of(Option.SERVERS_NAME)).getServersName(); if (!excludeDecommissionedRS) { return allServers; } List<ServerName> decommissionedRegionServers = listDecommissionedRegionServers(); <START> if (CollectionUtils.isNotEmpty(decommissionedRegionServers)) { <END> allServers = new ArrayList<>(allServers); allServers.removeIf(decommissionedRegionServers::contains); return Collections.unmodifiableList(allServers); } return allServers; }</code><technical_language>if (CollectionUtils.isNotEmpty(decommissionedRegionServers)) { allServers = new ArrayList<>(allServers); allServers.removeIf(decommissionedRegionServers::contains); return Collections.unmodifiableList(allServers); } return allServers; return allServers.stream() .filter(s -> !decommissionedRegionServers.contains(s)) .collect(ImmutableList.toImmutableList()); I this save time full copy (previous code copy twice, this copies once). Need confirm</technical_language>

Target:
default Collection<ServerName> getRegionServers(boolean excludeDecommissionedRS) throws IOException { List<ServerName> allServers = getClusterMetrics(EnumSet.of(Option.SERVERS_NAME)).getServersName(); if (!excludeDecommissionedRS) { return allServers; } List<ServerName> decommissionedRegionServers = listDecommissionedRegionServers(); return allServers.stream() .filter(s -> !decommissionedRegionServers.contains(s)) .collect(ImmutableList.toImmutableList()); }
Source:
<code>protected void packColumns() { if (fPackDone) { return; } TableColumn tableColumns[] = fTable.getColumns(); for (int i = 0; i < tableColumns.length; i++) { final TableColumn column = tableColumns[i]; final int headerWidth = column.getWidth(); column.pack(); <START> if (i == 0) { <END> column.setWidth(column.getWidth() + SEARCH_IMAGE.getBounds().width); } if (column.getWidth() < headerWidth) { column.setWidth(headerWidth); } } fPackDone = true; }</code><technical_language>add a system property check for Linux? line 448</technical_language>

Target:
protected void packColumns() { if (fPackDone) { return; } boolean isLinux = System.getProperty("os.name").contains("Linux") ? true : false; TableColumn tableColumns[] = fTable.getColumns(); for (int i = 0; i < tableColumns.length; i++) { final TableColumn column = tableColumns[i]; final int headerWidth = column.getWidth(); column.pack(); if (isLinux && (i == 0)) { column.setWidth(column.getWidth() + SEARCH_IMAGE.getBounds().width); } if (column.getWidth() < headerWidth) { column.setWidth(headerWidth); } } fPackDone = true; }
Source:
<code>public void testCheckWithNoMatchingMethodName() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(MatchXpathCheck.class); checkConfig.addAttribute("query", " + "@text='nonExistingMethod']]"); <START> final String[] expected = {}; <END> verify(checkConfig, getPath("InputMatchXpath.java"), expected); }</code><technical_language>a suggestion for consistency, Checkstyle UT's final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;</technical_language>

Target:
public void testCheckWithNoMatchingMethodName() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(MatchXpathCheck.class); checkConfig.addAttribute("query", " + "@text='nonExistingMethod']]"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputMatchXpath.java"), expected); }
Source:
<code>public boolean matches(Notification notification) { <START> boolean matches = false; <END> if (!notification.isTouch() && notification.getNotifier() instanceof EObject) { EObject eObject = (EObject) notification.getNotifier(); Option<DRepresentation> dRepresentationOption = new EObjectQuery(eObject).getRepresentation(); matches = dRepresentationOption.some() && dRepresentationOption.get() == dRepresentation; } return matches; }</code><technical_language>change (maybe a taste issue), introducing a local overkill</technical_language>

Target:
public boolean matches(Notification notification) { boolean matches = false; if (!notification.isTouch()) { Object notifier = notification.getNotifier(); if (notifier instanceof EObject) { EObject eObject = (EObject) notifier; Option<DRepresentation> dRepresentationOption = new EObjectQuery(eObject).getRepresentation(); matches = dRepresentationOption.some() && dRepresentationOption.get() == dRepresentation; } } return matches; }
Source:
<code>public BlobReadOptions getBlobReadInfo(StoreKey id) throws StoreException { IndexValue value = findKey(id); if (value == null) { <START> throw new StoreException("id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); <END> } else if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("id " + id + " has been deleted in index " + dataDir, StoreErrorCodes.ID_Deleted); } else if (value.isExpired()) { throw new StoreException("id " + id + " has expired ttl in index " + dataDir, StoreErrorCodes.TTL_Expired); } return new BlobReadOptions(value.getOffset(), value.getSize(), value.getTimeToLiveInMs(), id); }</code><technical_language>for</technical_language>

Target:
public BlobReadOptions getBlobReadInfo(StoreKey id) throws StoreException { IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " has been deleted in index " + dataDir, StoreErrorCodes.ID_Deleted); } else if (value.isExpired()) { throw new StoreException("Id " + id + " has expired ttl in index " + dataDir, StoreErrorCodes.TTL_Expired); } return new BlobReadOptions(value.getOffset(), value.getSize(), value.getTimeToLiveInMs(), id); }
Source:
<code>private int load(Class<?> source) { <START> if (isGroovyPresent() && GroovyBeanDefinitionSource.class.isAssignableFrom(source) && IS_XML_ENABLED) { <END> GroovyBeanDefinitionSource loader = BeanUtils.instantiateClass(source, GroovyBeanDefinitionSource.class); load(loader); } if (isEligible(source)) { this.annotatedReader.register(source); return 1; } return 0; }</code><technical_language>I guess check for IS_XML_ENABLED avoid class lookups isGroovyPresent here</technical_language>

Target:
private int load(Class<?> source) { if (isGroovyPresent() && GroovyBeanDefinitionSource.class.isAssignableFrom(source)) { GroovyBeanDefinitionSource loader = BeanUtils.instantiateClass(source, GroovyBeanDefinitionSource.class); ((GroovyBeanDefinitionReader) this.groovyReader).beans(loader.getBeans()); } if (isEligible(source)) { this.annotatedReader.register(source); return 1; } return 0; }
Source:
<code>public void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close KijiTableWriter instance %s in state %s.", this, oldState); mLayoutConsumerRegistration.close(); try { <START> mHBClient.shutdown().join(); <END> } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } mTable.release(); }</code><technical_language>I AsyncKTR's share a single HBaseClient, 'owned' Kiji instead of shut here. if this a clear explanation</technical_language>

Target:
public void close() throws IOException { final State oldState = mState.getAndSet(State.CLOSED); Preconditions.checkState(oldState == State.OPEN, "Cannot close KijiTableWriter instance %s in state %s.", this, oldState); mLayoutConsumerRegistration.close(); mTable.release(); }
Source:
<code>public List<Container> refreshRepos(@QueryParam("user_id") Long userId) { List<Container> currentRepos = containerDAO.findByUserId(userId); List<Container> allRepos = new ArrayList<>(0); List<Token> tokens = tokenDAO.findByUserId(userId); for (Token token : tokens) { if (token.getTokenSource().equals(TokenType.QUAY_IO.toString())) { Optional<String> asString = ResourceUtilities.asString(TARGET_URL + "repository?last_modified=true&public=false", token.getContent(), client); if (asString.isPresent()) { RepoList repos; try { repos = MAPPER.readValue(asString.get(), RepoList.class); allRepos.addAll(repos.getRepositories()); } catch (IOException ex) { Logger.getLogger(DockerRepoResource.class.getName()).log(Level.SEVERE, null, ex); } } } } for (Container newContainer : allRepos) { for (Container oldContainer : currentRepos) { if (newContainer.getName().equals(oldContainer.getName()) && newContainer.getNamespace().equals(oldContainer.getNamespace())) { <START> System.out.println("container " + oldContainer.getId() + " is being updated ..."); <END> oldContainer.update(newContainer); containerDAO.create(oldContainer); System.out.println("container " + oldContainer.getId() + " is updated"); } } } return currentRepos; }</code><technical_language>a mix of Logger (from line 172) System.out here. Note dropwizard Logback, standardize that. <LINK_0> examples</technical_language>

Target:
public List<Container> refreshRepos(@QueryParam("user_id") Long userId) { List<Container> currentRepos = containerDAO.findByUserId(userId); List<Container> allRepos = new ArrayList<>(0); List<Token> tokens = tokenDAO.findByUserId(userId); for (Token token : tokens) { if (token.getTokenSource().equals(TokenType.QUAY_IO.toString())) { Optional<String> asString = ResourceUtilities.asString(TARGET_URL + "repository?last_modified=true&public=false", token.getContent(), client); if (asString.isPresent()) { RepoList repos; try { repos = objectMapper.readValue(asString.get(), RepoList.class); allRepos.addAll(repos.getRepositories()); } catch (IOException ex) { LOG.info("Exception: " + ex); } } } } for (Container newContainer : allRepos) { for (Container oldContainer : currentRepos) { if (newContainer.getName().equals(oldContainer.getName()) && newContainer.getNamespace().equals(oldContainer.getNamespace())) { LOG.info("container " + oldContainer.getId() + " is being updated ..."); oldContainer.update(newContainer); containerDAO.create(oldContainer); LOG.info("container " + oldContainer.getId() + " is updated"); } } } return currentRepos; }
Source:
<code>public boolean hasEmptyEccFields(Release release) { EccInformation eccInformation = release.getEccInformation(); <START> return (eccInformation.getAL() == null || eccInformation.getAL().isEmpty()) && <END> (eccInformation.getECCN() == null || eccInformation.getECCN().isEmpty()) && (eccInformation.getEccStatus() == null || eccInformation.getEccStatus() == ECCStatus.OPEN); }</code><technical_language>isNullOrEmptyWhitespace(), please</technical_language>

Target:
public boolean hasEmptyEccFields(Release release) { EccInformation eccInformation = release.getEccInformation(); return isNullEmptyOrWhitespace(eccInformation.getAL()) && isNullEmptyOrWhitespace(eccInformation.getECCN()) && (eccInformation.getEccStatus() == null || eccInformation.getEccStatus() == ECCStatus.OPEN); }
Source:
<code>boolean doesColumnExist(Connection conn, String tableName, String columnName) throws SQLException { final String objectIdColumnExistsTemplate = "SELECT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='%s' AND column_name='%s')"; ResultSet resultSet; Statement statement = conn.createStatement(); boolean columnExists = false; <START> resultSet = statement.executeQuery(String.format(objectIdColumnExistsTemplate, tableName, columnName)); <END> try { if (resultSet.next()) { columnExists = resultSet.getBoolean(1); } } finally { resultSet.close(); statement.close(); } return columnExists; }</code><technical_language>other place - this in try-catch block close everything</technical_language>

Target:
boolean doesColumnExist(Connection conn, String tableName, String columnName) throws SQLException { final String objectIdColumnExistsTemplate = "SELECT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='%s' AND column_name='%s')"; ResultSet resultSet = null; Statement statement = null; boolean columnExists = false; try { statement = conn.createStatement(); resultSet = statement.executeQuery(String.format(objectIdColumnExistsTemplate, tableName, columnName)); if (resultSet.next()) { columnExists = resultSet.getBoolean(1); } } finally { EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeStatement(statement); } return columnExists; }
Source:
<code>protected @Nullable String getProcessName(@NonNull ITmfEvent event) { String pName = super.getProcessName(event); <START> if (pName == null) { pName = event.getContent().getFieldValue(String.class, "pid"); } <END> if (pName == null) { int processId = getProcessId(event); pName = (processId == UNKNOWN_PID) ? UNKNOWN : Integer.toString(processId); } return pName; }</code><technical_language>redundant, getProcessId(event) that... if is pname tgidname field, forget getProcessId() directly</technical_language>

Target:
protected @Nullable String getProcessName(@NonNull ITmfEvent event) { String pName = super.getProcessName(event); if (pName == null) { pName = event.getContent().getFieldValue(String.class, ITraceEventConstants.PID); } if (pName == null) { int processId = getProcessId(event); pName = (processId == UNKNOWN_PID) ? UNKNOWN : Integer.toString(processId); } return pName; }
Source:
<code>private static boolean testRow(List<Type> types, List<List<?>> values, int row, Map<Integer, TupleDomainFilter> columnFilters) { for (int column = 0; column < types.size(); column++) { TupleDomainFilter filter = columnFilters.get(column); if (filter == null) { continue; } Object value = values.get(column).get(row); if (value == null) { if (!filter.testNull()) { return false; } } else { Type type = types.get(column); if (type == BOOLEAN) { <START> if (!filter.testBoolean(((Boolean) value).booleanValue())) { <END> return false; } } else { fail("Unsupported type: " + type); } } } return true; }</code><technical_language>booleanValue() is unnecessary</technical_language>

Target:
private static boolean testRow(List<Type> types, List<List<?>> values, int row, Map<Integer, TupleDomainFilter> columnFilters) { for (int column = 0; column < types.size(); column++) { TupleDomainFilter filter = columnFilters.get(column); if (filter == null) { continue; } Object value = values.get(column).get(row); if (value == null) { if (!filter.testNull()) { return false; } } else { Type type = types.get(column); if (type == BOOLEAN) { if (!filter.testBoolean((Boolean) value)) { return false; } } else { fail("Unsupported type: " + type); } } } return true; }
Source:
<code>public void testCorruptedFile() throws IOException { Schema schema = Schema.create(Type.STRING); DataFileWriter<Utf8> w = new DataFileWriter<>(new GenericDatumWriter<>(schema)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); w.create(schema, baos); w.append(new Utf8("apple")); w.append(new Utf8("banana")); w.sync(); w.append(new Utf8("celery")); w.append(new Utf8("date")); long pos = w.sync(); w.append(new Utf8("endive")); w.append(new Utf8("fig")); w.close(); byte[] original = baos.toByteArray(); int corruptPosition = (int) pos - DataFileConstants.SYNC_SIZE; int corruptedBytes = 3; byte[] corrupted = new byte[original.length + corruptedBytes]; System.arraycopy(original, 0, corrupted, 0, corruptPosition); System.arraycopy(original, corruptPosition, corrupted, corruptPosition + corruptedBytes, original.length - corruptPosition); File file = makeFile("corrupt"); file.deleteOnExit(); FileOutputStream out = new FileOutputStream(file); out.write(corrupted); out.close(); DataFileReader r = new DataFileReader<>(file, new GenericDatumReader<>(schema)); assertEquals("apple", r.next().toString()); assertEquals("banana", r.next().toString()); long prevSync = r.previousSync(); try { r.next(); fail("Corrupt block should throw exception"); } catch (AvroRuntimeException e) { assertEquals("Invalid sync!", e.getCause().getMessage()); } r.sync(prevSync); assertEquals("endive", r.next().toString()); assertEquals("fig", r.next().toString()); assertFalse(r.hasNext()); <START> r.close(); <END> }</code><technical_language>a try-with-resource pattern here</technical_language>

Target:
public void testCorruptedFile() throws IOException { Schema schema = Schema.create(Type.STRING); DataFileWriter<Utf8> w = new DataFileWriter<>(new GenericDatumWriter<>(schema)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); w.create(schema, baos); w.append(new Utf8("apple")); w.append(new Utf8("banana")); w.sync(); w.append(new Utf8("celery")); w.append(new Utf8("date")); long pos = w.sync(); w.append(new Utf8("endive")); w.append(new Utf8("fig")); w.close(); byte[] original = baos.toByteArray(); int corruptPosition = (int) pos - DataFileConstants.SYNC_SIZE; int corruptedBytes = 3; byte[] corrupted = new byte[original.length + corruptedBytes]; System.arraycopy(original, 0, corrupted, 0, corruptPosition); System.arraycopy(original, corruptPosition, corrupted, corruptPosition + corruptedBytes, original.length - corruptPosition); File file = makeFile("corrupt"); file.deleteOnExit(); FileOutputStream out = new FileOutputStream(file); out.write(corrupted); out.close(); try (DataFileReader r = new DataFileReader<>(file, new GenericDatumReader<>(schema))) { assertEquals("apple", r.next().toString()); assertEquals("banana", r.next().toString()); long prevSync = r.previousSync(); r.next(); fail("Corrupt block should throw exception"); r.sync(prevSync); assertEquals("endive", r.next().toString()); assertEquals("fig", r.next().toString()); assertFalse(r.hasNext()); } catch (AvroRuntimeException e) { assertEquals("Invalid sync!", e.getCause().getMessage()); } }
Source:
<code>private CommandEntity getParentCommandEntity(Guid cmdId, VdcActionType actionType, VdcActionParametersBase parameters) { <START> CommandEntity cmdEntity = Guid.isNullOrEmpty(cmdId) ? null : coco.getCommandEntity(cmdId); <END> if (cmdEntity == null) { cmdEntity = coco.createCommandEntity(cmdId, actionType, parameters); if (!Guid.isNullOrEmpty(cmdId)) { cmdEntity.setCommandStatus(CommandStatus.ACTIVE); coco.persistCommand(cmdEntity); } } return cmdEntity; }</code><technical_language>I this appeared - move trenary if logic coco.getCommandEntity(guid)</technical_language>

Target:
private CommandEntity getParentCommandEntity(Guid cmdId, VdcActionType actionType, VdcActionParametersBase parameters) { CommandEntity cmdEntity = coco.getCommandEntity(cmdId); if (cmdEntity == null) { cmdEntity = coco.createCommandEntity(cmdId, actionType, parameters); if (!Guid.isNullOrEmpty(cmdId)) { cmdEntity.setCommandStatus(CommandStatus.ACTIVE); coco.persistCommand(cmdEntity); } } return cmdEntity; }
Source:
<code>public boolean filter(HttpServletRequest request, HttpServletResponse response) { if (StringUtils.isEmpty(request.getHeader(IGNORE_METRICS_HEADER))) { try { metricsService.captureRequest(request); } catch (Exception ex) { logError(ex).log(); <START> return false; <END> } } return true; }</code><technical_language>Do want return true here? want splunk issues prevent requests processed</technical_language>

Target:
public boolean filter(HttpServletRequest request, HttpServletResponse response) { if (StringUtils.isEmpty(request.getHeader(IGNORE_METRICS_HEADER))) { try { metricsService.captureRequest(request); } catch (Exception ex) { logError(ex).log(); } } return true; }
Source:
<code>public static SchemaRuleCommand createIndexRule( SchemaIndexProvider.Descriptor provider, long id, LabelSchemaDescriptor descriptor ) { SchemaRule rule = IndexRule.indexRule( id, <START> NewIndexDescriptorFactory.forLabel( descriptor.getLabelId(), descriptor.getPropertyId() ), <END> provider ); DynamicRecord record = new DynamicRecord( id ); record.setInUse( true ); record.setCreated(); record.setData( rule.serialize() ); return new SchemaRuleCommand( Collections.<DynamicRecord>emptyList(), singletonList( record ), rule ); }</code><technical_language>forSchema</technical_language>

Target:
public static SchemaRuleCommand createIndexRule( SchemaIndexProvider.Descriptor provider, long id, LabelSchemaDescriptor descriptor ) { SchemaRule rule = IndexRule.indexRule( id, NewIndexDescriptorFactory.forSchema( descriptor ), provider ); DynamicRecord record = new DynamicRecord( id ); record.setInUse( true ); record.setCreated(); record.setData( rule.serialize() ); return new SchemaRuleCommand( Collections.<DynamicRecord>emptyList(), singletonList( record ), rule ); }
Source:
<code>public ArchiveResult archive() { markProcessed(); final Object record = getRecord(); final TableRecordReference recordRef = TableRecordReference.of(record); final DocumentReportResult report = getDocumentReportService() .createReport(DocumentReportRequest.builder() .documentRef(recordRef) .printFormatIdToUse(getPrintFormatId().orElse(null)) .printPreview(true) .clientId(InterfaceWrapperHelper.getClientId(record).orElse(ClientId.SYSTEM)) .orgId(InterfaceWrapperHelper.getOrgId(record).orElse(OrgId.ANY)) .userId(Env.getLoggedUserIdIfExists().orElse(UserId.SYSTEM)) .roleId(Env.getLoggedRoleId()) .build()); final ArchiveResult lastArchiveResult = report.getLastArchiveResult(); final ArchiveResult archiveResult; <START> if (lastArchiveResult.isNoArchive()) <END> { archiveResult = createArchive(report); } else { archiveResult = lastArchiveResult; } final String ccPath = getCCPath().orElse(null); if (Check.isNotBlank(ccPath) && ccAbleDocumentFactoryService.isTableNameSupported(recordRef.getTableName()) && archiveResult.getArchiveRecord() != null) { DocOutboundCCWorkpackageProcessor.scheduleOnTrxCommit(archiveResult.getArchiveRecord()); } return archiveResult; }</code><technical_language>lastArchiveResult is nullable, u check if is null</technical_language>

Target:
public ArchiveResult archive() { markProcessed(); final Object record = getRecord(); final TableRecordReference recordRef = TableRecordReference.of(record); final DocumentReportResult report = getDocumentReportService() .createReport(DocumentReportRequest.builder() .documentRef(recordRef) .printFormatIdToUse(getPrintFormatId().orElse(null)) .printPreview(true) .clientId(InterfaceWrapperHelper.getClientId(record).orElse(ClientId.SYSTEM)) .orgId(InterfaceWrapperHelper.getOrgId(record).orElse(OrgId.ANY)) .userId(Env.getLoggedUserIdIfExists().orElse(UserId.SYSTEM)) .roleId(Env.getLoggedRoleId()) .build()); final ArchiveResult lastArchive = report.getLastArchive(); final ArchiveResult archiveResult; if (lastArchive == null || lastArchive.isNoArchive()) { archiveResult = createArchive(report); } else { archiveResult = lastArchive; } final String ccPath = getCCPath().orElse(null); if (Check.isNotBlank(ccPath) && ccAbleDocumentFactoryService.isTableNameSupported(recordRef.getTableName()) && archiveResult.getArchiveRecord() != null) { DocOutboundCCWorkpackageProcessor.scheduleOnTrxCommit(archiveResult.getArchiveRecord()); } return archiveResult; }
Source:
<code>public void testSkipRevFilter() throws Exception { final RevCommit a = commit(); final RevCommit b = commit(a); final RevCommit c1 = commit(b); final RevCommit c2 = commit(b); final RevCommit d = commit(c1, c2); final RevCommit e = commit(d); rw.reset(); rw.setRevFilter(SkipRevFilter.create(3)); markStart(e); assertCommit(c1, rw.next()); assertCommit(b, rw.next()); assertCommit(a, rw.next()); assertNull(rw.next()); <START> <END> rw.reset(); rw.setRevFilter(SkipRevFilter.create(0)); markStart(e); assertCommit(e, rw.next()); assertCommit(d, rw.next()); assertCommit(c2, rw.next()); assertCommit(c1, rw.next()); assertCommit(b, rw.next()); assertCommit(a, rw.next()); assertNull(rw.next()); }</code><technical_language>I in this test removed, test testSkipRevFilter0</technical_language>

Target:
public void testSkipRevFilter() throws Exception { final RevCommit a = commit(); final RevCommit b = commit(a); final RevCommit c1 = commit(b); final RevCommit c2 = commit(b); final RevCommit d = commit(c1, c2); final RevCommit e = commit(d); rw.reset(); rw.setRevFilter(SkipRevFilter.create(3)); markStart(e); assertCommit(c1, rw.next()); assertCommit(b, rw.next()); assertCommit(a, rw.next()); assertNull(rw.next()); }
Source:
<code>public String toString() { <START> return String.format("Notifications [notifications=[%s]]", StringUtils.join(get(), ", ")); <END> }</code><technical_language>do this built in Java: return String.format("Notifications [notifications=[%s]]", notifications.stream().collect(Collectors.joining(","))); ImmutableLists toString() pretty nicely, able do this: return String.format("Notifications [notifications=%s]", notifications);</technical_language>

Target:
public String toString() { return String.format("Notifications [notifications=%s]", get()); }
Source:
<code>public void testCommaSeparatedList(){ <START> CrossSiteOriginFilter crossSiteOriginFilter = new CrossSiteOriginFilter(new ServerConfiguration()); <END> crossSiteOriginFilter.getAsCommaSeparatedList(null); }</code><technical_language>Add final keyword</technical_language>

Target:
public void testCommaSeparatedList(){ final CrossSiteOriginFilter crossSiteOriginFilter = new CrossSiteOriginFilter(new ServerConfiguration()); crossSiteOriginFilter.getAsCommaSeparatedList(null); }
Source:
<code>public void testGetSplitsNoCombining() throws Exception { DatasourceInputFormat inputFormat = new DatasourceInputFormat().setSupplier(testFormatter); List<InputSplit> splits = inputFormat.getSplits(context); Assert.assertEquals(segments.size(), splits.size()); for (int i = 0; i < segments.size(); i++) { DatasourceInputSplit split = (DatasourceInputSplit) splits.get(i); Assert.assertEquals(segments.get(i), split.getSegments().get(0)); System.out.println(Arrays.toString(split.getLocations())); <START> Assert.assertTrue(split.getLocations().length > 0); <END> } }</code><technical_language>i guess, verify contents of split.getLocations()</technical_language>

Target:
public void testGetSplitsNoCombining() throws Exception { DatasourceInputFormat inputFormat = new DatasourceInputFormat().setSupplier(testFormatter); List<InputSplit> splits = inputFormat.getSplits(context); Assert.assertEquals(segments.size(), splits.size()); for (int i = 0; i < segments.size(); i++) { DatasourceInputSplit split = (DatasourceInputSplit) splits.get(i); Assert.assertEquals(segments.get(i), split.getSegments().get(0)); } Assert.assertArrayEquals(new String[] {"s1", "s2"}, splits.get(0).getLocations()); Assert.assertArrayEquals(new String[] {"s1", "s2"}, splits.get(1).getLocations()); Assert.assertArrayEquals(new String[] {"s2", "s3"}, splits.get(2).getLocations()); }
Source:
<code>public void onReceive(Context context, Intent intent) { String action = intent.getAction(); <START> if (action == null) { return; } <END> if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { PackageManager pm = context.getPackageManager(); if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC)) { pm.setApplicationEnabledSetting(context.getPackageName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); } } }</code><technical_language>needed if swap equals test -- if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {</technical_language>

Target:
public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (Intent.ACTION_BOOT_COMPLETED.equals(action)) { PackageManager pm = context.getPackageManager(); if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC_ANY)) { pm.setApplicationEnabledSetting(context.getPackageName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); } } }
Source:
<code><START> public Single<Integer> checkFBMD (String filePath){ <END> try { return ReadFBMD.processMetadata(filePath); } catch (IOException e) { return Single.just(ImageUtils.FILE_FBMD); } }</code><technical_language>is a space function name parameter? AFAIK checkFBMD (String</technical_language>

Target:
public Single<Integer> checkFBMD(String filePath) { try { return readFBMD.processMetadata(filePath); } catch (IOException e) { return Single.just(ImageUtils.FILE_FBMD); } }
Source:
<code>public boolean isEntryExist(String entryKey) throws LocalEntryAdminException { final Lock lock = getLock(); try { lock.lock(); assertKeyEmpty(entryKey); log.debug("Checking localEntry Exists : " + entryKey); return getSynapseConfiguration().getLocalRegistry().containsKey(entryKey); <START> } catch (LocalEntryAdminException e) { <END> throw e; } finally { lock.unlock(); } }</code><technical_language>this catch block is needed</technical_language>

Target:
public boolean isEntryExist(String entryKey) throws LocalEntryAdminException { final Lock lock = getLock(); try { lock.lock(); assertKeyEmpty(entryKey); log.debug("Checking localEntry Exists : " + entryKey); return getSynapseConfiguration().getLocalRegistry().containsKey(entryKey); } finally { lock.unlock(); } }
Source:
<code>protected boolean cleanState( String topologyName, SchedulerStateManagerAdaptor statemgr) { LOG.fine("Cleaning up topology state"); Boolean result; result = statemgr.deleteTMasterLocation(topologyName); if (result == null || !result) { LOG.warning("Failed to clear TMaster location. Check whether TMaster set it correctly."); } result = statemgr.deletePackingPlan(topologyName); if (result == null || !result) { <START> LOG.warning("Failed to clear packing plan. Check whether TMaster set it correctly."); <END> } result = statemgr.deletePhysicalPlan(topologyName); if (result == null || !result) { LOG.warning("Failed to clear physical plan. Check whether TMaster set it correctly."); } result = statemgr.deleteSchedulerLocation(topologyName); if (result == null || !result) { LOG.warning("Failed to clear scheduler location. Check whether Scheduler set it correctly."); } result = statemgr.deleteExecutionState(topologyName); if (result == null || !result) { LOG.severe("Failed to clear execution state"); return false; } result = statemgr.deleteTopology(topologyName); if (result == null || !result) { LOG.severe("Failed to clear topology definition"); return false; } LOG.fine("Cleaned up topology state"); return true; }</code><technical_language>I packing plan is set Launcher UpdateManager. If log message needs fixed. Coincidentally, I this issue today (#1347) created a PR #1348. I ok if is marked a duplicate of this closed</technical_language>

Target:
protected boolean cleanState( String topologyName, SchedulerStateManagerAdaptor statemgr) { LOG.fine("Cleaning up topology state"); Boolean result; result = statemgr.deleteTMasterLocation(topologyName); if (result == null || !result) { LOG.warning("Failed to clear TMaster location. Check whether TMaster set it correctly."); } result = statemgr.deletePackingPlan(topologyName); if (result == null || !result) { LOG.warning("Failed to clear packing plan. Check whether Launcher set it correctly."); } result = statemgr.deletePhysicalPlan(topologyName); if (result == null || !result) { LOG.warning("Failed to clear physical plan. Check whether TMaster set it correctly."); } result = statemgr.deleteSchedulerLocation(topologyName); if (result == null || !result) { LOG.warning("Failed to clear scheduler location. Check whether Scheduler set it correctly."); } result = statemgr.deleteExecutionState(topologyName); if (result == null || !result) { LOG.severe("Failed to clear execution state"); return false; } result = statemgr.deleteTopology(topologyName); if (result == null || !result) { LOG.severe("Failed to clear topology definition"); return false; } LOG.fine("Cleaned up topology state"); return true; }
Source:
<code>ServerSocket createServerSocket(InetSocketAddress address, boolean portUnification, boolean sslQuorum) throws IOException { ServerSocket serverSocket; try { if (portUnification || sslQuorum) { serverSocket = new UnifiedServerSocket(self.getX509Util(), portUnification); } else { serverSocket = new ServerSocket(); } serverSocket.setReuseAddress(true); serverSocket.bind(address); return serverSocket; } catch (BindException e) { <START> LOG.error("Couldn't bind to " + self.getQuorumAddress(), e); <END> throw e; } }</code><technical_language>Instead of self.getQuorumAddress(), print address, actual address bind</technical_language>

Target:
Optional<ServerSocket> createServerSocket(InetSocketAddress address, boolean portUnification, boolean sslQuorum) { ServerSocket serverSocket; try { if (portUnification || sslQuorum) { serverSocket = new UnifiedServerSocket(self.getX509Util(), portUnification); } else { serverSocket = new ServerSocket(); } serverSocket.setReuseAddress(true); serverSocket.bind(address); return Optional.of(serverSocket); } catch (IOException e) { LOG.error("Couldn't bind to {}", address.toString(), e); } return Optional.empty(); }
Source:
<code><START> void validateDevfile(Devfile devfile) throws DevfileFormatException { <END> validateProjects(devfile); Set<String> toolNames = validateTools(devfile); validateCommands(devfile, toolNames); }</code><technical_language>a reason a public class public methods, package private method? Consider making class package private method public</technical_language>

Target:
public void validateDevfile(Devfile devfile) throws DevfileFormatException { validateProjects(devfile); Set<String> toolNames = validateTools(devfile); validateCommands(devfile, toolNames); }
Source:
<code><START> private static ServiceMessage toServiceMessage(MethodInfo methodInfo, Object... params) { <END> if (methodInfo.parameterCount() != 0 && params[0] instanceof ServiceMessage) { return ServiceMessage.from((ServiceMessage) params[0]) .qualifier(methodInfo.serviceName(), methodInfo.methodName()) .build(); } return ServiceMessage.builder() .qualifier(methodInfo.serviceName(), methodInfo.methodName()) .data(methodInfo.parameterCount() != 0 ? params[0] : null) .build(); }</code><technical_language>Please remove static modifier move end of class, for toServiceMessage, noReachableMemberException, toStringOrEqualsOrHashCode. addressLookup</technical_language>

Target:
private ServiceMessage toServiceMessage(MethodInfo methodInfo, Object... params) { if (methodInfo.parameterCount() != 0 && params[0] instanceof ServiceMessage) { return ServiceMessage.from((ServiceMessage) params[0]) .qualifier(methodInfo.serviceName(), methodInfo.methodName()) .build(); } return ServiceMessage.builder() .qualifier(methodInfo.serviceName(), methodInfo.methodName()) .data(methodInfo.parameterCount() != 0 ? params[0] : null) .build(); }
Source:
<code>@Override public MessageConsumer getMessageConsumer(Session session, Destination destination) throws JMSConnectorException { <START> MessageConsumer messageConsumer = null; <END> if (cachedMessageConsumer == null) { messageConsumer = createMessageConsumer(session, destination); } else { messageConsumer = cachedMessageConsumer; } return messageConsumer; }</code><technical_language>Need initialized</technical_language>

Target:
public MessageConsumer getMessageConsumer(Session session, Destination destination) throws JMSConnectorException { MessageConsumer messageConsumer; if (cachedMessageConsumer == null) { messageConsumer = createMessageConsumer(session, destination); } else { messageConsumer = cachedMessageConsumer; } return messageConsumer; }
Source:
<code>protected void addTaskCleanUpProcessListener(final KModuleDeploymentUnit unit, final InternalKieContainer kieContainer) { final DeploymentDescriptor descriptor = getDeploymentDescriptor(unit, kieContainer); descriptor.getBuilder().addEventListener( new NamedObjectModel( <START> "mvel", <END> "taskCleanup", "new org.jbpm.services.task.admin.listener.TaskCleanUpProcessEventListener(taskService)" ) ); unit.setDeploymentDescriptor(descriptor); }</code><technical_language>here, ObjectModel instead NamedObjectModel</technical_language>

Target:
protected void addTaskCleanUpProcessListener(final KModuleDeploymentUnit unit, final InternalKieContainer kieContainer) { final DeploymentDescriptor descriptor = getDeploymentDescriptor(unit, kieContainer); descriptor.getBuilder().addEventListener( new ObjectModel( "mvel", "new org.jbpm.services.task.admin.listener.TaskCleanUpProcessEventListener(taskService)" ) ); unit.setDeploymentDescriptor(descriptor); }
Source:
<code>private Set<SupportedAdditionalClusterFeature> getAdditionalClusterFeaturesAdded() { Set<SupportedAdditionalClusterFeature> featuresSupported = <START> new HashSet<SupportedAdditionalClusterFeature>(getVdsGroup().getAddtionalFeaturesSupported()); <END> featuresSupported.removeAll(clusterFeatureDao.getSupportedFeaturesByClusterId(getVdsGroup().getId())); return featuresSupported; }</code><technical_language>i redeclaring type right side is needed</technical_language>

Target:
private Set<SupportedAdditionalClusterFeature> getAdditionalClusterFeaturesAdded() { Set<SupportedAdditionalClusterFeature> featuresSupported = new HashSet<>(getVdsGroup().getAddtionalFeaturesSupported()); featuresSupported.removeAll(clusterFeatureDao.getSupportedFeaturesByClusterId(getVdsGroup().getId())); return featuresSupported; }
Source:
<code>protected void populateColumnDataTypes(HashSet<String> columnNamesSet) throws SQLException { ResultSet rsColumns; DatabaseMetaData meta = store.getConnection().getMetaData(); rsColumns = meta.getColumns(null, null, getTablename().toUpperCase(), null); if (!rsColumns.isBeforeFirst()) { <START> rsColumns = meta.getColumns(null, null, getTablename().toLowerCase(), null); <END> } int totalColumns = columnNamesSet.size(); if (totalColumns == 0) { while (rsColumns.next()) { columnNames.add(rsColumns.getString("COLUMN_NAME")); columnNullabilities.add(rsColumns.getInt("NULLABLE")); columnDataTypes.add(rsColumns.getInt("DATA_TYPE")); } } else { while ((totalColumns > 0) && rsColumns.next()) { if (columnNamesSet.contains(rsColumns.getString("COLUMN_NAME").toUpperCase())) { columnNames.add(rsColumns.getString("COLUMN_NAME")); columnNullabilities.add(rsColumns.getInt("NULLABLE")); columnDataTypes.add(rsColumns.getInt("DATA_TYPE")); totalColumns--; } } } }</code><technical_language>if this is empty again? Please throw RuntimeException giving error message</technical_language>

Target:
protected void populateColumnDataTypes(HashSet<String> columnNamesSet) throws SQLException { ResultSet rsColumns; DatabaseMetaData meta = store.getConnection().getMetaData(); rsColumns = meta.getColumns(null, null, getTablename().toUpperCase(), null); if (!rsColumns.isBeforeFirst()) { rsColumns = meta.getColumns(null, null, getTablename().toLowerCase(), null); if (!rsColumns.isBeforeFirst()) { rsColumns = meta.getColumns(null, null, getTablename(), null); if (!rsColumns.isBeforeFirst()) { throw new RuntimeException("Table name not found"); } } } boolean readAllColumns = columnNamesSet.size() == 0 ? true : false; int remainingColumns = columnNamesSet.size(); while (rsColumns.next()) { if (readAllColumns || remainingColumns > 0) { if (readAllColumns || columnNamesSet.contains(rsColumns.getString("COLUMN_NAME").toUpperCase())) { columnNames.add(rsColumns.getString("COLUMN_NAME")); columnNullabilities.add(rsColumns.getInt("NULLABLE")); columnDataTypes.add(rsColumns.getInt("DATA_TYPE")); remainingColumns--; } } else { break; } } }
Source:
<code>protected void assertColumn(CharSequence expected, CharSequence tableName, int index) { <START> DefaultCairoConfiguration configuration = new DefaultCairoConfiguration(root); <END> try (TableReader reader = new TableReader(configuration, tableName)) { final StringSink sink = new StringSink(); final RecordCursorPrinter printer = new RecordCursorPrinter(sink); sink.clear(); printer.printFullColumn(reader.getCursor(), reader.getMetadata(), index, false); TestUtils.assertEquals(expected, sink); reader.getCursor().toTop(); sink.clear(); printer.printFullColumn(reader.getCursor(), reader.getMetadata(), index, false); TestUtils.assertEquals(expected, sink); } }</code><technical_language>consiguration instance this exists class level (static)</technical_language>

Target:
protected void assertColumn(CharSequence expected, CharSequence tableName, int index) { try (TableReader reader = new TableReader(configuration, tableName)) { final StringSink sink = new StringSink(); final RecordCursorPrinter printer = new RecordCursorPrinter(sink); sink.clear(); printer.printFullColumn(reader.getCursor(), reader.getMetadata(), index, false); TestUtils.assertEquals(expected, sink); reader.getCursor().toTop(); sink.clear(); printer.printFullColumn(reader.getCursor(), reader.getMetadata(), index, false); TestUtils.assertEquals(expected, sink); } }
Source:
<code>public List<String> removeAppLanguageCodes(@NonNull List<String> codes) { if (appLanguageCodes.size() > 1) { <START> for (String code : codes) { appLanguageCodes.remove(code); } <END> Prefs.setAppLanguageCodeCsv(StringUtil.listToCsv(appLanguageCodes)); } return appLanguageCodes; }</code><technical_language>loop replaced a call removeAll() instead</technical_language>

Target:
public List<String> removeAppLanguageCodes(@NonNull List<String> codes) { if (appLanguageCodes.size() > 1) { appLanguageCodes.removeAll(codes); if (appLanguageCodes.isEmpty()) { appLanguageCodes.addAll(getSystemLanguageCodes()); } Prefs.setAppLanguageCodeCsv(StringUtil.listToCsv(appLanguageCodes)); } return appLanguageCodes; }
Source:
<code>private void <START> refreshLabelAndIcon() <END> { if (getFigure() instanceof SiriusWrapLabel) { SiriusWrapLabel siriusWrapLabel = (SiriusWrapLabel) getFigure(); DDiagramElement dDiagramElement = resolveDiagramElement(); EditPart parent = getParent(); if (siriusWrapLabel != null && dDiagramElement != null && parent instanceof IDiagramElementEditPart) { DiagramElementEditPartOperation.refreshFont((IDiagramElementEditPart) parent, dDiagramElement, siriusWrapLabel); StyleConfiguration styleConfiguration = IStyleConfigurationRegistry.INSTANCE.getStyleConfiguration(dDiagramElement.getDiagramElementMapping(), dDiagramElement.getStyle()); Image labelIcon = new StyleConfigurationQuery(styleConfiguration).getLabelIcon(dDiagramElement, this); siriusWrapLabel.setText(dDiagramElement.getName()); siriusWrapLabel.setIcon(labelIcon); if (dDiagramElement instanceof DNode) { styleConfiguration.adaptNodeLabel((DNode) dDiagramElement, siriusWrapLabel); } } } }</code><technical_language>refreshLabelMethod method called ? AbstractGeneratedDiagramNameEditPart.refreshLabel() call hierarchy. some code refresh icon, style configuration all</technical_language>

Target:
private void refreshLabelAndIcon() { if (getFigure() instanceof SiriusWrapLabel) { SiriusWrapLabel siriusWrapLabel = (SiriusWrapLabel) getFigure(); DDiagramElement dDiagramElement = resolveDiagramElement(); EditPart parent = getParent(); if (parent instanceof IDiagramElementEditPart) { DiagramElementEditPartOperation.refreshLabelAndIcon((IDiagramElementEditPart) parent, dDiagramElement, siriusWrapLabel); } } }
Source:
<code>public PID getTransformedPid(PID originalPid) { return generateIds ? pidMinter.mintDepositRecordPid() : PIDs.get(DEPOSIT_RECORD_BASE, <START> originalPid.getUUID().toLowerCase()); <END> }</code><technical_language>For sake of consistency, getId() instead of getUUID(), for other lowercase calls</technical_language>

Target:
public PID getTransformedPid(PID originalPid) { return generateIds ? pidMinter.mintDepositRecordPid() : PIDs.get(DEPOSIT_RECORD_BASE, originalPid.getId().toLowerCase()); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Intent intent = new Intent(this, TopicActivity.class); <START> intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); <END> startActivity(intent); return true; } return super.onOptionsItemSelected(item); }</code><technical_language>1. Navigate teardowns. 2. Open search in menu drawer. 3. Hit button. 4. TeardownActivity is TopicActivity. finish() instead</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); }
Source:
<code>private PlanNodeStatsEstimate compute( PlanNodeStatsEstimate sourceStats, PlanNodeStatsEstimate filteringSourceStats, Symbol sourceJoinSymbol, Symbol filteringSourceJoinSymbol, BiFunction<SymbolStatsEstimate, SymbolStatsEstimate, Double> retainedNdvProvider) { SymbolStatsEstimate sourceJoinSymbolStats = sourceStats.getSymbolStatistics(sourceJoinSymbol); SymbolStatsEstimate filteringSourceJoinSymbolStats = filteringSourceStats.getSymbolStatistics(filteringSourceJoinSymbol); double retainedNDV = retainedNdvProvider.apply(sourceJoinSymbolStats, filteringSourceJoinSymbolStats); double filterFactor = sourceJoinSymbolStats.getValuesFraction() * retainedNDV / sourceJoinSymbolStats.getDistinctValuesCount(); SymbolStatsEstimate newSourceJoinSymbolStats = SymbolStatsEstimate.buildFrom(sourceJoinSymbolStats) .setNullsFraction(0) .setDistinctValuesCount(retainedNDV) .build(); <START> PlanNodeStatsEstimate outputStats = sourceStats.mapSymbolColumnStatistics(sourceJoinSymbol, oldStats -> newSourceJoinSymbolStats); <END> outputStats = outputStats.mapOutputRowCount(rowCount -> rowCount * filterFactor); return outputStats; }</code><technical_language>is a simple: PlanNodeStatsEstimate.builder(sourceStats) .setSymbolStatistics(sourceJoinSymbol, newSourceJoinSymbolStats) .setRowsCount(sourceStats.getRowCount() * filterFactor)</technical_language>

Target:
private static PlanNodeStatsEstimate compute( PlanNodeStatsEstimate sourceStats, PlanNodeStatsEstimate filteringSourceStats, Symbol sourceJoinSymbol, Symbol filteringSourceJoinSymbol, BiFunction<SymbolStatsEstimate, SymbolStatsEstimate, Double> retainedNdvProvider) { SymbolStatsEstimate sourceJoinSymbolStats = sourceStats.getSymbolStatistics(sourceJoinSymbol); SymbolStatsEstimate filteringSourceJoinSymbolStats = filteringSourceStats.getSymbolStatistics(filteringSourceJoinSymbol); double retainedNdv = retainedNdvProvider.apply(sourceJoinSymbolStats, filteringSourceJoinSymbolStats); double filterFactor = sourceJoinSymbolStats.getValuesFraction() * retainedNdv / sourceJoinSymbolStats.getDistinctValuesCount(); SymbolStatsEstimate newSourceJoinSymbolStats = SymbolStatsEstimate.buildFrom(sourceJoinSymbolStats) .setNullsFraction(0) .setDistinctValuesCount(retainedNdv) .build(); PlanNodeStatsEstimate outputStats = PlanNodeStatsEstimate.buildFrom(sourceStats) .addSymbolStatistics(sourceJoinSymbol, newSourceJoinSymbolStats) .setOutputRowCount(sourceStats.getOutputRowCount() * filterFactor) .build(); return outputStats; }