auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void getFathers_shouldReturnAllFathers() { RelationshipType type = Context.getPersonService().getRelationshipType(2); Person parent = Context.getPersonService().getPerson(6); Patient child = TestUtils.getPatient(2); parent.setGender("M"); Relationship rel = new Relationship(); rel.setRelationshipType(type); rel.setPersonA(parent); rel.setPersonB(child); Context.getPersonService().saveRelationship(rel); Assert.assertEquals(1, Context.getPersonService().getRelationships(parent, child, type).size()); <START> SimpleObject[] mother = controller.getFathers(child,ui); <END> Assert.assertTrue(mother.length >= 1); }</code><technical_language>"fathers"</technical_language>

Target:
public void getFathers_shouldReturnAllFathers() { RelationshipType type = Context.getPersonService().getRelationshipType(2); Person parent = Context.getPersonService().getPerson(6); Patient child = TestUtils.getPatient(2); parent.setGender("M"); Relationship rel = new Relationship(); rel.setRelationshipType(type); rel.setPersonA(parent); rel.setPersonB(child); Context.getPersonService().saveRelationship(rel); Assert.assertEquals(1, Context.getPersonService().getRelationships(parent, child, type).size()); SimpleObject[] fathers = controller.getFathers(child,ui); Assert.assertTrue(fathers.length >= 1); }
Source:
<code>private void initSqlQueries() { logger.debug("JDBC::initSqlQueries: '{}'", this.getClass().getSimpleName()); SQL_PING_DB = "SELECT 1"; SQL_GET_DB = "SELECT DATABASE()"; SQL_IF_TABLE_EXISTS = "SHOW TABLES LIKE '#searchTable#'"; SQL_CREATE_NEW_ENTRY_IN_ITEMS_TABLE = "INSERT INTO #itemsManageTable# (ItemName) VALUES ('#itemname#')"; SQL_CREATE_ITEMS_TABLE_IF_NOT = "CREATE TABLE IF NOT EXISTS #itemsManageTable# (ItemId INT NOT NULL AUTO_INCREMENT,#colname# #coltype# NOT NULL,PRIMARY KEY (ItemId))"; SQL_DELETE_ITEMS_ENTRY = "DELETE FROM items WHERE ItemName=#itemname#"; SQL_GET_ITEMID_TABLE_NAMES = "SELECT itemid, itemname FROM #itemsManageTable#"; SQL_GET_ITEM_TABLES = "SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema=#jdbcUriDatabaseName# AND NOT table_name=#itemsManageTable#"; <START> SQL_CREATE_ITEM_TABLE = "CREATE TABLE IF NOT EXISTS #tableName# (time #TABLEPRIMARYKEY# NOT NULL, value #dbType#, PRIMARY KEY(time))"; <END> SQL_INSERT_ITEM_VALUE = "INSERT INTO #tableName# (TIME, VALUE) VALUES( #TABLEPRIMARYVALUE#, ? ) ON DUPLICATE KEY UPDATE VALUE= ?"; }</code><technical_language>#TABLEPRIMARYKEY# (all caps) vs. #tablename# lowercase? (Same question for line below.)</technical_language>

Target:
private void initSqlQueries() { logger.debug("JDBC::initSqlQueries: '{}'", this.getClass().getSimpleName()); SQL_PING_DB = "SELECT 1"; SQL_GET_DB = "SELECT DATABASE()"; SQL_IF_TABLE_EXISTS = "SHOW TABLES LIKE '#searchTable#'"; SQL_CREATE_NEW_ENTRY_IN_ITEMS_TABLE = "INSERT INTO #itemsManageTable# (ItemName) VALUES ('#itemname#')"; SQL_CREATE_ITEMS_TABLE_IF_NOT = "CREATE TABLE IF NOT EXISTS #itemsManageTable# (ItemId INT NOT NULL AUTO_INCREMENT,#colname# #coltype# NOT NULL,PRIMARY KEY (ItemId))"; SQL_DELETE_ITEMS_ENTRY = "DELETE FROM items WHERE ItemName=#itemname#"; SQL_GET_ITEMID_TABLE_NAMES = "SELECT itemid, itemname FROM #itemsManageTable#"; SQL_GET_ITEM_TABLES = "SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema=#jdbcUriDatabaseName# AND NOT table_name=#itemsManageTable#"; SQL_CREATE_ITEM_TABLE = "CREATE TABLE IF NOT EXISTS #tableName# (time #tablePrimaryKey# NOT NULL, value #dbType#, PRIMARY KEY(time))"; SQL_INSERT_ITEM_VALUE = "INSERT INTO #tableName# (TIME, VALUE) VALUES( #tablePrimaryValue#, ? ) ON DUPLICATE KEY UPDATE VALUE= ?"; }
Source:
<code><START> public Flux<Integer> forceCloseHandles(String handleId, boolean recursive) { <END> return azureFileStorageClient.directorys().forceCloseHandlesWithRestResponseAsync(shareName, directoryName, handleId, null, null, snapshot, recursive, Context.NONE) .flatMapMany(response -> nextPageForForceCloseHandles(response, handleId, recursive)); }</code><technical_language>This is technically correct REST layer, usage is a bit flexible. For instance, handleId name of handle close, *, meaning close handles. Additionally, recursive sense if provided specific handleId close, REST endpoint undefined behavior (unless patched this) wildcard recursive=false specified. handled this in track 1 exposing methods: forceCloseHandle(String handleId) forceCloseAllHandles(boolean recursive), supplying missing parameter. This allowed guide users is expected use</technical_language>

Target:
public Flux<Integer> forceCloseHandles(String handleId, boolean recursive) { return azureFileStorageClient.directorys().forceCloseHandlesWithRestResponseAsync(shareName, directoryPath, handleId, null, null, snapshot, recursive, Context.NONE) .flatMapMany(response -> nextPageForForceCloseHandles(response, handleId, recursive)); }
Source:
<code>private WorkflowVersion setupServiceFilesForGitHubVersion(Triple<String, Date, String> ref, GHRepository repository, WorkflowVersion version, SourceFile dockstoreYml) { List<String> files; try { final DockstoreYaml12 dockstoreYaml12 = DockstoreYamlHelper.readAsDockstoreYaml12(dockstoreYml.getContent()); final List<Service12> services = dockstoreYaml12.getServices(); if (services.isEmpty()) { LOG.error(".dockstore.yml has no services"); return null; } files = services.get(0).getFiles(); } catch (DockstoreYamlHelper.DockstoreYamlException ex) { String msg = "Invalid .dockstore.yml"; LOG.error(msg, ex); return null; } for (String filePath: files) { String fileContent = this.readFileFromRepo(filePath, ref.getLeft(), repository); if (fileContent != null) { SourceFile file = new SourceFile(); file.setAbsolutePath(filePath); file.setPath(filePath); file.setContent(fileContent); file.setType(DescriptorLanguage.FileType.DOCKSTORE_SERVICE_OTHER); <START> Optional<String> sha = FileFormatHelper.calcSHA1(file.getContent()); <END> if (sha.isPresent()) { file.getChecksums().add(new Checksum(SHA_TYPE_FOR_SOURCEFILES, sha.get())); } version.getSourceFiles().add(file); } else { LOG.info("Could not find file " + filePath + " in repo " + repository); } } return version; }</code><technical_language>This is fine, FYI, write this (didn't try compile it, syntax off), is personal preference: FileFormatHelper.calcSHA1(file.getContent()).ifPresent(sha -> file.getChecksums().add(new Checksum(SHA_TYPE_FOR_SOURCEFILES, sha));</technical_language>

Target:
private WorkflowVersion setupServiceFilesForGitHubVersion(Triple<String, Date, String> ref, GHRepository repository, WorkflowVersion version, SourceFile dockstoreYml) { List<String> files; try { final DockstoreYaml12 dockstoreYaml12 = DockstoreYamlHelper.readAsDockstoreYaml12(dockstoreYml.getContent()); final List<Service12> services = dockstoreYaml12.getServices(); if (services.isEmpty()) { LOG.error(".dockstore.yml has no services"); return null; } files = services.get(0).getFiles(); } catch (DockstoreYamlHelper.DockstoreYamlException ex) { String msg = "Invalid .dockstore.yml"; LOG.error(msg, ex); return null; } for (String filePath: files) { String fileContent = this.readFileFromRepo(filePath, ref.getLeft(), repository); if (fileContent != null) { SourceFile file = new SourceFile(); file.setAbsolutePath(filePath); file.setPath(filePath); file.setContent(fileContent); file.setType(DescriptorLanguage.FileType.DOCKSTORE_SERVICE_OTHER); version.getSourceFiles().add(file); } else { LOG.info("Could not find file " + filePath + " in repo " + repository); } } return version; }
Source:
<code>protected boolean <START> validate() <END> { return super.validate() && isOperationAllowed(); }</code><technical_language>require complete input validation here. I miss validation of network error message if validation fails. Please NetworkValidator.networkIsSet(), create a Validator UpdateNetworkValidator</technical_language>

Target:
protected boolean validate() { AutodefineExternalNetworkValidator validator = new AutodefineExternalNetworkValidator(vmDao, getNetwork()); return validate(validator.networkIsSet(getParameters().getId())) && validate(validator.isVmNetwork()) && validate(validator.notExternalNetwork()); }
Source:
<code>public String getRelay(String number) { <START> String content = HttpUtil.executeUrl(GET, createURL() <END> + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword(), this.timeOut); content = XmlUtils.getContentOfElement(content, SUFFIX_RELAY + number); int status = Integer.parseInt(XmlUtils.getContentOfElement(content, "State")); if(status == 1) { return "ON"; } else { return "OFF"; } }</code><technical_language>Please extrace generated url a variable calling HttpUtil.executeUrl(), this debugging easier</technical_language>

Target:
public String getRelay(String number) { String URL = createURL() + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword(); String content = HttpUtil.executeUrl(GET, URL, this.timeOut); content = XmlUtils.getContentOfElement(content, SUFFIX_RELAY + number); int status = Integer.parseInt(XmlUtils.getContentOfElement(content, "State")); if(status == 1) { return "ON"; } else { return "OFF"; } }
Source:
<code><START> public static Double getSamplingInterval(Map<String, Object> properties) { <END> String samplingInterval = properties.get(LISTEN_SAMPLING_INTERVAL_PROP_NAME).toString(); return Double.parseDouble(samplingInterval); }</code><technical_language>primitive one</technical_language>

Target:
public static double getSamplingInterval(Map<String, Object> properties) { String samplingInterval = properties.get(LISTEN_SAMPLING_INTERVAL_PROP_NAME).toString(); return Double.parseDouble(samplingInterval); }
Source:
<code>public void getFileContentRest() throws Exception { Input in = new Input(); in.content = RestSession.newRawInput(CONTENT_NEW); assertEquals(204, session.putRaw(urlPut(), in.content).getStatusCode()); Optional<ChangeEdit> edit = editUtil.byChange(change); assertEquals(RefUpdate.Result.FORCED, modifier.modifyFile( edit.get(), FILE_NAME, CONTENT_NEW2)); edit = editUtil.byChange(change); RestResponse r = session.get(urlPut()); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); String content = r.getEntityContent(); <START> assertEquals(new String(CONTENT_NEW2, UTF_8), StringUtils.newStringUtf8( <END> Base64.decodeBase64(content))); }</code><technical_language>new String(foo, UTF_8) StringUtils.newStringUtf8(foo) in line? Pick :)</technical_language>

Target:
public void getFileContentRest() throws Exception { Put.Input in = new Put.Input(); in.content = RestSession.newRawInput(CONTENT_NEW); assertEquals(204, session.putRaw(urlEditFile(), in.content).getStatusCode()); Optional<ChangeEdit> edit = editUtil.byChange(change); assertEquals(RefUpdate.Result.FORCED, modifier.modifyFile( edit.get(), FILE_NAME, CONTENT_NEW2)); edit = editUtil.byChange(change); RestResponse r = session.get(urlEditFile()); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); String content = r.getEntityContent(); assertEquals(StringUtils.newStringUtf8(CONTENT_NEW2), StringUtils.newStringUtf8(Base64.decodeBase64(content))); }
Source:
<code>public int releaseExtraResources() { synchronized (lock) { int numReleasedResources = 0; <START> if (requestsQueue.isEmpty() && delayedRequestsQueue.isEmpty()) { <END> log.debug("Resource Requests Queue is empty."); if (hostAffinityEnabled) { List<String> allocatedHosts = getAllocatedHosts(); for (String host : allocatedHosts) { log.info("Releasing extra resources on host: {}", host); numReleasedResources += releaseResourcesForHost(host); } } else { numReleasedResources += releaseResourcesForHost(ANY_HOST); } clearState(); } return numReleasedResources; } }</code><technical_language>need check delayedRequestsQueue here, a resource-request for in delayedRequestsQueue out requests no-longer delayed. implication of this is if requestsQueue is empty delayedRequestsQueue is not, CPM continue hold allocated resources, in worst case for a period of 5 mins (default). Aggregated num_containers, significant especially in resource-crunch scenarios. Alternatively, release resource requestsQueue, a request in delayedRequestsQueue "expires", send out request YARN-RM allocation flow resume</technical_language>

Target:
public int releaseExtraResources() { synchronized (lock) { int numReleasedResources = 0; if (requestsQueue.isEmpty()) { log.debug("Resource Requests Queue is empty."); if (hostAffinityEnabled) { List<String> allocatedHosts = getAllocatedHosts(); for (String host : allocatedHosts) { log.info("Releasing extra resources on host: {}", host); numReleasedResources += releaseResourcesForHost(host); } } else { numReleasedResources += releaseResourcesForHost(ANY_HOST); } clearState(); } return numReleasedResources; } }
Source:
<code>private List<HostNetwork> calculateNetworksToConfigure() { List<HostNetwork> networksToConfigure = new ArrayList<>(getParameters().getNetworkAttachments().size()); BusinessEntityMap<VdsNetworkInterface> nics = getExistingNicsBusinessEntityMap(); List<NetworkAttachment> attachmentsWithMissingUpdatedDefaultRoute = <START> getAttachmentsWithMissingUpdatedDefaultRoute(); <END> reportIpv6GatewayRemoval(findPreviousDefaultRouteNic(), attachmentsWithMissingUpdatedDefaultRoute); for (NetworkAttachment attachment : attachmentsWithMissingUpdatedDefaultRoute) { Network network = existingNetworkRelatedToAttachment(attachment); NetworkCluster networkCluster = network.getCluster(); HostNetwork networkToConfigure = new HostNetwork(network, attachment); networkToConfigure.setBonding(isBonding(attachment, nics)); boolean isDefaultRoute = defaultRouteSupported() && networkCluster.isDefaultRoute(); if (isDefaultRoute) { DnsResolverConfiguration dnsResolverConfiguration = getDnsConfigurationFromNetworkOrItsAttachment(attachment, network); if (dnsResolverConfiguration != null) { networkToConfigure.setNameServers(dnsResolverConfiguration.getNameServers()); } } networkToConfigure.setDefaultRoute(isDefaultRoute); if (NetworkUtils.qosConfiguredOnInterface(attachment, network)) { networkToConfigure.setQosConfiguredOnInterface(true); HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos(attachment, network); networkToConfigure.setQos(hostNetworkQos); } networksToConfigure.add(networkToConfigure); } return networksToConfigure; }</code><technical_language>nit: Formatting</technical_language>

Target:
private List<HostNetwork> calculateNetworksToConfigure() { List<HostNetwork> networksToConfigure = new ArrayList<>(getParameters().getNetworkAttachments().size()); BusinessEntityMap<VdsNetworkInterface> nics = getExistingNicsBusinessEntityMap(); List<NetworkAttachment> attachments = getAttachmentsWithMissingUpdatedDefaultRoute(); reportIpv6GatewayRemoval(findPreviousDefaultRouteNic(), attachments); for (NetworkAttachment attachment : attachments) { Network network = existingNetworkRelatedToAttachment(attachment); NetworkCluster networkCluster = network.getCluster(); HostNetwork networkToConfigure = new HostNetwork(network, attachment); networkToConfigure.setBonding(isBonding(attachment, nics)); boolean isDefaultRoute = defaultRouteSupported() && networkCluster.isDefaultRoute(); if (isDefaultRoute) { DnsResolverConfiguration dnsResolverConfiguration = getDnsConfigurationFromNetworkOrItsAttachment(attachment, network); if (dnsResolverConfiguration != null) { networkToConfigure.setNameServers(dnsResolverConfiguration.getNameServers()); } } networkToConfigure.setDefaultRoute(isDefaultRoute); if (NetworkUtils.qosConfiguredOnInterface(attachment, network)) { networkToConfigure.setQosConfiguredOnInterface(true); HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos(attachment, network); networkToConfigure.setQos(hostNetworkQos); } networksToConfigure.add(networkToConfigure); } return networksToConfigure; }
Source:
<code>public void entryRemoved(CacheEntryEvent<? extends String, ? extends CacheEntry> cacheEntryEvent) throws CacheEntryListenerException { AccessTokenDO accessTokenDO = (AccessTokenDO) cacheEntryEvent.getValue(); if (accessTokenDO != null) { if (log.isDebugEnabled()) { log.debug("OAuth cache removed for consumer id : " + accessTokenDO.getConsumerKey()); } String cacheKeyString = <START> accessTokenDO.getConsumerKey() + ":" + accessTokenDO.getAuthzUser().getUserName().toLowerCase() <END> + ":" + OAuth2Util.buildScopeString(accessTokenDO.getScope()); OAuthCacheKey oauthcacheKey = new OAuthCacheKey(cacheKeyString); OAuthCache oauthCache = OAuthCache .getInstance(OAuthServerConfiguration.getInstance().getOAuthCacheTimeout()); oauthCache.clearCacheEntry(accessTokenDO.getAccessToken()); oauthCache.clearCacheEntry(oauthcacheKey); } }</code><technical_language>Need check user store case sensitivity concatenating username. if user store is case insensitive case adding add is. OAuthCache for reference</technical_language>

Target:
public void entryRemoved(CacheEntryEvent<? extends String, ? extends CacheEntry> cacheEntryEvent) throws CacheEntryListenerException { AccessTokenDO accessTokenDO = (AccessTokenDO) cacheEntryEvent.getValue(); if (accessTokenDO != null) { if (log.isDebugEnabled()) { log.debug("OAuth cache removed for consumer id : " + accessTokenDO.getConsumerKey()); } boolean isUsernameCaseSensitive = IdentityUtil .isUserStoreInUsernameCaseSensitive(accessTokenDO.getAuthzUser().getUserName()); String cacheKeyString; if (isUsernameCaseSensitive){ cacheKeyString = accessTokenDO.getConsumerKey() + ":" + accessTokenDO.getAuthzUser().getUserName() + ":" + OAuth2Util.buildScopeString(accessTokenDO.getScope()); }else { cacheKeyString = accessTokenDO.getConsumerKey() + ":" + accessTokenDO.getAuthzUser().getUserName().toLowerCase() + ":" + OAuth2Util.buildScopeString(accessTokenDO.getScope()); } OAuthCacheKey oauthcacheKey = new OAuthCacheKey(cacheKeyString); OAuthCache oauthCache = OAuthCache .getInstance(OAuthServerConfiguration.getInstance().getOAuthCacheTimeout()); oauthCache.clearCacheEntry(oauthcacheKey); oauthcacheKey = new OAuthCacheKey(accessTokenDO.getAccessToken()); oauthCache.clearCacheEntry(oauthcacheKey); } }
Source:
<code>public void persistCompletedBatch(CompletedDownloadBatch completedDownloadBatch) { DownloadBatchId downloadBatchId = completedDownloadBatch.downloadBatchId(); DownloadBatchTitle downloadBatchTitle = completedDownloadBatch.downloadBatchTitle(); DownloadBatchStatus.Status downloadBatchStatus = DownloadBatchStatus.Status.DOWNLOADED; long downloadedDateTimeInMillis = completedDownloadBatch.downloadedDateTimeInMillis(); DownloadsBatchPersisted persistedBatch = new LiteDownloadsBatchPersisted( downloadBatchTitle, downloadBatchId, downloadBatchStatus, downloadedDateTimeInMillis, true ); persistBatch(persistedBatch); for (CompletedDownloadBatch.CompletedDownloadFile completedDownloadFile : completedDownloadBatch.completedDownloadFiles()) { String url = completedDownloadFile.originalNetworkAddress(); String rawDownloadFileId = rawFileIdFrom(completedDownloadBatch.downloadBatchTitle(), completedDownloadFile); <START> DownloadFileId downloadFileId = DownloadFileIdCreator.createFrom(rawDownloadFileId); <END> DownloadsFilePersisted persistedFile = new LiteDownloadsFilePersisted( downloadBatchId, downloadFileId, new LiteFilePath(completedDownloadFile.newFileLocation()), completedDownloadFile.fileSize().totalSize(), url, FilePersistenceType.INTERNAL ); persistFile(persistedFile); } }</code><technical_language>do a check for duplicates here, throwing in case files id</technical_language>

Target:
public void persistCompletedBatch(CompletedDownloadBatch completedDownloadBatch) { DownloadBatchId downloadBatchId = completedDownloadBatch.downloadBatchId(); DownloadBatchTitle downloadBatchTitle = completedDownloadBatch.downloadBatchTitle(); DownloadBatchStatus.Status downloadBatchStatus = DownloadBatchStatus.Status.DOWNLOADED; long downloadedDateTimeInMillis = completedDownloadBatch.downloadedDateTimeInMillis(); DownloadsBatchPersisted persistedBatch = new LiteDownloadsBatchPersisted( downloadBatchTitle, downloadBatchId, downloadBatchStatus, downloadedDateTimeInMillis, NOTIFICATION_SEEN ); persistBatch(persistedBatch); for (CompletedDownloadBatch.CompletedDownloadFile completedDownloadFile : completedDownloadBatch.completedDownloadFiles()) { String url = completedDownloadFile.originalNetworkAddress(); String rawDownloadFileId = rawFileIdFrom(completedDownloadBatch.downloadBatchTitle(), completedDownloadFile); DownloadFileId downloadFileId = DownloadFileIdCreator.createFrom(rawDownloadFileId); DownloadsFilePersisted persistedFile = new LiteDownloadsFilePersisted( downloadBatchId, downloadFileId, new LiteFilePath(completedDownloadFile.newFileLocation()), completedDownloadFile.fileSize().totalSize(), url, FilePersistenceType.INTERNAL ); persistFile(persistedFile); } }
Source:
<code>public synchronized Iterable<Entity> getAllEntitiesInApplication(Application application) { Predicate<Entity> predicate = EntityPredicates.applicationIdEqualTo(application.getId()); Iterable<Entity> allentities = Iterables.concat(preRegisteredEntitiesById.values(), preManagedEntitiesById.values(), entityProxiesById.values()); Iterable<Entity> result = Iterables.filter(allentities, predicate); return ImmutableList.copyOf(Iterables.transform(result, new Function<Entity, Entity>() { @Override public Entity apply(Entity input) { <START> return (input == null) ? null : input instanceof Proxy ? input : ((AbstractEntity)input).getProxy(); <END> }})); }</code><technical_language>((AbstractEntity)input).getProxyIfAvailable(). This is for legacy entities (where constructor called), proxy object is available</technical_language>

Target:
public synchronized Iterable<Entity> getAllEntitiesInApplication(Application application) { Predicate<Entity> predicate = EntityPredicates.applicationIdEqualTo(application.getId()); Iterable<Entity> allentities = Iterables.concat(preRegisteredEntitiesById.values(), preManagedEntitiesById.values(), entityProxiesById.values()); Iterable<Entity> result = Iterables.filter(allentities, predicate); return ImmutableSet.copyOf(Iterables.transform(result, new Function<Entity, Entity>() { @Override public Entity apply(Entity input) { return (input == null) ? null : input instanceof Proxy ? input : ((AbstractEntity)input).getProxyIfAvailable(); }})); }
Source:
<code>public void submitFeedback(List<AlarmFeedback> alarmFeedback) { FeedbackRepository feedbackRepository = getRepository(); if (feedbackRepository == null) { throw new RuntimeException("Could not find a feedback repository"); } List<org.opennms.features.situationfeedback.api.AlarmFeedback> mappedFeedback = alarmFeedback.stream() .map(ModelMappers::fromFeedback) .collect(Collectors.toList()); try { feedbackRepository.persist(mappedFeedback); } catch (Exception e) { throw new RuntimeException("Failed to execute query: " + e.getMessage(), e); } <START> alarmFeedbackListeners.forEach(listener -> { <END> try { listener.handleAlarmFeedback(mappedFeedback); } catch (Exception e) { LOG.warn("Failed to notify listener of alarm feedback", e); } }); }</code><technical_language>move logic of invoking listeners repository duplicating here? is stand, wants repository is responsible for managing calling listeners</technical_language>

Target:
public void submitFeedback(List<AlarmFeedback> alarmFeedback) { FeedbackRepository feedbackRepository = getRepository(); if (feedbackRepository == null) { throw new RuntimeException("Could not find a feedback repository"); } List<org.opennms.features.situationfeedback.api.AlarmFeedback> mappedFeedback = alarmFeedback.stream() .map(ModelMappers::fromFeedback) .collect(Collectors.toList()); try { feedbackRepository.persist(mappedFeedback); } catch (Exception e) { throw new RuntimeException("Failed to execute query: " + e.getMessage(), e); } }
Source:
<code>protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { AddDiskCommand<AddDiskParameters> addDiskCommand = (AddDiskCommand<AddDiskParameters>) command; AddDiskParameters <START> parameters = <END> addDiskCommand.getParameters(); if (addDiskCommand.getChildActionType() != ActionType.AddImageFromScratch) { super.childCommandsExecutionEnded(command, anyFailed, childCmdIds, status, completedChildren); return; } else { DiskImage di = (DiskImage) parameters.getDiskInfo(); log.info("Getting volume info for image '{}/{}'", di.getId(), di.getImageId()); try { DiskImage fromVdsm = imagesHandler.getVolumeInfoFromVdsm(di.getStoragePoolId(), di.getStorageIds().get(0), di.getId(), di.getImageId()); log.info("Updating size from '{}' to '{}'", di.getSize(), fromVdsm.getSize()); TransactionSupport.executeInNewTransaction(() -> { imageDao.updateImageSize(fromVdsm.getImageId(), fromVdsm.getSize()); return null; }); } catch (Exception e) { log.error("Failed to get volume info", e); setCommandEndStatus(command, true, status, childCmdIds); throw e; } setCommandEndStatus(command, false, status, childCmdIds); } }</code><technical_language>inlined compromising redability</technical_language>

Target:
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { AddDiskCommand<AddDiskParameters> addDiskCommand = (AddDiskCommand<AddDiskParameters>) command; if (addDiskCommand.getChildActionType() != ActionType.AddImageFromScratch) { super.childCommandsExecutionEnded(command, anyFailed, childCmdIds, status, completedChildren); return; } DiskImage diskImage = (DiskImage) addDiskCommand.getParameters().getDiskInfo(); log.info("Getting volume info for image '{}/{}'", diskImage.getId(), diskImage.getImageId()); try { DiskImage fromVdsm = imagesHandler.getVolumeInfoFromVdsm(diskImage.getStoragePoolId(), diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId()); if (fromVdsm.getSize() != diskImage.getSize()) { log.info("Updating size from '{}' to '{}'", diskImage.getSize(), fromVdsm.getSize()); TransactionSupport.executeInNewTransaction(() -> { imageDao.updateImageSize(fromVdsm.getImageId(), fromVdsm.getSize()); return null; }); } } catch (Exception e) { log.error("Failed to get volume info", e); setCommandEndStatus(command, true, status, childCmdIds); throw e; } setCommandEndStatus(command, false, status, childCmdIds); }
Source:
<code><START> public void reset() { <END> this.netServiceLevel = 0; this.execStartTime = 0.0; this.status = Status.INSTANTIATED; this.priority = 0; this.lastExecutedDatacenterIdx = NOT_ASSIGNED; setBroker(DatacenterBroker.NULL); setFinishTime(NOT_ASSIGNED); setVm(Vm.NULL); setExecStartTime(0.0); datacenterExecutionList.clear(); this.setLastTriedDatacenter(Datacenter.NULL); }</code><technical_language>method is called a constructor, set final avoid "Constructor Calls Overridable Method" issue</technical_language>

Target:
public final Cloudlet reset() { this.netServiceLevel = 0; this.execStartTime = 0.0; this.status = Status.INSTANTIATED; this.priority = 0; this.lastExecutedDatacenterIdx = NOT_ASSIGNED; setBroker(DatacenterBroker.NULL); setFinishTime(NOT_ASSIGNED); setVm(Vm.NULL); setExecStartTime(0.0); datacenterExecutionList.clear(); this.setLastTriedDatacenter(Datacenter.NULL); return this; }
Source:
<code>public GeometryCollection(final CoordinateReferenceSystem coordinateReferenceSystem, final List<Geometry> geometries) { super(coordinateReferenceSystem); notNull("geometries", geometries); <START> isTrueArgument("geometrys contain only non-null elements", !geometries.contains(null)); <END> this.geometries = Collections.unmodifiableList(geometries); }</code><technical_language>Suggestion: "geometrys null values"</technical_language>

Target:
public GeometryCollection(final CoordinateReferenceSystem coordinateReferenceSystem, final List<Geometry> geometries) { super(coordinateReferenceSystem); notNull("geometries", geometries); isTrueArgument("geometries contains only non-null elements", !geometries.contains(null)); this.geometries = Collections.unmodifiableList(geometries); }
Source:
<code>public static String createSas(String endpoint, OffsetDateTime expirationTime, AzureKeyCredential keyCredential) { try { String resKey = "r"; String expKey = "e"; String signKey = "s"; Charset charset = StandardCharsets.UTF_8; String encodedResource = URLEncoder.encode(endpoint, charset.name()); String encodedExpiration = URLEncoder.encode(expirationTime.atZoneSameInstant(ZoneOffset.UTC).format( DateTimeFormatter.ofPattern("M/d/yyyy h:m:s a")), charset.name()); String unsignedSas = String.format("%s=%s&%s=%s", resKey, encodedResource, expKey, encodedExpiration); Mac hmac = Mac.getInstance("hmacSHA256"); hmac.init(new SecretKeySpec(Base64.getDecoder().decode(keyCredential.getKey()), "hmacSHA256")); String signature = new String(Base64.getEncoder().encode( hmac.doFinal(unsignedSas.getBytes(charset))), charset); String encodedSignature = URLEncoder.encode(signature, charset.name()); return String.format("%s&%s=%s", unsignedSas, signKey, encodedSignature); } catch (NoSuchAlgorithmException | UnsupportedEncodingException | InvalidKeyException e) { <START> e.printStackTrace(); <END> } return null; }</code><technical_language>logs instead of e.printStackTrace()</technical_language>

Target:
public static String createSas(String endpoint, OffsetDateTime expirationTime, AzureKeyCredential keyCredential) { try { String resKey = "r"; String expKey = "e"; String signKey = "s"; Charset charset = StandardCharsets.UTF_8; String encodedResource = URLEncoder.encode(endpoint, charset.name()); String encodedExpiration = URLEncoder.encode(expirationTime.atZoneSameInstant(ZoneOffset.UTC).format( DateTimeFormatter.ofPattern("M/d/yyyy h:m:s a")), charset.name()); String unsignedSas = String.format("%s=%s&%s=%s", resKey, encodedResource, expKey, encodedExpiration); Mac hmac = Mac.getInstance("hmacSHA256"); hmac.init(new SecretKeySpec(Base64.getDecoder().decode(keyCredential.getKey()), "hmacSHA256")); String signature = new String(Base64.getEncoder().encode( hmac.doFinal(unsignedSas.getBytes(charset))), charset); String encodedSignature = URLEncoder.encode(signature, charset.name()); return String.format("%s&%s=%s", unsignedSas, signKey, encodedSignature); } catch (NoSuchAlgorithmException | UnsupportedEncodingException | InvalidKeyException e) { throw logger.logExceptionAsError(new RuntimeException(e)); } }
Source:
<code>private void parseDataSource(XMLExtendedStreamReader reader, DataSourcesConfigurationBuilder dataSourcesBuilder) throws XMLStreamException { String[] attributes = ParseUtils.requireAttributes(reader, Attribute.NAME, Attribute.JNDI_NAME); String name = attributes[0]; String jndiName = attributes[1]; DataSourceConfigurationBuilder dataSourceBuilder = dataSourcesBuilder.dataSource(name, jndiName); for (int i = 0; i < reader.getAttributeCount(); i++) { ParseUtils.requireNoNamespaceAttribute(reader, i); String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case JNDI_NAME: case NAME: break; case STATISTICS: <START> Boolean.parseBoolean(value); <END> break; default: throw ParseUtils.unexpectedAttribute(reader, i); } } Element element = nextElement(reader); if (element != Element.CONNECTION_FACTORY) { throw ParseUtils.unexpectedElement(reader, element); } parseDataSourceConnectionFactory(reader, dataSourceBuilder); element = nextElement(reader); if (element != Element.CONNECTION_POOL) { throw ParseUtils.unexpectedElement(reader, element); } parseDataSourceConnectionPool(reader, dataSourceBuilder); element = nextElement(reader); if (element != null) { throw ParseUtils.unexpectedElement(reader, element); } }</code><technical_language>do</technical_language>

Target:
private void parseDataSource(XMLExtendedStreamReader reader, DataSourcesConfigurationBuilder dataSourcesBuilder) throws XMLStreamException { String[] attributes = ParseUtils.requireAttributes(reader, Attribute.NAME, Attribute.JNDI_NAME); String name = attributes[0]; String jndiName = attributes[1]; DataSourceConfigurationBuilder dataSourceBuilder = dataSourcesBuilder.dataSource(name, jndiName); for (int i = 0; i < reader.getAttributeCount(); i++) { ParseUtils.requireNoNamespaceAttribute(reader, i); String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case JNDI_NAME: case NAME: break; case STATISTICS: dataSourceBuilder.statistics(Boolean.parseBoolean(value)); break; default: throw ParseUtils.unexpectedAttribute(reader, i); } } Element element = nextElement(reader); if (element != Element.CONNECTION_FACTORY) { throw ParseUtils.unexpectedElement(reader, element); } parseDataSourceConnectionFactory(reader, dataSourceBuilder); element = nextElement(reader); if (element != Element.CONNECTION_POOL) { throw ParseUtils.unexpectedElement(reader, element); } parseDataSourceConnectionPool(reader, dataSourceBuilder); element = nextElement(reader); if (element != null) { throw ParseUtils.unexpectedElement(reader, element); } }
Source:
<code>public static StorageServiceProperties create(final AccountType accountType, final Date creationTime, final Map<String, String> primaryEndpoints, final String primaryLocation, final Status provisioningState, final Map<String, String> secondaryEndpoints, final String secondaryLocation, final RegionStatus statusOfPrimary, final RegionStatus statusOfSecondary) { return new AutoValue_StorageService_StorageServiceProperties(accountType, creationTime, primaryEndpoints, primaryLocation, provisioningState, <START> secondaryEndpoints, secondaryLocation, statusOfPrimary, statusOfSecondary); <END> }</code><technical_language>Do want null maps here? follow pattern default empty ones</technical_language>

Target:
public static StorageServiceProperties create(final AccountType accountType, final Date creationTime, final Map<String, String> primaryEndpoints, final String primaryLocation, final Status provisioningState, final Map<String, String> secondaryEndpoints, final String secondaryLocation, final RegionStatus statusOfPrimary, final RegionStatus statusOfSecondary) { return new AutoValue_StorageService_StorageServiceProperties(accountType, creationTime, primaryEndpoints == null ? ImmutableMap.<String, String>builder().build() : ImmutableMap.copyOf(primaryEndpoints), primaryLocation, provisioningState, secondaryEndpoints == null ? ImmutableMap.<String, String>builder().build() : ImmutableMap.copyOf(secondaryEndpoints), secondaryLocation, statusOfPrimary, statusOfSecondary); }
Source:
<code>public Set<String> setNodesAvailable(Set<String> nodeUrls) { waitForRMCoreToBeInitialized(); if (logger.isTraceEnabled()) { logger.trace("Received availability for the following workers: " + nodeUrls); } ImmutableSet.Builder<String> nodeUrlsNotKnownByTheRM = new ImmutableSet.Builder<>(); for (String nodeUrl : nodeUrls) { RMNode node = this.allNodes.get(nodeUrl); if (node == null) { logger.warn("Cannot set node as available, the node is unknown: " + nodeUrl); if (logger.isDebugEnabled()) { <START> logger.warn("Known nodes are: " + Arrays.toString(allNodes.keySet().toArray())); <END> } nodeUrlsNotKnownByTheRM.add(nodeUrl); } else if (node.isDown()) { restoreNodeState(nodeUrl, node); } else { if (logger.isDebugEnabled()) { logger.debug("The node identified by " + nodeUrl + " is known and not DOWN, no action performed"); } } } return nodeUrlsNotKnownByTheRM.build(); }</code><technical_language>logger.debug more here, warning is handled in previous log</technical_language>

Target:
public Set<String> setNodesAvailable(Set<String> nodeUrls) { waitForRMCoreToBeInitialized(); if (logger.isTraceEnabled()) { logger.trace("Received availability for the following workers: " + nodeUrls); } ImmutableSet.Builder<String> nodeUrlsNotKnownByTheRM = new ImmutableSet.Builder<>(); for (String nodeUrl : nodeUrls) { RMNode node = this.allNodes.get(nodeUrl); if (node == null) { logger.warn("Cannot set node as available, the node is unknown: " + nodeUrl); if (logger.isDebugEnabled()) { logger.debug("Known nodes are: " + Arrays.toString(allNodes.keySet().toArray())); } nodeUrlsNotKnownByTheRM.add(nodeUrl); } else if (node.isDown()) { restoreNodeState(nodeUrl, node); } else { if (logger.isDebugEnabled()) { logger.debug("The node identified by " + nodeUrl + " is known and not DOWN, no action performed"); } } } return nodeUrlsNotKnownByTheRM.build(); }
Source:
<code><START> public String removeEndComma(String str) { <END> return str.substring(0, str.length() - 2); }</code><technical_language>a need set this public. private better</technical_language>

Target:
private String removeEndComma(String str) { return str.substring(0, str.length() - 2); }
Source:
<code>public void decorateTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry, TimeChartEvent parentEvent) { Iterator<ITimeEvent> iterator = timeAnalysisEntry.getTimeEventsIterator(0, Long.MAX_VALUE, Long.MAX_VALUE); TimeChartEvent event = null; int entryPriority = ColorSettingsManager.PRIORITY_NONE; boolean entryIsBookmarked = false; boolean entryIsVisible = false; boolean entryIsSearchMatch = false; boolean hasNext = true; while (!interrupted && hasNext) { synchronized (timeAnalysisEntry) { hasNext = iterator.hasNext(); <START> event = (TimeChartEvent) iterator.next(); <END> } if (hasNext) { if (event.getItemizedEntry() == null) { decorateEvent(event); } else { decorateTraceEntry(event.getItemizedEntry(), event); } entryPriority = Math.min(entryPriority, event.getColorSettingPriority()); entryIsBookmarked |= event.isBookmarked(); entryIsVisible |= event.isVisible(); entryIsSearchMatch |= event.isSearchMatch(); if (++fCount % timeAnalysisEntry.getTrace().getCacheSize() == 0) { redrawViewer(false); } } } if (parentEvent != null) { parentEvent.setColorSettingPriority(entryPriority); parentEvent.setIsBookmarked(entryIsBookmarked); parentEvent.setIsVisible(entryIsVisible); parentEvent.setIsSearchMatch(entryIsSearchMatch); } }</code><technical_language>NoSuchElementException thrown</technical_language>

Target:
public void decorateTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry, TimeChartEvent parentEvent) { Iterator<ITimeEvent> iterator = timeAnalysisEntry.getTimeEventsIterator(0, Long.MAX_VALUE, Long.MAX_VALUE); TimeChartEvent event = null; int entryPriority = ColorSettingsManager.PRIORITY_NONE; boolean entryIsBookmarked = false; boolean entryIsVisible = false; boolean entryIsSearchMatch = false; boolean hasNext = true; while (!interrupted && hasNext) { synchronized (timeAnalysisEntry) { while ((hasNext = iterator.hasNext()) == true) { event = (TimeChartEvent) iterator.next(); break; } } if (hasNext && event != null) { if (event.getItemizedEntry() == null) { decorateEvent(event); } else { decorateTraceEntry(event.getItemizedEntry(), event); } entryPriority = Math.min(entryPriority, event.getColorSettingPriority()); entryIsBookmarked |= event.isBookmarked(); entryIsVisible |= event.isVisible(); entryIsSearchMatch |= event.isSearchMatch(); if (++fCount % timeAnalysisEntry.getTrace().getCacheSize() == 0) { redrawViewer(false); } } } if (parentEvent != null) { parentEvent.setColorSettingPriority(entryPriority); parentEvent.setIsBookmarked(entryIsBookmarked); parentEvent.setIsVisible(entryIsVisible); parentEvent.setIsSearchMatch(entryIsSearchMatch); } }
Source:
<code>static Path getConfigDirectory() { Path configPath; <START> if (System.getProperty("os.name").toLowerCase().contains("windows")) { <END> String appdata = System.getenv("APPDATA"); if (appdata == null) { configPath = Paths.get(System.getProperty("user.home")); } else { configPath = Paths.get(appdata); } } else { String configEnv = System.getenv("XDG_CONFIG_HOME"); if (configEnv != null && configEnv.length() > 0) { configPath = Paths.get(configEnv); } else { configPath = Paths.get(System.getProperty("user.home")).resolve(".config"); } } return configPath.resolve("tmc"); }</code><technical_language>dependent Apache Commons? If yes, this instead: <LINK_0></technical_language>

Target:
static Path getConfigDirectory() { Path configPath; if (SystemUtils.IS_OS_WINDOWS) { String appdata = System.getenv("APPDATA"); if (appdata == null) { configPath = Paths.get(System.getProperty("user.home")); } else { configPath = Paths.get(appdata); } } else { String configEnv = System.getenv("XDG_CONFIG_HOME"); if (configEnv != null && configEnv.length() > 0) { configPath = Paths.get(configEnv); } else { configPath = Paths.get(System.getProperty("user.home")).resolve(".config"); } } return configPath.resolve("tmc"); }
Source:
<code>public void onMessage(ChillModeStatus chillModeStatus, EventPublisher publisher) { isInChillMode.set(chillModeStatus.getChillModeStatus()); scmClientProtocolServer.setChillModeStatus(isInChillMode.get()); scmBlockManager.setChillModeStatus(isInChillMode.get()); if (!isInChillMode.get()) { final Thread chillModeExitThread = new Thread(() -> { try { Thread.sleep(waitTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } replicationManager.start(); <START> pipelineCleanupThread.start(); <END> }); chillModeExitThread.setDaemon(true); chillModeExitThread.start(); } }</code><technical_language>execute pipeline cleanup logic in chillModeExitThread itself, instead of starting a new one</technical_language>

Target:
public void onMessage(ChillModeStatus chillModeStatus, EventPublisher publisher) { isInChillMode.set(chillModeStatus.getChillModeStatus()); scmClientProtocolServer.setChillModeStatus(isInChillMode.get()); scmBlockManager.setChillModeStatus(isInChillMode.get()); if (!isInChillMode.get()) { final Thread chillModeExitThread = new Thread(() -> { try { Thread.sleep(waitTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } replicationManager.start(); cleanupPipelines(); }); chillModeExitThread.setDaemon(true); chillModeExitThread.start(); } }
Source:
<code>public SynchronousDispatcherMessageHandler(Processor processor) { <START> Assert.notNull(processor, "ReactorModule cannot be null."); <END> this.reactorProcessor = processor; Environment.initializeIfEmpty(); Method method = ReflectionUtils.findMethod(this.reactorProcessor.getClass(), "process", Stream.class); this.inputType = ResolvableType.forMethodParameter(method, 0).getNested(2); this.stream = Streams.broadcast(); Stream<?> outputStream = processor.process(stream); outputStream.when(Throwable.class, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { logger.error(throwable); } }); this.consume = outputStream.consume(new Consumer<Object>() { @Override public void accept(Object outputObject) { if (ClassUtils.isAssignable(Message.class, outputObject.getClass())) { getOutputChannel().send((Message) outputObject); } else { getOutputChannel().send(MessageBuilder.withPayload(outputObject).build()); } } }); if (logger.isDebugEnabled()) { logger.debug(consume.debug()); } }</code><technical_language>ReactorModule</technical_language>

Target:
public SynchronousDispatcherMessageHandler(Processor processor) { Assert.notNull(processor, "processor cannot be null."); this.reactorProcessor = processor; Environment.initializeIfEmpty(); Method method = ReflectionUtils.findMethod(this.reactorProcessor.getClass(), "process", Stream.class); this.inputType = ResolvableType.forMethodParameter(method, 0).getNested(2); this.stream = Streams.broadcast(); Stream<?> outputStream = processor.process(stream); outputStream.when(Throwable.class, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { logger.error(throwable); } }); this.consume = outputStream.consume(new Consumer<Object>() { @Override public void accept(Object outputObject) { if (ClassUtils.isAssignable(Message.class, outputObject.getClass())) { getOutputChannel().send((Message) outputObject); } else { getOutputChannel().send(MessageBuilder.withPayload(outputObject).build()); } } }); if (logger.isDebugEnabled()) { logger.debug(consume.debug()); } }
Source:
<code>public String filter(URL sourceUrl, Map<String, String[]> sourceMetadata, String urlToFilter) { <START> if (!ignoreOutsideHost && !ignoreOutsideDomain) { <END> return urlToFilter; } URL tURL; try { tURL = new URL(urlToFilter); } catch (MalformedURLException e1) { return null; } String fromHost; String fromDomain = null; if (sourceUrl == previousSourceUrl) { fromHost = previousSourceHost; if (ignoreOutsideDomain) { fromDomain = previousSourceDomain; } } else { fromHost = sourceUrl.getHost(); if (ignoreOutsideDomain) { fromDomain = PaidLevelDomain.getPLD(fromHost); } previousSourceHost = fromHost; previousSourceDomain = fromDomain; previousSourceUrl = sourceUrl; } String toHost = tURL.getHost(); if (ignoreOutsideHost) { if (toHost == null || !toHost.equalsIgnoreCase(fromHost)) { return null; } } if (ignoreOutsideDomain) { String toDomain = PaidLevelDomain.getPLD(toHost); if (toDomain == null || !toDomain.equals(fromDomain)) { return null; } } return urlToFilter; }</code><technical_language>sourceUrl null e.g. filtering is done in a spout. check a null, empty simply return if</technical_language>

Target:
public String filter(URL sourceUrl, Map<String, String[]> sourceMetadata, String urlToFilter) { if (sourceUrl == null || (!ignoreOutsideHost && !ignoreOutsideDomain)) { return urlToFilter; } URL tURL; try { tURL = new URL(urlToFilter); } catch (MalformedURLException e1) { return null; } String fromHost; String fromDomain = null; if (sourceUrl == previousSourceUrl) { fromHost = previousSourceHost; if (ignoreOutsideDomain) { fromDomain = previousSourceDomain; } } else { fromHost = sourceUrl.getHost(); if (ignoreOutsideDomain) { fromDomain = PaidLevelDomain.getPLD(fromHost); } previousSourceHost = fromHost; previousSourceDomain = fromDomain; previousSourceUrl = sourceUrl; } String toHost = tURL.getHost(); if (ignoreOutsideHost) { if (toHost == null || !toHost.equalsIgnoreCase(fromHost)) { return null; } } if (ignoreOutsideDomain) { String toDomain = PaidLevelDomain.getPLD(toHost); if (toDomain == null || !toDomain.equals(fromDomain)) { return null; } } return urlToFilter; }
Source:
<code>public Stream<JacksonHandle> split(InputStream input) throws Exception { Iterator<JsonNode> nodeItr = configureObjReader().readValues(input); return StreamSupport.stream(Spliterators.spliteratorUnknownSize(nodeItr, Spliterator.ORDERED), false) <START> .map(JacksonHandle::new); <END> }</code><technical_language>mapper need increment count. So, add a private mapper method takes a JsonNode, increments count, constructs returns a new JacksonHandle for JsonNode. Then, pass a reference mapper line 74. Or, better, pass Iterator<JsonNode> a common private method</technical_language>

Target:
public Stream<JacksonHandle> split(InputStream input) throws Exception { if(input == null) { throw new IllegalArgumentException("InputSteam cannot be null."); } Iterator<JsonNode> nodeItr = configureObjReader().readValues(input); return StreamSupport.stream(Spliterators.spliteratorUnknownSize(nodeItr, Spliterator.ORDERED), false) .map(this::wrapJacksonHandle); }
Source:
<code>public void removeMappings(Collection<IgniteTxKey> keys) { ArrayList<UUID> clearedMappings = new ArrayList<>(); for (IgniteTxKey key : keys) { ClusterNode node = cctx.cacheContext(key.cacheId()).cache().affinity() <START> .mapPartitionToPrimaryAndBackups(key.key().partition()).iterator().next(); <END> GridDistributedTxMapping m = mappings.get(node.id()); if (m != null) { m.evictReaders(Collections.singletonList(key)); clearedMappings.add(node.id()); } } for (UUID id : clearedMappings) { GridDistributedTxMapping mapping = mappings.get(id); if (mapping == null || mapping.empty()) mappings.remove(id); } }</code><technical_language>change mapPartitionToNode(int part)</technical_language>

Target:
public void removeMappings(Collection<IgniteTxKey> keys) { for (IgniteTxKey key : keys) { ClusterNode node = cctx.cacheContext(key.cacheId()).cache().affinity() .mapPartitionToNode(key.key().partition()); GridDistributedTxMapping mapping = mappings.get(node.id()); if (mapping != null) { mapping.evictReaders(Collections.singletonList(key)); if (mapping.empty()) mappings.remove(node.id()); } } }