auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void executeCommand() { storage_pool_iso_map domainPoolMap = TransactionSupport.executeInNewTransaction( new TransactionMethod<storage_pool_iso_map>() { @Override public storage_pool_iso_map runInTransaction() { storage_pool_iso_map domainPoolMap = new storage_pool_iso_map(getRecoveryStoragePoolParametersData() .getNewMasterDomainId(), getRecoveryStoragePoolParametersData().getStoragePoolId(), StorageDomainStatus.Active); DbFacade.getInstance().getStoragePoolIsoMapDao().save(domainPoolMap); return domainPoolMap; } }); getStoragePool().setstatus(StoragePoolStatus.Problematic); try { if (StorageHelperDirector.getInstance().getItem(getStorageDomain().getstorage_type()) .ConnectStorageToDomainByVdsId(getNewMaster(false), getVds().getId())) { super.executeCommand(); } else { getReturnValue().setFault(new VdcFault(new VdcBLLException(VdcBllErrors.StorageServerConnectionError, "Failed to connect storage"), VdcBllErrors.StorageServerConnectionError)); } } finally { if (!reconstructOpsSucceeded) { <START> DbFacade.getInstance().getStoragePoolIsoMapDao().remove(new StoragePoolIsoMapId(getRecoveryStoragePoolParametersData() <END> .getNewMasterDomainId(), getRecoveryStoragePoolParametersData().getStoragePoolId())); } } }</code><technical_language>a "getStoragePoolIsoMapDao()" method? Also, indentation a bit funky in gerrit. OK in a decent editor</technical_language>

Target:
protected void executeCommand() { storage_pool_iso_map domainPoolMap = TransactionSupport.executeInNewTransaction( new TransactionMethod<storage_pool_iso_map>() { @Override public storage_pool_iso_map runInTransaction() { storage_pool_iso_map domainPoolMap = new storage_pool_iso_map(getRecoveryStoragePoolParametersData() .getNewMasterDomainId(), getRecoveryStoragePoolParametersData().getStoragePoolId(), StorageDomainStatus.Active); DbFacade.getInstance().getStoragePoolIsoMapDao().save(domainPoolMap); return domainPoolMap; } }); getStoragePool().setstatus(StoragePoolStatus.Problematic); try { if (StorageHelperDirector.getInstance().getItem(getStorageDomain().getstorage_type()) .ConnectStorageToDomainByVdsId(getNewMaster(false), getVds().getId())) { super.executeCommand(); } else { getReturnValue().setFault(new VdcFault(new VdcBLLException(VdcBllErrors.StorageServerConnectionError, "Failed to connect storage"), VdcBllErrors.StorageServerConnectionError)); } } finally { if (!reconstructOpSucceeded) { getStoragePoolIsoMapDAO().remove(new StoragePoolIsoMapId(getRecoveryStoragePoolParametersData() .getNewMasterDomainId(), getRecoveryStoragePoolParametersData().getStoragePoolId())); } } }
Source:
<code><START> private Map<Guid, DiskImage> getSnapshotIdToDiskImage(List<DiskImage> diskImages) { Map<Guid, DiskImage> snapshotIdToDiskImageMap = new HashMap<>(); for (DiskImage disk : diskImages) { snapshotIdToDiskImageMap.put(disk.getImage().getSnapshotId(), disk); } return snapshotIdToDiskImageMap; } <END></code><technical_language>consider: diskImages.stream() .collect(Collectors.toMap(disk -> disk.getImage().getSnapshotId(), Function.identity()));</technical_language>

Target:
private Map<Guid, DiskImage> getSnapshotIdToDiskImage(List<DiskImage> diskImages) { Map<Guid, DiskImage> snapshotIdToDiskImageMap; snapshotIdToDiskImageMap = diskImages.stream() .collect(Collectors.toMap(disk -> disk.getImage().getSnapshotId(), Function.identity())); return snapshotIdToDiskImageMap; }
Source:
<code>public Actor() { users = new HashSet<String>(); groups = new HashSet<String>(); roles = new HashSet<String>(); <START> memberships = new HashSet<BEntry<String, String>>(); <END> }</code><technical_language>This done field declaration example: java private Set<String> users = new HashSet<>()</technical_language>

Target:
public Actor() { memberships = new HashSet<>(); }
Source:
<code>private void updateOptionsNonLocalFS() { if (clusters == null || allStorageDomains == null || attachedStorageDomains == null || isoStorageDomains == null || allHosts == null) { return; } updateAddClusterAvailability(); Set<Guid> clusterIds = clusters.stream().map(Cluster::getId).collect(Collectors.toSet()); List<VDS> hosts = allHosts.stream().filter(h -> clusterIds.contains(h.getClusterId())).collect(Collectors.toList()); List<VDS> availableHosts = allHosts.stream() .filter(v -> v.getStatus() == VDSStatus.Maintenance || v.getStatus() == VDSStatus.PendingApproval) .filter(v -> doesHostSupportAnyCluster(clusters, v)) .collect(Collectors.toList()); List<VDS> upHosts = <START> allHosts.stream() <END> .filter(v -> v.getStatus() == VDSStatus.Up) .filter(h -> clusterIds.contains(h.getClusterId())) .collect(Collectors.toList()); updateAddAndSelectHostAvailability(hosts, availableHosts); List<StorageDomain> unattachedStorages = getUnattachedStorages(); List<StorageDomain> attachedDataStorages = new ArrayList<>(); List<StorageDomain> attachedIsoStorages = new ArrayList<>(); for (StorageDomain sd : attachedStorageDomains) { if (sd.getStorageDomainType().isDataDomain()) { attachedDataStorages.add(sd); } else if (sd.getStorageDomainType() == StorageDomainType.ISO) { attachedIsoStorages.add(sd); } } updateAddAndAttachDataDomainAvailability(upHosts, unattachedStorages, attachedDataStorages); updateAddAndAttachIsoDomainAvailability(upHosts, attachedDataStorages, attachedIsoStorages); stopProgress(); }</code><technical_language>stream 'hosts' remove filter filter is done filter 'hosts', more efficient</technical_language>

Target:
private void updateOptionsNonLocalFS() { if (clusters == null || allStorageDomains == null || attachedStorageDomains == null || isoStorageDomains == null || allHosts == null) { return; } updateAddClusterAvailability(); Set<Guid> clusterIds = clusters.stream().map(Cluster::getId).collect(Collectors.toSet()); List<VDS> hosts = allHosts.stream().filter(h -> clusterIds.contains(h.getClusterId())).collect(Collectors.toList()); List<VDS> upHosts = hosts.stream().filter(v -> v.getStatus() == VDSStatus.Up).collect(Collectors.toList()); List<VDS> availableHosts = allHosts.stream() .filter(v -> v.getStatus() == VDSStatus.Maintenance || v.getStatus() == VDSStatus.PendingApproval) .filter(v -> doesHostSupportAnyCluster(clusters, v)) .collect(Collectors.toList()); updateAddAndSelectHostAvailability(hosts, availableHosts); List<StorageDomain> unattachedStorages = getUnattachedStorages(); List<StorageDomain> attachedDataStorages = new ArrayList<>(); List<StorageDomain> attachedIsoStorages = new ArrayList<>(); for (StorageDomain sd : attachedStorageDomains) { if (sd.getStorageDomainType().isDataDomain()) { attachedDataStorages.add(sd); } else if (sd.getStorageDomainType() == StorageDomainType.ISO) { attachedIsoStorages.add(sd); } } updateAddAndAttachDataDomainAvailability(upHosts, unattachedStorages, attachedDataStorages); updateAddAndAttachIsoDomainAvailability(upHosts, attachedDataStorages, attachedIsoStorages); stopProgress(); }
Source:
<code>private void getColsForSelectTree(final CubeQueryContext cubeql) throws SemanticException { int exprInd = 1; for (int i = 0; i < cubeql.getSelectAST().getChildCount(); i++) { ASTNode selectExpr = (ASTNode)cubeql.getSelectAST().getChild(i); Set<String> cols = new HashSet<String>(); addColumnsForSelectExpr(cubeql, selectExpr, cubeql.getSelectAST(), cols); ASTNode alias = HQLParser.findNodeByPath(selectExpr, Identifier); String selectAlias; String selectFinalAlias = null; if (alias != null) { cubeql.addExprToAlias(selectExpr, alias); if (HQLParser.hasSpaces(alias.getText())) { selectFinalAlias = alias.getText(); <START> selectAlias = "expr" + exprInd; <END> } else { selectAlias = alias.getText().trim(); } } else if (cols.size() == 1) { selectAlias = cols.iterator().next().toLowerCase(); } else { selectAlias = "expr" + exprInd; } exprInd++; cubeql.addSelectAlias(selectAlias, selectFinalAlias); } }</code><technical_language>hardcoded string a constant</technical_language>

Target:
private void getColsForSelectTree(final CubeQueryContext cubeql) throws SemanticException { int exprInd = 1; for (int i = 0; i < cubeql.getSelectAST().getChildCount(); i++) { ASTNode selectExpr = (ASTNode)cubeql.getSelectAST().getChild(i); Set<String> cols = new HashSet<String>(); addColumnsForSelectExpr(cubeql, selectExpr, cubeql.getSelectAST(), cols); ASTNode alias = HQLParser.findNodeByPath(selectExpr, Identifier); String selectAlias; String selectFinalAlias = null; if (alias != null) { cubeql.addExprToAlias(selectExpr, alias); if (HQLParser.hasSpaces(alias.getText())) { selectFinalAlias = alias.getText(); selectAlias = SELECT_ALIAS_PREFIX + exprInd; } else { selectAlias = alias.getText().trim(); } } else if (cols.size() == 1) { selectAlias = cols.iterator().next().toLowerCase(); } else { selectAlias = SELECT_ALIAS_PREFIX + exprInd; } exprInd++; cubeql.addSelectAlias(selectAlias, selectFinalAlias); } }
Source:
<code>public static void main(String[] args) throws Exception { final String clientId = "user"; final String clientSecret = "password"; final String idpEndpoint = "http://idp-host:idp-port/auth/realms/master/protocol/openid-connect/token"; <START> final String stsEndpoint = "http://sts-host:sts-port/sts"; <END> final String idpClientId = "minio-client-id"; final CredentialsProvider credentialsProvider = new ClientGrantsCredentialsProvider( stsEndpoint, () -> getTokenAndExpiry(clientId, clientSecret, idpClientId, idpEndpoint)); final MinioClient minioClient = MinioClient.builder() .endpoint("http://minio-host:minio-port") .credentialsProvider(credentialsProvider) .build(); final List<Bucket> buckets = minioClient.listBuckets(); for (Bucket bucket : buckets) { System.out.print(bucket.name() + " created at "); System.out.println(bucket.creationDate()); } }</code><technical_language>suggestion // STS endpoint points MinIO endpoint in case of MinIO final String stsEndpoint = "http://sts-host:sts-port/";</technical_language>

Target:
public static void main(String[] args) throws Exception { final String clientId = "user"; final String clientSecret = "password"; final String idpEndpoint = "http://idp-host:idp-port/auth/realms/master/protocol/openid-connect/token"; final String stsEndpoint = "http://sts-host:sts-port/"; final String idpClientId = "minio-client-id"; final Provider credentialsProvider = new ClientGrantsProvider( stsEndpoint, () -> getTokenAndExpiry(clientId, clientSecret, idpClientId, idpEndpoint)); final MinioClient minioClient = MinioClient.builder() .endpoint("http://minio-host:minio-port") .credentialsProvider(credentialsProvider) .build(); final List<Bucket> buckets = minioClient.listBuckets(); for (Bucket bucket : buckets) { System.out.print(bucket.name() + " created at "); System.out.println(bucket.creationDate()); } }
Source:
<code>public InputStream getInputStream(SevenZArchiveEntry entry) throws IOException { int entryIndex = -1; for(int i = 0; i < this.archive.files.length;i++) { if(entry == this.archive.files[i]) { <START> entryIndex = i; <END> } } if(entryIndex < 0) { throw new IllegalArgumentException("Can not find " + entry.getName() + " in " + this.fileName); } if(entry.getSize() == 0) { return new ByteArrayInputStream(new byte[0]); } final int folderIndex = archive.streamMap.fileFolderIndex[entryIndex]; final Folder folder = archive.folders[folderIndex]; final int firstPackStreamIndex = archive.streamMap.folderFirstPackStreamIndex[folderIndex]; final long folderOffset = SIGNATURE_HEADER_SIZE + archive.packPos + archive.streamMap.packStreamOffsets[firstPackStreamIndex]; InputStream folderInputStream = buildDecoderStack(folder, folderOffset, firstPackStreamIndex, entry); final int firstFileInFolderIndex = archive.streamMap.folderFirstFileIndex[folderIndex]; if(firstFileInFolderIndex < entryIndex) { long skipSize = 0; for(int i = firstFileInFolderIndex; i < entryIndex;i++) { skipSize += archive.files[i].getSize(); } InputStream inputStreamToSkip = new BoundedInputStream(folderInputStream, skipSize); IOUtils.skip(inputStreamToSkip, Long.MAX_VALUE); } return new BoundedInputStream(folderInputStream, entry.getSize()); }</code><technical_language>break;</technical_language>

Target:
public InputStream getInputStream(SevenZArchiveEntry entry) throws IOException { int entryIndex = -1; for(int i = 0; i < this.archive.files.length;i++) { if(entry == this.archive.files[i]) { entryIndex = i; } } if(entryIndex < 0) { throw new IllegalArgumentException("Can not find " + entry.getName() + " in " + this.fileName); } buildDecodingStream(entryIndex); currentEntryIndex = entryIndex; currentFolderIndex = archive.streamMap.fileFolderIndex[entryIndex]; return getCurrentStream(); }
Source:
<code>public boolean performOk() { Set<String> perspectives = new HashSet<>(); for (Object descriptor : fPerspectiveViewer.getCheckedElements()) { perspectives.add( ((IPerspectiveDescriptor)descriptor).getId() ); } if (perspectives.equals(ViewContextService.getDefaultEnabledPerspectives())) { getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT); } else { StringBuilder buffer= new StringBuilder(); for (String <START> string : <END> perspectives) { buffer.append(string).append(','); } getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, buffer.toString()); } boolean trackViews = fTrackViewsButton.getSelection(); getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_TRACK_VIEWS, trackViews); if (fResetPressed || !trackViews) { getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS, IInternalDebugCoreConstants.EMPTY_STRING); } return super.performOk(); }</code><technical_language>rename perspective id</technical_language>

Target:
public boolean performOk() { Set<String> perspectives = new HashSet<>(); for (Object descriptor : fPerspectiveViewer.getCheckedElements()) { perspectives.add( ((IPerspectiveDescriptor)descriptor).getId() ); } if (perspectives.equals(ViewContextService.getDefaultEnabledPerspectives())) { getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT); } else { StringBuilder buffer= new StringBuilder(); for (String id : perspectives) { buffer.append(id).append(','); } getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, buffer.toString()); } boolean trackViews = fTrackViewsButton.getSelection(); getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_TRACK_VIEWS, trackViews); if (fResetPressed || !trackViews) { getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS, IInternalDebugCoreConstants.EMPTY_STRING); } return super.performOk(); }
Source:
<code>private CompletableFuture<Result> missingAuthentication() { logger.debug("Missing authentication"); <START> return completedFuture(unauthorized()) <END> .thenApply(result -> result .withHeader(WWW_AUTHENTICATE, httpAuthentication.getWwwAuthenticateHeader())); }</code><technical_language>unauthorized().withHeader(WWW_AUTHENTICATE, httpAuthentication.getWwwAuthenticateHeader())</technical_language>

Target:
private CompletableFuture<Result> missingAuthentication() { logger.debug("Missing authentication"); final Result result = unauthorized() .withHeader(WWW_AUTHENTICATE, httpAuthentication.getWwwAuthenticateHeaderValue()); return completedFuture(result); }
Source:
<code>public TaskSideInputHandler( TaskName taskName, TaskMode taskMode, File storeBaseDir, Map<String, StorageEngine> storeToStorageEngines, Map<String, Set<SystemStreamPartition>> storeToSSPs, Map<String, SideInputsProcessor> storeToProcessor, SystemAdmins systemAdmins, StreamMetadataCache streamMetadataCache, Clock clock) { this.taskName = taskName; this.systemAdmins = systemAdmins; this.streamMetadataCache = streamMetadataCache; this.storeToProcessor = storeToProcessor; this.sspToStores = storeToSSPs.entrySet().stream() .flatMap(storeAndSSPs -> storeAndSSPs.getValue().stream() .map(ssp -> new AbstractMap.SimpleImmutableEntry<>(ssp, storeAndSSPs.getKey()))) .collect(Collectors.groupingBy( Map.Entry::getKey, Collectors.mapping(Map.Entry::getValue, Collectors.toSet()))); this.taskSideInputStorageManager = new TaskSideInputStorageManager(taskName, taskMode, storeBaseDir, storeToStorageEngines, storeToSSPs, clock); <START> validateProcessorConfiguration(); <END> }</code><technical_language>This is a new validation added</technical_language>

Target:
public TaskSideInputHandler(TaskName taskName, TaskMode taskMode, File storeBaseDir, Map<String, StorageEngine> storeToStorageEngines, Map<String, Set<SystemStreamPartition>> storeToSSPs, Map<String, SideInputsProcessor> storeToProcessor, SystemAdmins systemAdmins, StreamMetadataCache streamMetadataCache, Clock clock) { validateProcessorConfiguration(storeToSSPs.keySet(), storeToProcessor); this.taskName = taskName; this.systemAdmins = systemAdmins; this.streamMetadataCache = streamMetadataCache; this.storeToProcessor = storeToProcessor; this.sspToStores = new HashMap<>(); storeToSSPs.forEach((store, ssps) -> { for (SystemStreamPartition ssp: ssps) { this.sspToStores.computeIfAbsent(ssp, key -> new HashSet<>()); this.sspToStores.computeIfPresent(ssp, (key, value) -> { value.add(store); return value; }); } }); this.taskSideInputStorageManager = new TaskSideInputStorageManager(taskName, taskMode, storeBaseDir, storeToStorageEngines, storeToSSPs, clock); }
Source:
<code>public ResponseEntity checkBundle(@PathVariable("id") Long bundleId) throws PermissionDeniedException { DownloadBundle bundle = downloadBundleService.get(bundleId); AthenaUser currentUser = userService.getCurrentUser(); vocabularyService.checkBundleUser(currentUser, bundle); vocabularyService.checkBundleVocabularies(bundle, currentUser.getId()); <START> return ResponseEntity.ok(new LicenseExceptionDTO(true)); <END> }</code><technical_language>entity</technical_language>

Target:
public LicenseExceptionDTO checkBundle(@PathVariable("id") Long bundleId) throws PermissionDeniedException { DownloadBundle bundle = downloadBundleService.get(bundleId); AthenaUser currentUser = userService.getCurrentUser(); vocabularyService.checkBundleUser(currentUser, bundle); vocabularyService.checkBundleVocabularies(bundle, currentUser.getId()); return new LicenseExceptionDTO(true); }
Source:
<code>private void updateBrokerPositionMetadata(ConsumerRecords<?, ?> records, Instant readTime) { BiPredicate<MetricName, TopicPartition> matchesKip92 = (metricName, topicPartition) -> metricName != null && metricName.name() != null && metricName.name() .equals(topicPartition + ".records-lag"); BiPredicate<MetricName, TopicPartition> matchesKip225 = (metricName, topicPartition) -> metricName != null && metricName.name() != null && metricName.name() .equals("records-lag") && metricName.tags() != null && metricName.tags().containsKey("topic") && metricName.tags().get("topic").equals(topicPartition.topic()) && metricName.tags() .containsKey("partition") && metricName.tags() .get("partition") .equals(String.valueOf(topicPartition.partition())); for (TopicPartition topicPartition : records.partitions()) { for (MetricName metricName : _consumer.metrics().keySet()) { if (matchesKip92.or(matchesKip225).test(metricName, topicPartition)) { long consumerLag = (long) _consumer.metrics().get(metricName).value(); <START> long consumerPosition = _consumer.position(topicPartition); <END> long brokerPosition = consumerPosition + consumerLag; _endOffsets.put(topicPartition, brokerPosition); _endOffsetsLastUpdate.put(topicPartition, readTime.toEpochMilli()); } } } }</code><technical_language>change good. understand difference this updateEndOffsetsByRpc</technical_language>

Target:
private void updateBrokerPositionMetadata(ConsumerRecords<?, ?> records, Instant readTime) { BiPredicate<MetricName, TopicPartition> matchesKip92 = (metricName, topicPartition) -> metricName != null && metricName.name() != null && metricName.name() .equals(topicPartition + ".records-lag"); BiPredicate<MetricName, TopicPartition> matchesKip225 = (metricName, topicPartition) -> metricName != null && metricName.name() != null && metricName.name() .equals("records-lag") && metricName.tags() != null && metricName.tags().containsKey("topic") && metricName.tags().get("topic").equals(topicPartition.topic()) && metricName.tags() .containsKey("partition") && metricName.tags() .get("partition") .equals(String.valueOf(topicPartition.partition())); for (TopicPartition topicPartition : records.partitions()) { for (MetricName metricName : _consumer.metrics().keySet()) { if (matchesKip92.or(matchesKip225).test(metricName, topicPartition)) { long consumerLag = (long) _consumer.metrics().get(metricName).value(); long consumerPosition = _consumer.position(topicPartition); long brokerPosition = consumerPosition + consumerLag; PhysicalSourcePosition offsetPosition = new PhysicalSourcePosition(); offsetPosition.setPositionType(PhysicalSourcePosition.KAFKA_OFFSET_POSITION_TYPE); offsetPosition.setSourceQueriedTimeMs(readTime.toEpochMilli()); offsetPosition.setSourcePosition(Long.toString(brokerPosition)); _offsetPositions.update(topicPartition.toString(), offsetPosition); } } } }
Source:
<code>@Override public Environment setUp(AbstractBuild build, final Launcher launcher, BuildListener listener) throws IOException, InterruptedException { final List<MultiBinding.MultiEnvironment> m = new ArrayList<MultiBinding.MultiEnvironment>(); for (MultiBinding binding : bindings) { m.add(binding.bind(build, build.getWorkspace(), launcher, listener)); <START> IdCredentials id = CredentialsProvider.findCredentialById(binding.getCredentialsId(), binding.type(), build); <END> CredentialsProvider.track(build, id); } return new Environment() { @Override public void buildEnvVars(Map<String,String> env) { for (MultiBinding.MultiEnvironment e : m) { env.putAll(e.getValues()); } } @Override public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException { for (MultiBinding.MultiEnvironment e : m) { e.getUnbinder().unbind(build, build.getWorkspace(), launcher, listener); } return true; } }; }</code><technical_language>Ugh! Please no... lookup</technical_language>

Target:
@Override public Environment setUp(AbstractBuild build, final Launcher launcher, BuildListener listener) throws IOException, InterruptedException { final List<MultiBinding.MultiEnvironment> m = new ArrayList<MultiBinding.MultiEnvironment>(); for (MultiBinding binding : bindings) { m.add(binding.bind(build, build.getWorkspace(), launcher, listener)); } return new Environment() { @Override public void buildEnvVars(Map<String,String> env) { for (MultiBinding.MultiEnvironment e : m) { env.putAll(e.getValues()); } } @Override public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException { for (MultiBinding.MultiEnvironment e : m) { e.getUnbinder().unbind(build, build.getWorkspace(), launcher, listener); } return true; } }; }
Source:
<code>public int hashCode() { final int prime = 31; int result = super.hashCode(); <START> result = prime * result + ((commandId == null) ? 0 : commandId.hashCode()); <END> return result; }</code><technical_language>this simplified Objects.hashCode(commandId)</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + Objects.hashCode(commandId); return result; }
Source:
<code>public void testUpdateStatus() { <START> when(dataStore.beginTransaction()).thenReturn(tx); <END> when(elide.getElideSettings()).thenReturn(elideSettings); AsyncQuery result = asyncQueryDAO.updateStatus(asyncQuery, QueryStatus.PROCESSING); assertEquals(result, asyncQuery); verify(tx, times(1)).save(any(AsyncQuery.class), any(RequestScope.class)); verify(asyncQuery, times(1)).setStatus(QueryStatus.PROCESSING); }</code><technical_language>redundant BeforeEach setup</technical_language>

Target:
public void testUpdateStatus() { AsyncQuery result = asyncQueryDAO.updateStatus(asyncQuery, QueryStatus.PROCESSING); assertEquals(result, asyncQuery); verify(tx, times(1)).save(any(AsyncQuery.class), any(RequestScope.class)); verify(asyncQuery, times(1)).setStatus(QueryStatus.PROCESSING); }
Source:
<code>public void generateOpenApiSpec(Collection<Path> sourcesPaths, Path specOutputFile) { sourcesPaths.forEach(generator::addSourcePath); log.info("Parsing java files from {}", sourcesPaths); OpenAPI openAPI = generator.generateOpenApi(); try { if (openAPI.getPaths().size() > 0) { log.info("writing file {}", specOutputFile); FileUtils.writeStringToFile(specOutputFile.toFile(), Json.pretty(openAPI), StandardCharsets.UTF_8); } else { <START> log.info("There are no Fusion endpoints to generate."); <END> FileUtils.deleteQuietly(specOutputFile.toFile()); } } catch (IOException e) { String errorMessage = String.format( "Error while writing OpenAPI json file at %s", specOutputFile.toString()); log.error(errorMessage, specOutputFile, e); } }</code><technical_language>here, "Fusion endpoints" instead of "endpoints"</technical_language>

Target:
public void generateOpenApiSpec(Collection<Path> sourcesPaths, Path specOutputFile) { sourcesPaths.forEach(generator::addSourcePath); log.info("Parsing java files from {}", sourcesPaths); OpenAPI openAPI = generator.generateOpenApi(); try { if (openAPI.getPaths().size() > 0) { log.info("writing file {}", specOutputFile); FileUtils.writeStringToFile(specOutputFile.toFile(), Json.pretty(openAPI), StandardCharsets.UTF_8); } else { log.info("There are no endpoints to generate."); FileUtils.deleteQuietly(specOutputFile.toFile()); } } catch (IOException e) { String errorMessage = String.format( "Error while writing OpenAPI json file at %s", specOutputFile.toString()); log.error(errorMessage, specOutputFile, e); } }
Source:
<code>public void put(K key, T persistent) { Schema schema = persistent.getSchema(); Document doc = new Document(); List<org.apache.avro.Schema.Field> fields = schema.getFields(); for (org.apache.avro.Schema.Field field : fields) { if (!persistent.isDirty(field.name())) { continue; } String sf = mapping.getLuceneField(field.name()); if (sf == null) { continue; } Schema fieldSchema = field.schema(); Object o = persistent.get(field.pos()); if (o == null) { continue; } doc.add(convertToIndexableField(sf, fieldSchema, o)); } LOG.info("DOCUMENT: {}", doc); try { if (key instanceof Integer) { <START> doc.add(new IntPoint(mapping.getPrimaryKey(), ((Integer) key).intValue())); <END> } else if (key instanceof Long) { doc.add(new LongPoint(mapping.getPrimaryKey(), ((Long) key).longValue())); } else if (key instanceof Float) { doc.add(new FloatPoint(mapping.getPrimaryKey(), ((Float) key).floatValue())); } else if (key instanceof Double) { doc.add(new DoublePoint(mapping.getPrimaryKey(), ((Double) key).doubleValue())); } else { doc.add(new StringField(mapping.getPrimaryKey(), key.toString(), Store.YES)); } LOG.info("DOCUMENT: {}", doc); if (get(key, null) == null) { writer.addDocument(doc); } else { writer.updateDocument( new Term(mapping.getPrimaryKey(), key.toString()), doc); } searcherManager.maybeRefresh(); } catch (IOException e) { LOG.error("Error updating document: {}", e); } }</code><technical_language>auto unboxing - wrapper class primitive class new IntPoint(mapping.getPrimaryKey(), ((Integer) key).intValue()) === new IntPoint(mapping.getPrimaryKey(), (Integer) key)</technical_language>

Target:
public void put(K key, T persistent) { Schema schema = persistent.getSchema(); Document doc = new Document(); List<org.apache.avro.Schema.Field> fields = schema.getFields(); for (org.apache.avro.Schema.Field field : fields) { if (!persistent.isDirty(field.name())) { continue; } String sf = mapping.getLuceneField(field.name()); if (sf == null) { continue; } Schema fieldSchema = field.schema(); Object o = persistent.get(field.pos()); if (o == null) { continue; } doc.add(convertToIndexableField(sf, fieldSchema, o)); } LOG.info("DOCUMENT: {}", doc); try { if (key instanceof Integer) { doc.add(new IntPoint(mapping.getPrimaryKey(), (Integer) key)); } else if (key instanceof Long) { doc.add(new LongPoint(mapping.getPrimaryKey(), (Long) key)); } else if (key instanceof Float) { doc.add(new FloatPoint(mapping.getPrimaryKey(), (Float) key)); } else if (key instanceof Double) { doc.add(new DoublePoint(mapping.getPrimaryKey(), (Double) key)); } else { doc.add(new StringField(mapping.getPrimaryKey(), key.toString(), Store.YES)); } LOG.info("DOCUMENT: {}", doc); if (get(key, null) == null) { writer.addDocument(doc); } else { writer.updateDocument( new Term(mapping.getPrimaryKey(), key.toString()), doc); } searcherManager.maybeRefresh(); } catch (IOException e) { LOG.error("Error updating document: {}", e); } }
Source:
<code>public void buildVariablesFor(AbstractBuild build, Map<String, String> variables) { final Executor executor = build.getExecutor(); if (executor != null && executor.getOwner() instanceof DockerComputer) { final DockerComputer dockerComputer = (DockerComputer) executor.getOwner(); variables.put("DOCKER_CONTAINER_ID", dockerComputer.getContainerId()); variables.put("JENKINS_CLOUD_ID", dockerComputer.getCloudId()); try { final URIBuilder uriBuilder = new URIBuilder(dockerComputer.getCloud().serverUrl); <START> if (uriBuilder.getScheme() == "http" || uriBuilder.getScheme() == "https") { <END> uriBuilder.setScheme("tcp"); } final String dockerHost = uriBuilder.toString(); variables.put("DOCKER_HOST", dockerHost); } catch (URISyntaxException e) { LOG.error("Can't build 'DOCKER_HOST' var: {}", e.getMessage()); } } }</code><technical_language>if unix, replace. Vice versa logic code</technical_language>

Target:
public void buildVariablesFor(AbstractBuild build, Map<String, String> variables) { final Executor executor = build.getExecutor(); if (executor != null && executor.getOwner() instanceof DockerComputer) { final DockerComputer dockerComputer = (DockerComputer) executor.getOwner(); variables.put("DOCKER_CONTAINER_ID", dockerComputer.getContainerId()); variables.put("JENKINS_CLOUD_ID", dockerComputer.getCloudId()); try { final URIBuilder uriBuilder = new URIBuilder(dockerComputer.getCloud().serverUrl); if (uriBuilder.getScheme() != "unix") { uriBuilder.setScheme("tcp"); } final String dockerHost = uriBuilder.toString(); variables.put("DOCKER_HOST", dockerHost); } catch (URISyntaxException e) { LOG.error("Can't build 'DOCKER_HOST' var: {}", e.getMessage()); } } }
Source:
<code>private void addColumnSortHandler(ExtendedPagedTable listTable){ <START> listTable.addColumnSortHandler(new ColumnSortEvent.Handler() { <END> @Override public void onColumnSort(ColumnSortEvent event) { GridPreferencesStore gridPreferencesStore = listTable.getGridPreferencesStore(); if (gridPreferencesStore != null && event.getColumnSortList().size() > 0) { ColumnSortList.ColumnSortInfo columnSortInfo = event.getColumnSortList().get(0); if (columnSortInfo != null) { GridSortedColumnPreference gridSortedColumnPreference = new GridSortedColumnPreference(columnSortInfo.getColumn().getDataStoreName(), columnSortInfo.isAscending()); gridPreferencesStore.setGridSortedColumnPreference(gridSortedColumnPreference); } } listTable.saveGridPreferences(); } }); }</code><technical_language>please lambda style</technical_language>

Target:
protected void addColumnSortHandler(ExtendedPagedTable listTable) { listTable.addColumnSortHandler(event -> { GridPreferencesStore gridPreferencesStore = listTable.getGridPreferencesStore(); if (gridPreferencesStore != null && event.getColumnSortList().size() > 0) { ColumnSortList.ColumnSortInfo columnSortInfo = event.getColumnSortList().get(0); if (columnSortInfo != null) { GridSortedColumnPreference gridSortedColumnPreference = new GridSortedColumnPreference(columnSortInfo.getColumn().getDataStoreName(), columnSortInfo.isAscending()); gridPreferencesStore.setGridSortedColumnPreference(gridSortedColumnPreference); } } listTable.saveGridPreferences(); }); }
Source:
<code>public Workflow publish(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Workflow id to publish/unpublish", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "PublishRequest to refresh the list of repos for a user", required = true) PublishRequest request) { Workflow c = workflowDAO.findById(workflowId); checkEntry(c); checkCanShareWorkflow(user, c); Workflow checker = c.getCheckerWorkflow(); if (request.getPublish()) { boolean validTag = c.getVersions().stream().anyMatch((v) -> v.isValid()); if (validTag && (!c.getGitUrl().isEmpty() || Objects.equals(c.getMode(), WorkflowMode.HOSTED))) { c.setIsPublished(true); if (checker != null) { checker.setIsPublished(true); elasticManager.handleIndexUpdate(checker, ElasticMode.UPDATE); } } else { throw new CustomWebApplicationException("Repository does not meet requirements to publish.", HttpStatus.SC_BAD_REQUEST); } } else { c.setIsPublished(false); if (checker != null) { checker.setIsPublished(false); <START> elasticManager.handleIndexUpdate(checker, ElasticMode.DELETE); <END> } } long id = workflowDAO.create(c); c = workflowDAO.findById(id); if (request.getPublish()) { elasticManager.handleIndexUpdate(c, ElasticMode.UPDATE); } else { elasticManager.handleIndexUpdate(c, ElasticMode.DELETE); } return c; }</code><technical_language>checker workflow changed unpublished published vice versa irrelevant. index all. Figure out checker workflow is filtered out</technical_language>

Target:
public Workflow publish(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Workflow id to publish/unpublish", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "PublishRequest to refresh the list of repos for a user", required = true) PublishRequest request) { Workflow c = workflowDAO.findById(workflowId); checkEntry(c); checkCanShareWorkflow(user, c); Workflow checker = c.getCheckerWorkflow(); if (request.getPublish()) { boolean validTag = false; Set<WorkflowVersion> versions = c.getVersions(); for (WorkflowVersion workflowVersion : versions) { if (workflowVersion.isValid()) { validTag = true; break; } } if (validTag && (!c.getGitUrl().isEmpty() || Objects.equals(c.getMode(), WorkflowMode.HOSTED))) { c.setIsPublished(true); if (checker != null) { checker.setIsPublished(true); } } else { throw new CustomWebApplicationException("Repository does not meet requirements to publish.", HttpStatus.SC_BAD_REQUEST); } } else { c.setIsPublished(false); if (checker != null) { checker.setIsPublished(false); } } long id = workflowDAO.create(c); c = workflowDAO.findById(id); if (request.getPublish()) { elasticManager.handleIndexUpdate(c, ElasticMode.UPDATE); } else { elasticManager.handleIndexUpdate(c, ElasticMode.DELETE); } return c; }
Source:
<code>private void handleDatastreamAddOrDelete() { leaderDoAssignmentScheduled.set(false); List<Datastream> newDatastreams = _datastreamCache.getAllDatastreams(true); if (newDatastreams.isEmpty()) { _log.warn("Received a new datastream event, but there were no datastreams"); return; } try { for (Datastream ds : newDatastreams) { if (ds.getStatus() != DatastreamStatus.READY) { _destinationManager.createTopic(ds); ds.setStatus(DatastreamStatus.READY); if (!_adapter.updateDatastream(ds)) { _log.error(String.format("Failed to update datastream: %s after initializing, " <START> + "This datastream will not be scheduled for producing events ", ds.getName())); <END> throw new DatastreamException("Failed to update datastream destination for datastream" + ds.getName()); } } } _eventQueue.put(CoordinatorEvent.createLeaderDoAssignmentEvent()); } catch (Exception e) { _log.error("Failed to update the destination of new datastreams.", e); _dynamicMetricsManager.createOrUpdateCounter(this.getClass(), "handleDatastreamAddOrDelete", NUM_RETRIES, 1); if (leaderDoAssignmentScheduled.compareAndSet(false, true)) { _log.warn("Schedule retry for handling new datastream"); _executor.schedule(() -> _eventQueue.put(CoordinatorEvent.createHandleDatastreamAddOrDeleteEvent()), _config.getRetryIntervalMS(), TimeUnit.MILLISECONDS); } } }</code><technical_language>if 1 datastream hits error, createTopic & updateDatastream processes halted for other datastreams in newDatastreams collection</technical_language>

Target:
private void handleDatastreamAddOrDelete() { boolean shouldRetry = false; leaderDatastreamAddOrDeleteEventScheduled.set(false); List<Datastream> newDatastreams = _datastreamCache.getAllDatastreams(true); if (newDatastreams.isEmpty()) { _log.warn("Received a new datastream event, but there were no datastreams"); return; } for (Datastream ds : newDatastreams) { if (ds.getStatus() != DatastreamStatus.READY) { try { _destinationManager.createTopic(ds); ds.setStatus(DatastreamStatus.READY); if (!_adapter.updateDatastream(ds)) { _log.warn(String.format("Failed to update datastream: %s after initializing, " + "This datastream will not be scheduled for producing events ", ds.getName())); shouldRetry = true; } } catch (Exception e) { _log.warn("Failed to update the destination of new datastream %s " + ds, e); shouldRetry = true; } } } if (shouldRetry) { _dynamicMetricsManager.createOrUpdateCounter(this.getClass(), "handleDatastreamAddOrDelete", NUM_RETRIES, 1); if (leaderDatastreamAddOrDeleteEventScheduled.compareAndSet(false, true)) { _log.warn("Schedule retry for handling new datastream"); _executor.schedule(() -> _eventQueue.put(CoordinatorEvent.createHandleDatastreamAddOrDeleteEvent()), _config.getRetryIntervalMS(), TimeUnit.MILLISECONDS); } } _eventQueue.put(CoordinatorEvent.createLeaderDoAssignmentEvent()); }
Source:
<code>public int hashCode() { <START> return mShouldRun ? 17 : 42; <END> }</code><technical_language>Object.hashCode(mShouldRun) that</technical_language>

Target:
public int hashCode() { int result = (mShouldRun ? 1 : 0); result = 31 * result + mBlockReasons.hashCode(); return result; }
Source:
<code>public static String getFormattedSql(Statement statement, SqlParser sqlParser, Optional<List<Expression>> parameters) { String sql = SqlFormatter.formatSql(statement, parameters); Statement parsed; try { <START> ParsingOptions parsingOptions = new ParsingOptions(UNDEFINED ); <END> parsed = sqlParser.createStatement(sql, parsingOptions); } catch (ParsingException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Formatted query does not parse: " + statement); } if (!statement.equals(parsed)) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Query does not round-trip: " + statement); } return sql; }</code><technical_language>This works ExpressionFormatter produces DECIMAL 'xxx' for DecimalLiteral. I required for a while avoid incompatibilities creating views, for instance. Eventually, need change produce simple decimal literals. Add a TODO in ExpressionFormatter.visitDecimal clean parse-as-double flag is removed</technical_language>

Target:
public static String getFormattedSql(Statement statement, SqlParser sqlParser, Optional<List<Expression>> parameters) { String sql = SqlFormatter.formatSql(statement, parameters); Statement parsed; try { ParsingOptions parsingOptions = new ParsingOptions(REJECT ); parsed = sqlParser.createStatement(sql, parsingOptions); } catch (ParsingException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Formatted query does not parse: " + statement); } if (!statement.equals(parsed)) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Query does not round-trip: " + statement); } return sql; }
Source:
<code>public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "{0} starting...", taskId); trainer.initialize(); synchronizer.globalBarrier(); workerClock.initialize(); final int initialClock = workerClock.getWorkerClock(); for (int iteration = initialClock; iteration < maxIterations; ++iteration) { if (aborted) { LOG.log(Level.INFO, "Abort a thread to completely close the task"); workerClock.recordClockNetworkWaitingTime(); return null; } <START> trainingDataProvider.prepareDataForEpoch(); <END> trainer.run(iteration); workerClock.clock(); } synchronizer.globalBarrier(); trainer.cleanup(); workerClock.recordClockNetworkWaitingTime(); return null; }</code><technical_language>move trainer.run()? I wish this method Trainers EM</technical_language>

Target:
public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "{0} starting...", taskId); trainer.initialize(); synchronizer.globalBarrier(); workerClock.initialize(); final int initialClock = workerClock.getWorkerClock(); for (int iteration = initialClock; iteration < maxIterations; ++iteration) { if (aborted) { LOG.log(Level.INFO, "Abort a thread to completely close the task"); workerClock.recordClockNetworkWaitingTime(); return null; } trainingDataProvider.prepareDataForEpoch(); LOG.log(Level.INFO, "Starting iteration {0}", iteration); trainer.run(iteration); workerClock.clock(); } synchronizer.globalBarrier(); trainer.cleanup(); workerClock.recordClockNetworkWaitingTime(); return null; }
Source:
<code>private void writeBamOutput(AssemblyResultSet assemblyResult, ReadLikelihoods<Haplotype> readLikelihoods, HaplotypeCallerGenotypingEngine.CalledHaplotypes calledHaplotypes) { if ( MTAC.bamOutputPath != null ) { final Set<Haplotype> calledHaplotypeSet = new HashSet<>(calledHaplotypes.getCalledHaplotypes()); <START> if (MTAC.disableOptimizations) <END> calledHaplotypeSet.add(assemblyResult.getReferenceHaplotype()); haplotypeBAMWriter.writeReadsAlignedToHaplotypes( assemblyResult.getHaplotypeList(), assemblyResult.getPaddedReferenceLoc(), assemblyResult.getHaplotypeList(), calledHaplotypeSet, readLikelihoods); } }</code><technical_language>add curly braces if statement conform GATK4 style convention</technical_language>

Target:
private void writeBamOutput(AssemblyResultSet assemblyResult, ReadLikelihoods<Haplotype> readLikelihoods, HaplotypeCallerGenotypingEngine.CalledHaplotypes calledHaplotypes) { if ( haplotypeBAMWriter.isPresent() ) { final Set<Haplotype> calledHaplotypeSet = new HashSet<>(calledHaplotypes.getCalledHaplotypes()); if (MTAC.disableOptimizations) { calledHaplotypeSet.add(assemblyResult.getReferenceHaplotype()); } haplotypeBAMWriter.get().writeReadsAlignedToHaplotypes( assemblyResult.getHaplotypeList(), assemblyResult.getPaddedReferenceLoc(), assemblyResult.getHaplotypeList(), calledHaplotypeSet, readLikelihoods); } }
Source:
<code>public void setTrace(final ITmfTrace trace, final boolean disposeOnClose) { if ((fTrace != null) && fDisposeOnClose) { fTrace.dispose(); } fTrace = trace; fPackDone = false; fSelectedRank = 0; fDisposeOnClose = disposeOnClose; fTable.getDisplay().syncExec(new Runnable() { @Override public void run() { fTable.removeAll(); fCache.setTrace(fTrace); <START> if (fTrace != null) { <END> if (!fTable.isDisposed()) { if (fTable.getData(Key.FILTER_OBJ) == null) { fTable.setItemCount((int) fTrace.getNbEvents() + 1); } else { stopFilterThread(); fFilterMatchCount = 0; fFilterCheckCount = 0; fTable.setItemCount(3); startFilterThread(); } } } fRawViewer.setTrace(fTrace); } }); }</code><technical_language>Right setTrace() called UI thread trace parameter is null, control external code, check trace parameter directly, @NonNull need check (and instead of fTrace)</technical_language>

Target:
public void setTrace(final ITmfTrace trace, final boolean disposeOnClose) { if ((fTrace != null) && fDisposeOnClose) { fTrace.dispose(); } fTrace = trace; fPackDone = false; fSelectedRank = 0; fDisposeOnClose = disposeOnClose; fTable.getDisplay().syncExec(new Runnable() { @Override public void run() { fTable.removeAll(); fCache.setTrace(trace); if (trace != null) { if (!fTable.isDisposed()) { if (fTable.getData(Key.FILTER_OBJ) == null) { fTable.setItemCount((int) trace.getNbEvents() + 1); } else { stopFilterThread(); fFilterMatchCount = 0; fFilterCheckCount = 0; fTable.setItemCount(3); startFilterThread(); } } } fRawViewer.setTrace(trace); } }); }
Source:
<code>public Graph unmarshall(Metadata metadata, InputStream input) throws IOException { MarshallingResponse<Graph> marshallingResponse = unmarshallWithValidation(MarshallingRequest.builder() .metadata(metadata) .input(input) .mode(MarshallingRequest.Mode.ERROR) .build()); <START> return marshallingResponse.getResult().get(); <END> }</code><technical_language>optional present check access</technical_language>

Target:
public Graph unmarshall(Metadata metadata, InputStream input) { MarshallingResponse<Graph> marshallingResponse = unmarshallWithValidation(MarshallingRequest.builder() .metadata(metadata) .input(input) .mode(MarshallingRequest.Mode.ERROR) .build()); return marshallingResponse.getResult(); }
Source:
<code>public ObisCodeValuesDto(final byte a, final byte b, final byte c, final byte d, final byte e, final byte f) { <START> super(); <END> this.a = a; this.b = b; this.c = c; this.d = d; this.e = e; this.f = f; }</code><technical_language>changes in this pull request, clean a bit more, superfluous super() call removed</technical_language>

Target:
public ObisCodeValuesDto(final byte a, final byte b, final byte c, final byte d, final byte e, final byte f) { this.a = a; this.b = b; this.c = c; this.d = d; this.e = e; this.f = f; }
Source:
<code>public SSHActionConfig() { port = 22; <START> outputKey = "sshOutput"; <END> }</code><technical_language>this.outputKey</technical_language>

Target:
public SSHActionConfig() { this.port = 22; this.outputKey = "sshOutput"; }
Source:
<code>public static void endStep(ExecutionContext context, Step step, boolean exitStatus) { if (context == null) { return; } if (context.isMonitored()) { Job job = context.getJob(); try { if (step != null) { step.markStepEnded(exitStatus); JobRepositoryFactory.getJobRepository().updateStep(step); } if (context.getExecutionMethod() == ExecutionMethod.AsJob && job != null && !exitStatus) { context.setCompleted(true); job.markJobEnded(false); JobRepositoryFactory.getJobRepository() .updateCompletedJobAndSteps(job); } else { Step parentStep = context.getStep(); if (context.getExecutionMethod() == ExecutionMethod.AsStep && parentStep != null) { context.setCompleted(true); <START> if (!exitStatus && job != null) { <END> job.markJobEnded(false); JobRepositoryFactory.getJobRepository() .updateCompletedJobAndSteps(job); } } } } catch (Exception e) { log.error("Exception", e); } } }</code><technical_language>I condition order in if line 116 (or change order there). similarity conditions is more clear this way</technical_language>

Target:
public static void endStep(ExecutionContext context, Step step, boolean exitStatus) { if (context == null) { return; } if (context.isMonitored()) { Job job = context.getJob(); try { if (step != null) { step.markStepEnded(exitStatus); JobRepositoryFactory.getJobRepository().updateStep(step); } if (context.getExecutionMethod() == ExecutionMethod.AsJob && job != null && !exitStatus) { context.setCompleted(true); job.markJobEnded(false); JobRepositoryFactory.getJobRepository() .updateCompletedJobAndSteps(job); } else { Step parentStep = context.getStep(); if (context.getExecutionMethod() == ExecutionMethod.AsStep && parentStep != null) { context.setCompleted(true); if (job != null && !exitStatus) { job.markJobEnded(false); JobRepositoryFactory.getJobRepository() .updateCompletedJobAndSteps(job); } } } } catch (Exception e) { log.error("Exception", e); } } }