auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> static synchronized ServiceContext getServiceContext() { <END> if (serviceContext == null) { synchronized (Context.class) { if (serviceContext == null) { log.error("serviceContext is null. Creating new ServiceContext()"); serviceContext = ServiceContext.getInstance(); } } } log.trace("serviceContext: {}", serviceContext); return ServiceContext.getInstance(); }</code><technical_language>I method body synchronised. instead remove outer if (serviceContext == null)? i duplicated in block</technical_language>

Target:
static synchronized ServiceContext getServiceContext() { synchronized (Context.class) { if (serviceContext == null) { log.error("serviceContext is null. Creating new ServiceContext()"); serviceContext = ServiceContext.getInstance(); } } log.trace("serviceContext: {}", serviceContext); return ServiceContext.getInstance(); }
Source:
<code>private HashMap<String, String> getCustomHeaders() { HashMap<String, String> customHeaders = new HashMap<>(); try { Set<String> allPropNames = getPropertyAccessor().getPropertyNames(NhincConstants.GATEWAY_PROPERTY_FILE); if (NullChecker.isNotNullish(allPropNames)) { addPropertiesToCustomHeaders(allPropNames, customHeaders); } } catch (PropertyAccessException ex) { <START> LOG.warn("Unable to access properties for custom http headers.", ex); <END> } for (CONNECTCustomHttpHeadersType header : assertion.getCONNECTCustomHttpHeaders()) { customHeaders.put(header.getHeaderName(), header.getHeaderValue()); } return customHeaders; }</code><technical_language>LOG.warn("Unable access properties for custom http headers.{}", ex.getLocalizedMessage(),ex);</technical_language>

Target:
private HashMap<String, String> getCustomHeaders() { HashMap<String, String> customHeaders = new HashMap<>(); try { Set<String> allPropNames = getPropertyAccessor().getPropertyNames(NhincConstants.GATEWAY_PROPERTY_FILE); if (NullChecker.isNotNullish(allPropNames)) { addPropertiesToCustomHeaders(allPropNames, customHeaders); } } catch (PropertyAccessException ex) { LOG.warn("Unable to access properties for custom http headers.{}", ex.getLocalizedMessage(),ex); } for (CONNECTCustomHttpHeadersType header : assertion.getCONNECTCustomHttpHeaders()) { customHeaders.put(header.getHeaderName(), header.getHeaderValue()); } return customHeaders; }
Source:
<code>public List<Element> nextElementSiblings() { if (parentNode == null) { return null; } List<Element> siblings = parent().childElementsList(); int index = indexInList(this, siblings); Validate.notNull(index); if (siblings.size() > index + 1) { return siblings.subList(index + 1, siblings.size()); } <START> return null; <END> }</code><technical_language>return empty list, null</technical_language>

Target:
public List<Element> nextElementSiblings() { if (parentNode == null) { return Collections.emptyList(); } List<Element> siblings = parent().childElementsList(); int index = indexInList(this, siblings); Validate.notNull(index); if (siblings.size() > index + 1) { return siblings.subList(index + 1, siblings.size()); } return Collections.emptyList(); }
Source:
<code>public boolean cleanDataBase() { close(); logger.info("Cleaning database"); File[] dbChannelFiles = statusFileDirectory.listFiles((dir, <START> name) -> name.startsWith(DEFAULT_STORE_SESSION_NAME)); <END> for (File file : dbChannelFiles) { try { logger.info("Deleting " + file); file.delete(); } catch (Exception e) { logger.info("Error while deleting file during database cleanup", e); } } return true; }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Catch Exception instead of Throwable. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void cleanDataBase() { close(); logger.info("Cleaning database"); File[] dbChannelFiles = statusFileDirectory.listFiles((dir, name) -> name.startsWith(DEFAULT_STORE_SESSION_NAME)); if (dbChannelFiles != null) { for (File file : dbChannelFiles) { try { logger.info("Deleting " + file); boolean result = file.delete(); if (!result) { logger.error("Could not delete file " + file + ". Synchronization service might not work properly. Please remove the file manually."); } } catch (Exception e) { logger.info("Error while deleting file during database cleanup", e); } } } }
Source:
<code>void addPagesToList(@NonNull SQLiteDatabase db, @NonNull ReadingList list, @NonNull List<ReadingListPage> pages) { db.beginTransaction(); try { for (ReadingListPage page : pages) { insertPageInDb(db, list, page); } db.setTransactionSuccessful(); WikipediaApp.getInstance().getBus().post(new ArticleSavedOrDeletedEvent(pages.toArray(new ReadingListPage[]{}))); } finally { db.endTransaction(); } SavedPageSyncService.enqueue(); <START> if (Prefs.getReadingListsPageSaveCount() < SAVE_COUNT_LIMIT) { WikipediaApp.getInstance().getBus().post(new SaveCountReachedEvent()); Prefs.setReadingListsPageSaveCount(Prefs.getReadingListsPageSaveCount() + 1); } <END> }</code><technical_language>a bus event for handling article saved deleted, add a parameter new ArticleSavedOrDeletedEvent() do logic there</technical_language>

Target:
void addPagesToList(@NonNull SQLiteDatabase db, @NonNull ReadingList list, @NonNull List<ReadingListPage> pages) { db.beginTransaction(); try { for (ReadingListPage page : pages) { insertPageInDb(db, list, page); } db.setTransactionSuccessful(); WikipediaApp.getInstance().getBus().post(new ArticleSavedOrDeletedEvent(true, pages.toArray(new ReadingListPage[]{}))); } finally { db.endTransaction(); } SavedPageSyncService.enqueue(); }
Source:
<code>SolrClient createSolrHttpClient(String url, String coreName, String coreUrl) throws IOException, SolrServerException { final HttpClientBuilder builder = HttpClients.custom() .setDefaultCookieStore(new BasicCookieStore()) .setMaxConnTotal(128) .setMaxConnPerRoute(32); <START> <END> if (StringUtils.startsWith(url, "https")) { builder.setSSLSocketFactory( new SSLConnectionSocketFactory( getSslContext(), getProtocols(), getCipherSuites(), SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER)); } createSolrCore(url, coreName, null, builder.build()); try (final Closer closer = new Closer()) { final HttpSolrClient noRetryClient = closer.with(new HttpSolrClient(coreUrl, builder.build())); final HttpSolrClient retryClient = closer.with( new HttpSolrClient( coreUrl, builder.setRetryHandler(new SolrHttpRequestRetryHandler(coreName)).build())); return closer.returning(new PingAwareSolrClientProxy(retryClient, noRetryClient)); } }</code><technical_language>do if (url.getProtocol().equals("https")) if url a URL object</technical_language>

Target:
SolrClient createSolrHttpClient(String url, String coreName, String coreUrl) throws IOException, SolrServerException { final HttpClientBuilder builder = HttpClients.custom() .setDefaultCookieStore(new BasicCookieStore()) .setMaxConnTotal(128) .setMaxConnPerRoute(32); if (StringUtils.startsWithIgnoreCase(url, "https")) { builder.setSSLSocketFactory( new SSLConnectionSocketFactory( getSslContext(), getProtocols(), getCipherSuites(), SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER)); } createSolrCore(url, coreName, null, builder.build()); try (final Closer closer = new Closer()) { final HttpSolrClient noRetryClient = closer.with(new HttpSolrClient(coreUrl, builder.build())); final HttpSolrClient retryClient = closer.with( new HttpSolrClient( coreUrl, builder.setRetryHandler(new SolrHttpRequestRetryHandler(coreName)).build())); return closer.returning(new PingAwareSolrClientProxy(retryClient, noRetryClient)); } }
Source:
<code>void setState(State state) { this.state = state; <START> if (zkShutdownHandler != null) { <END> zkShutdownHandler.handle(state); } }</code><technical_language>@rakeshadr is a potential race setting shutdown handler checking if is null</technical_language>

Target:
protected void setState(State state) { this.state = state; if (zkShutdownHandler != null) { zkShutdownHandler.handle(state); } else { LOG.error("ZKShutdownHandler is not registered, so ZooKeeper server " + "won't take any action on ERROR or SHUTDOWN server state changes"); } }
Source:
<code>private Process setupAndLaunch(HashMap<String, String> env) throws IOException { Process process = null; ProcessBuilder pb = (mUseRoot) ? new ProcessBuilder("su") <START> : new ProcessBuilder(mCommand); <END> if (mUseRoot) { process = pb.start(); DataOutputStream suOut = new DataOutputStream(process.getOutputStream()); for (Map.Entry<String, String> entry : env.entrySet()) { suOut.writeBytes(String.format("export %s=\"%s\"\n", entry.getKey(), entry.getValue())); } suOut.flush(); suOut.writeBytes("exec " + TextUtils.join(" ", mCommand) + "\n"); suOut = null; } else { pb.environment().putAll(env); process = pb.start(); } return process; }</code><technical_language>move this if (mUseRoot) statement? I a reason seperately</technical_language>

Target:
private Process setupAndLaunch(HashMap<String, String> env) throws IOException { Process process = null; if (mUseRoot) { ProcessBuilder pb = new ProcessBuilder("su"); process = pb.start(); DataOutputStream suOut = new DataOutputStream(process.getOutputStream()); for (Map.Entry<String, String> entry : env.entrySet()) { suOut.writeBytes(String.format("export %s=\"%s\"\n", entry.getKey(), entry.getValue())); } suOut.flush(); suOut.writeBytes("exec " + TextUtils.join(" ", mCommand) + "\n"); suOut = null; } else { ProcessBuilder pb = new ProcessBuilder(mCommand); pb.environment().putAll(env); process = pb.start(); } return process; }
Source:
<code>public void test_example() { ComponentDto project = db.components().insertPrivateProject(p -> p.setDbKey("sonarqube")); ComponentDto longLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/bar").setBranchType(BranchType.LONG)); db.components().insertProjectBranch(project, b -> b.setKey("feature/foo").setBranchType(BranchType.SHORT).setMergeBranchUuid(longLivingBranch.uuid())); userSession.logIn().addProjectPermission(UserRole.USER, project); String json = ws.newRequest() .setParam("project", project.getDbKey()) .execute() .getInput(); <START> assertJson(json).ignoreFields("analysisDate").isSimilarTo(ws.getDef().responseExampleAsString()); <END> }</code><technical_language>I assertJson manage correctly timezones. Give a try</technical_language>

Target:
public void test_example() { ComponentDto project = db.components().insertPrivateProject(p -> p.setDbKey("sonarqube")); ComponentDto longLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/bar").setBranchType(BranchType.LONG)); ComponentDto shortLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/foo").setBranchType(BranchType.SHORT).setMergeBranchUuid(longLivingBranch.uuid())); userSession.logIn().addProjectPermission(UserRole.USER, project); db.getDbClient().snapshotDao().insert(db.getSession(), SnapshotTesting.newAnalysis(longLivingBranch).setLast(true).setCreatedAt(DateUtils.parseDateTime("2017-04-01T01:15:42+0100").getTime())); db.getDbClient().snapshotDao().insert(db.getSession(), SnapshotTesting.newAnalysis(shortLivingBranch).setLast(true).setCreatedAt(DateUtils.parseDateTime("2017-04-03T13:37:00+0100").getTime())); db.commit(); String json = ws.newRequest() .setParam("project", project.getDbKey()) .execute() .getInput(); assertJson(json).isSimilarTo(ws.getDef().responseExampleAsString()); }
Source:
<code>public boolean isEmployeeGroupIdValid(String employeeGroupId) { if(StringUtils.isNotBlank(employeeGroupId)){ Collection<String> acceptedValuesForGroupId = parameterService.getParameterValuesAsString(CUKFSConstants.ParameterNamespaces.CONCUR, CUKFSParameterKeyConstants.ALL_COMPONENTS, ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID); <START> return acceptedValuesForGroupId.stream().filter(acceptedValue -> acceptedValue.equalsIgnoreCase(employeeGroupId)).count() > 0; <END> } return false; }</code><technical_language>is happen if parameter is set? this return throw exception</technical_language>

Target:
public boolean isEmployeeGroupIdValid(String employeeGroupId) { if(StringUtils.isNotBlank(employeeGroupId)){ Collection<String> acceptedValuesForGroupId = parameterService.getParameterValuesAsString(CUKFSConstants.ParameterNamespaces.CONCUR, CUKFSParameterKeyConstants.ALL_COMPONENTS, ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID); if(CollectionUtils.isNotEmpty(acceptedValuesForGroupId)){ return acceptedValuesForGroupId.stream().filter(acceptedValue -> acceptedValue.equalsIgnoreCase(employeeGroupId)).count() > 0; } } return false; }
Source:
<code>private static List<Pair<String, String>> geopoint(XmlElement element) { String[] fields = Optional.ofNullable(element.getValue()) .map(v -> v.split(" ")) .orElseThrow(() -> new BriefcaseException("No value on geopoint field")); <START> <END> List<Pair<String, String>> values = new ArrayList<>(); values.add(Pair.of(element.fqn() + "-Latitude", Optional.ofNullable(fields[0]).orElse(null))); values.add(Pair.of(element.fqn() + "-Longitude", Optional.ofNullable(fields[1]).orElse(null))); values.add(Pair.of(element.fqn() + "-Altitude", Optional.ofNullable(fields[2]).orElse(null))); values.add(Pair.of(element.fqn() + "-Accuracy", Optional.ofNullable(fields[3]).orElse(null))); return values; }</code><technical_language>This throws exception if element is empty, completing export</technical_language>

Target:
private static List<Pair<String, String>> geopoint(XmlElement element) { String[] tags = new String[]{"Latitude", "Longitude", "Altitude", "Accuracy"}; String[] fields = element.maybeValue() .map(v -> v.split(" ", 4)) .orElse(new String[]{}); return IntStream.range(0, tags.length) .mapToObj(i -> Pair.of(element.fqn() + "-" + tags[i], i < fields.length ? fields[i] : null)) .collect(toList()); }
Source:
<code>public CertificatesRotationV4Response rotateClusterCertificates(NameOrCrn nameOrCrn, Long workspaceId, CertificatesRotationV4Request certificatesRotationV4Request) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); <START> if (!stack.isAvailable()) { throw new BadRequestException(String.format( "Stack '%s' is currently in '%s' state. Certificates rotation can " <END> + "only be made when the underlying stack is 'AVAILABLE'.", stack.getName(), stack.getStatus())); } return new CertificatesRotationV4Response(clusterOperationService.rotateClusterCertificates(stack, certificatesRotationV4Request)); }</code><technical_language>this is a duplicate a words in message. please consider refactoring a common method</technical_language>

Target:
public CertificatesRotationV4Response rotateClusterCertificates(NameOrCrn nameOrCrn, Long workspaceId, CertificatesRotationV4Request certificatesRotationV4Request) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); validateOperationOnStack(stack, "Certificates rotation"); return new CertificatesRotationV4Response(clusterOperationService.rotateClusterCertificates(stack, certificatesRotationV4Request)); }
Source:
<code>public SecurityGroupVO createSecurityGroup(CreateSecurityGroupCmd cmd) throws PermissionDeniedException, InvalidParameterValueException { String name = cmd.getSecurityGroupName(); Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId()); <START> if (name.trim().equals("")) { <END> throw new InvalidParameterValueException("Security group name cannot be empty"); } if (_securityGroupDao.isNameInUse(owner.getId(), owner.getDomainId(), cmd.getSecurityGroupName())) { throw new InvalidParameterValueException("Unable to create security group, a group with name " + name + " already exists."); } return createSecurityGroup(cmd.getSecurityGroupName(), cmd.getDescription(), owner.getDomainId(), owner.getAccountId(), owner.getAccountName()); }</code><technical_language>commons check ifNotEmpty? this multiple locations in CloudStack code</technical_language>

Target:
public SecurityGroupVO createSecurityGroup(CreateSecurityGroupCmd cmd) throws PermissionDeniedException, InvalidParameterValueException { String name = cmd.getSecurityGroupName(); Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId()); if (StringUtils.isBlank(name)) { throw new InvalidParameterValueException("Security group name cannot be empty"); } if (_securityGroupDao.isNameInUse(owner.getId(), owner.getDomainId(), cmd.getSecurityGroupName())) { throw new InvalidParameterValueException("Unable to create security group, a group with name " + name + " already exists."); } return createSecurityGroup(cmd.getSecurityGroupName(), cmd.getDescription(), owner.getDomainId(), owner.getAccountId(), owner.getAccountName()); }
Source:
<code>public InitializerWizardSelectionPage(Collection<IPatternProvider> collection) { super("PatternSelection"); setTitle("Pattern Selection"); setDescription("Select a pattern to init a representation."); <START> setPageComplete(false); <END> this.patterns = collection; }</code><technical_language>Lists.newArrayList(collection) replace parameter type List</technical_language>

Target:
public InitializerWizardSelectionPage(Collection<IPatternProvider> collection) { super("PatternSelection"); setTitle("Pattern Selection"); setDescription("Select a pattern to init a representation."); setPageComplete(false); patterns = Lists.newArrayList(collection); }
Source:
<code>public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { <START> List<TmfAnalysisRequirement> requirements = new ArrayList<>(); <END> AnalysisRequirementFactory factory = new AnalysisRequirementFactory(); switch (fModule) { case TEST: requirements.add(factory.getRequirement1()); requirements.add(factory.getRequirement3()); break; case TESTCTF: requirements.add(factory.getRequirement2()); requirements.add(factory.getRequirement3()); break; default: break; } return requirements; }</code><technical_language>a Set instead of ArrayList</technical_language>

Target:
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { Set<TmfAnalysisRequirement> requirements = new HashSet<>(); AnalysisRequirementFactory factory = new AnalysisRequirementFactory(); switch (fModule) { case TEST: requirements.add(factory.getRequirement1()); requirements.add(factory.getRequirement3()); break; case TESTCTF: requirements.add(factory.getRequirement2()); requirements.add(factory.getRequirement3()); break; default: break; } return requirements; }
Source:
<code>public void postProcessQuotaManagerTest() throws Exception { Properties props = new Properties(); props.setProperty(FrontendConfig.REST_REQUEST_QUOTA_STRING, "{\"PUT\": \"20\",\"GET\": \"20\",\"POST\": \"20\",\"HEAD\": \"20\",\"OPTIONS\": \"20\",\"UNKNOWN\": \"20\",\"DELETE\": \"20\"}"); FrontendConfig frontendConfig = new FrontendConfig(new VerifiableProperties(props)); RejectThrottlerTest.MockClock clock = new RejectThrottlerTest.MockClock(); AmbrySecurityService ambrySecurityService = new AmbrySecurityService(frontendConfig, new FrontendMetrics(new MetricRegistry()), URL_SIGNING_SERVICE_FACTORY.getUrlSigningService(), new QuotaManagerTest.MockQuotaManager(frontendConfig, clock)); for (int i = 0; i < 100; i++) { <START> for (RestMethod resetMethod : RestMethod.values()) { <END> RestRequest restRequest = createRestRequest(resetMethod, "/", null); ambrySecurityService.postProcessRequest(restRequest).get(); } } clock.tick(5); for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "/", null); try { ambrySecurityService.postProcessRequest(restRequest).get(); Assert.fail("Should have failed."); } catch (Exception e) { Assert.assertEquals("Exception should be TooManyRequests", RestServiceErrorCode.TooManyRequests, ((RestServiceException) e.getCause()).getErrorCode()); } } clock.tick(5); for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "/", null); ambrySecurityService.postProcessRequest(restRequest).get(); } }</code><technical_language>s/resetMethod/restMethod</technical_language>

Target:
public void postProcessQuotaManagerTest() throws Exception { QuotaManager quotaManager = Mockito.mock(QuotaManager.class); AmbrySecurityService ambrySecurityService = new AmbrySecurityService(new FrontendConfig(new VerifiableProperties(new Properties())), new FrontendMetrics(new MetricRegistry()), URL_SIGNING_SERVICE_FACTORY.getUrlSigningService(), quotaManager); Mockito.when(quotaManager.shouldThrottle(any())).thenReturn(false); for (int i = 0; i < 100; i++) { for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "/", null); ambrySecurityService.postProcessRequest(restRequest).get(); } } Mockito.when(quotaManager.shouldThrottle(any())).thenReturn(true); for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "/", null); try { ambrySecurityService.postProcessRequest(restRequest).get(); Assert.fail("Should have failed."); } catch (Exception e) { Assert.assertEquals("Exception should be TooManyRequests", RestServiceErrorCode.TooManyRequests, ((RestServiceException) e.getCause()).getErrorCode()); } } }
Source:
<code>public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { <START> LttngUstTrace trace = getTrace(); <END> ILttngUstEventLayout layout; if (trace == null) { layout = ILttngUstEventLayout.DEFAULT_LAYOUT; } else { layout = trace.getEventLayout(); } Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { @NonNull Set<@NonNull String> requiredEventsFields = checkNotNull(ImmutableSet.of( layout.contextProcname(), layout.contextVtid())); @NonNull TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement( checkNotNull(ImmutableSet.of(layout.eventCygProfileFuncEntry(), layout.eventCygProfileFastFuncEntry())), requiredEventsFields, ValuePriorityLevel.MANDATORY); @NonNull TmfAnalysisEventFieldRequirement exitReq = new TmfAnalysisEventFieldRequirement( checkNotNull(ImmutableSet.of(layout.eventCygProfileFuncExit(), layout.eventCygProfileFastFuncExit())), requiredEventsFields, ValuePriorityLevel.MANDATORY); exitReq.addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation)); requirements = checkNotNull(ImmutableSet.of(entryReq, exitReq)); fAnalysisRequirements = requirements; } return requirements; }</code><technical_language>do this part in if analysis requirement is set</technical_language>

Target:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; if (trace != null) { layout = trace.getEventLayout(); } @NonNull Set<@NonNull String> requiredEventsFields = ImmutableSet.of( layout.contextProcname(), layout.contextVtid()); @NonNull TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncEntry(), layout.eventCygProfileFastFuncEntry()), requiredEventsFields, ValuePriorityLevel.MANDATORY); @NonNull TmfAnalysisEventFieldRequirement exitReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncExit(), layout.eventCygProfileFastFuncExit()), requiredEventsFields, ValuePriorityLevel.MANDATORY); exitReq.addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation)); requirements = ImmutableSet.of(entryReq, exitReq); fAnalysisRequirements = requirements; } return requirements; }
Source:
<code>public void reset(){ BadRecordsRecorder oldRecorder = this.badRecordsAccumulator.value(); BadRecordsRecorder badRecordsRecorder = new BadRecordsRecorder( oldRecorder.getStatusDirectory(), importFileName, badRecordThreshold); <START> this.badRecordsAccumulator=SpliceSpark.getContext().accumulable(badRecordsRecorder, <END> badRecordsRecorder.getUniqueName(), new BadRecordsAccumulator()); badRecordsSeen = 0; String baseName=""; if (op != null) { baseName = "(" + op.resultSetNumber() + ") " + op.getName() + " "; } this.rowsRead = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows read"); this.rowsFiltered = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows filtered"); this.rowsWritten = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows written"); this.rowsJoinedLeft = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined left"); this.rowsJoinedRight = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined right"); this.rowsProduced = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows produced"); initWritePipeline(); List<SpliceOperation> operations=getOperation().getSubOperations(); if(operations!=null){ for(SpliceOperation operation : operations){ if(operation.getOperationContext()!=null) operation.getOperationContext().reset(); } } }</code><technical_language>This initialized if permissive is true</technical_language>

Target:
public void reset(){ if (this.permissive) { BadRecordsRecorder oldRecorder = this.badRecordsAccumulator.value(); BadRecordsRecorder badRecordsRecorder = new BadRecordsRecorder( oldRecorder.getStatusDirectory(), importFileName, badRecordThreshold); this.badRecordsAccumulator = SpliceSpark.getContext().accumulable(badRecordsRecorder, badRecordsRecorder.getUniqueName(), new BadRecordsAccumulator()); } badRecordsSeen = 0; String baseName=""; if (op != null) { baseName = "(" + op.resultSetNumber() + ") " + op.getName() + " "; } this.rowsRead = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows read"); this.rowsFiltered = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows filtered"); this.rowsWritten = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows written"); this.rowsJoinedLeft = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined left"); this.rowsJoinedRight = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined right"); this.rowsProduced = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows produced"); initWritePipeline(); List<SpliceOperation> operations=getOperation().getSubOperations(); if(operations!=null){ for(SpliceOperation operation : operations){ if(operation.getOperationContext()!=null) operation.getOperationContext().reset(); } } }
Source:
<code>public static void main(String[] args) { TpchStatisticsRecorder tool = new TpchStatisticsRecorder(new TableStatisticsRecorder(), new TableStatisticsDataRepository(createObjectMapper())); <START> ImmutableList.of("tiny", "sf1").forEach(schemaName -> { <END> TpchTable.getTables() .forEach(table -> tool.computeAndOutputStatsFor(schemaName, table)); Stream.of("F", "O", "P").forEach(partitionValue -> tool.computeAndOutputStatsFor(schemaName, ORDERS, ORDER_STATUS, partitionValue)); }); }</code><technical_language>extract COMPUTED_SCHEMAS constant</technical_language>

Target:
public static void main(String[] args) { TpchStatisticsRecorder tool = new TpchStatisticsRecorder(new TableStatisticsRecorder(), new TableStatisticsDataRepository(createObjectMapper())); SUPPORTED_SCHEMAS.forEach(schemaName -> { TpchTable.getTables() .forEach(table -> tool.computeAndOutputStatsFor(schemaName, table)); Stream.of("F", "O", "P").forEach(partitionValue -> tool.computeAndOutputStatsFor(schemaName, ORDERS, ORDER_STATUS, partitionValue)); }); }
Source:
<code><START> private List<ImapResponse> handlePermanentXoauth2Failure(NegativeImapResponseException e) throws AuthenticationFailedException { <END> Log.v(LOG_TAG, "Permanent failure during XOAUTH2", e); throw new AuthenticationFailedException(e.getMessage(), e); }</code><technical_language>This feels weird. return AuthenticationFailedException, rename permanentXoauth2Failure change call sites java throw permanentXoauth2Failure( );</technical_language>

Target:
private AuthenticationFailedException handlePermanentXoauth2Failure(NegativeImapResponseException e) { Timber.v(e, "Permanent failure during XOAUTH2"); return new AuthenticationFailedException(e.getMessage(), e); }
Source:
<code><START> default boolean supports(Class<? extends ProjectFacet> facet) <END> { return getBundledFacets() .stream() .anyMatch((includedFacet) -> facet.isAssignableFrom(includedFacet)); }</code><technical_language>Nice :)</technical_language>

Target:
default boolean supports(Class<? extends ProjectFacet> facet) { Set<Class<? extends ProjectFacet>> excludedFacets = getExcludedFacets(); return getIncludedFacets() .stream() .anyMatch((includedFacet) -> facet.isAssignableFrom(includedFacet) && !excludedFacets.contains(includedFacet)); }
Source:
<code>private void createStore(boolean slow) throws PersistenceException { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); DummyInMemoryStoreConfigurationBuilder dummyCfg = builder .persistence() .addStore(DummyInMemoryStoreConfigurationBuilder.class) .storeName(AsyncStoreTest.class.getName()); dummyCfg .async() .enable() .threadPoolSize(10); dummyCfg.slow(slow); InitializationContext ctx = PersistenceMockUtil.createContext(getClass().getSimpleName(), builder.build(), marshaller); DummyInMemoryStore underlying = new DummyInMemoryStore(); underlying.init(ctx); underlying.start(); writer = new SlowAdvancedAsyncCacheWriter(underlying); writer.init(ctx); loader = new AdvancedAsyncCacheLoader(underlying, writer.getState()); loader.init(ctx); <START> writer.start(); <END> loader.start(); eventually(writer::isAvailable); }</code><technical_language>Is this change needed</technical_language>

Target:
private void createStore(boolean slow) throws PersistenceException { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); DummyInMemoryStoreConfigurationBuilder dummyCfg = builder .persistence() .addStore(DummyInMemoryStoreConfigurationBuilder.class) .storeName(AsyncStoreTest.class.getName()); dummyCfg .async() .enable() .threadPoolSize(10); dummyCfg.slow(slow); InitializationContext ctx = PersistenceMockUtil.createContext(getClass().getSimpleName(), builder.build(), marshaller); DummyInMemoryStore underlying = new DummyInMemoryStore(); underlying.init(ctx); underlying.start(); writer = new SlowAdvancedAsyncCacheWriter(underlying); writer.init(ctx); writer.start(); loader = new AdvancedAsyncCacheLoader(underlying, writer.getState()); loader.init(ctx); loader.start(); eventually(writer::isAvailable); }
Source:
<code>protected boolean isAutoClaim(KieSession session, WorkItem workItem, Task task) { <START> if(Boolean.parseBoolean((String)session.getEnvironment().get("Autoclaim"))) { <END> String swimlaneUser = (String) workItem.getParameter("SwimlaneActorId"); if (swimlaneUser != null && !"".equals(swimlaneUser) && task.getTaskData().getStatus() == Status.Ready) { return true; } } return false; }</code><technical_language>This is changing default behavior autoclaim active default. This remain way. autonclaim is explicitly disabled environment entry</technical_language>

Target:
protected boolean isAutoClaim(KieSession session, WorkItem workItem, Task task) { String autoclaim = (String) session.getEnvironment().get("Autoclaim"); if(autoclaim != null && !Boolean.parseBoolean(autoclaim.trim())) { return false; } else { String swimlaneUser = (String) workItem.getParameter("SwimlaneActorId"); if (swimlaneUser != null && !"".equals(swimlaneUser) && task.getTaskData().getStatus() == Status.Ready) { return true; } } return false; }
Source:
<code>public void stop() { <START> metricsRepoter.close(); <END> }</code><technical_language>metricsRepoter is null closing? Calling stop calling start throw NPE</technical_language>

Target:
public void stop() { if (metricsReporter != null) { metricsReporter.close(); } }
Source:
<code>private Comparator<Schedulable> createComparator(int clusterMem, int clusterCpu) { DominantResourceFairnessPolicy policy = new DominantResourceFairnessPolicy(); FSContext fsContext = mock(FSContext.class); when(fsContext.getClusterResource()). <START> thenReturn(BuilderUtils.newResource(clusterMem, clusterCpu)); <END> policy.initialize(fsContext); return policy.getComparator(); }</code><technical_language>Resources.create instead of BuilterUtils.newInstance</technical_language>

Target:
private Comparator<Schedulable> createComparator(int clusterMem, int clusterCpu) { DominantResourceFairnessPolicy policy = new DominantResourceFairnessPolicy(); FSContext fsContext = mock(FSContext.class); when(fsContext.getClusterResource()). thenReturn(Resources.createResource(clusterMem, clusterCpu)); policy.initialize(fsContext); return policy.getComparator(); }
Source:
<code>public void listenForResponses(String topic, Message requestMessage) { this.topic = topic; this.requestMessage = requestMessage; collectorSubscriber.registerCollector(topic, this); <START> channelManager.subscribe(this.topic, collectorSubscriber); <END> }</code><technical_language>a hack. overwrite subscribe</technical_language>

Target:
public void listenForResponses(String topic, Message requestMessage) { this.requestMessage = requestMessage; collectorManager = findOrCreateCollectorManager(topic); collectorManager.registerCollector(this); }
Source:
<code>public String getUrlWithMethod(String url, String method) { url = url.toLowerCase() .replaceAll("https://", "") <START> .replaceAll("http://", ""); <END> return (method + "://" + getPiwigoBaseFor(url)); }</code><technical_language>bother again, this complete URL case? part ":" (if any) case</technical_language>

Target:
public String getUrlWithMethod(String url, String method) { url = url .replaceAll("(?i)https://", "") .replaceAll("(?i)http://", ""); return (method + "://" + getPiwigoBaseFor(url)); }
Source:
<code>protected void checkObjectTypeDefinition(Set<SwaggerError> errors, AbstractNode node) { if (node instanceof ObjectNode) { JsonPointer ptr = node.getPointer(); <START> if (ptr != null && ptr.toString().startsWith("/definitions")) { <END> checkMissingType(errors, node); checkMissingRequiredProperties(errors, node); } } }</code><technical_language>this check performed for inline types</technical_language>

Target:
protected void checkObjectTypeDefinition(Set<SwaggerError> errors, AbstractNode node) { if (node instanceof ObjectNode) { JsonPointer ptr = node.getPointer(); if (ptr != null) { if (ptr.toString().startsWith("/definitions")) { checkMissingType(errors, node); checkMissingRequiredProperties(errors, node); } else if (ptr.toString().endsWith("/schema")) { checkMissingType(errors, node); checkMissingRequiredProperties(errors, node); } } } }
Source:
<code>public boolean requestPipeExtension(World world, BlockPos pos, EnumFacing dir, IStripesActivator stripes, ItemStack stack) { if (world.isRemote || stack.isEmpty() || !(stack.getItem() instanceof IItemPipe)) { return false; } <START> return requests.computeIfAbsent(world.provider.getDimension(), i -> new LinkedHashSet<>()) <END> .add(new PipeExtensionRequest(pos, dir, stripes, ((IItemPipe) stack.getItem()).getDefinition(), stack.copy())); }</code><technical_language>a List? defined equals hashCode, new PipeExtensionRequest return a object, negating point of a set. (Although want group requests, want a set)</technical_language>

Target:
public boolean requestPipeExtension(World world, BlockPos pos, EnumFacing dir, IStripesActivator stripes, ItemStack stack) { if (world.isRemote || stack.isEmpty() || !(stack.getItem() instanceof IItemPipe)) { return false; } int id = world.provider.getDimension(); List<PipeExtensionRequest> rList = requests.get(id); if (rList == null) { requests.put(id, rList = new ArrayList<>()); } return rList.add(new PipeExtensionRequest(pos, dir, stripes, ((IItemPipe) stack.getItem()).getDefinition(), stack.copy())); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.fragment_settings, container, false); wifiSwitch = (Switch) layout.findViewById(R.id.wifi_setting); mSDCardSwitch = (Switch) layout.findViewById(R.id.download_location_switch); updateWifiSwitch(); updateSDCardSwitch(); <START> final LinearLayout settingsLayout = (LinearLayout) layout.findViewById(R.id.settings_layout); <END> for (SettingsExtension extension : extensionRegistry.forType(SettingsExtension.class)) { extension.onCreateSettingsView(settingsLayout); } return layout; }</code><technical_language>This new line sense, removed</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.fragment_settings, container, false); wifiSwitch = (Switch) layout.findViewById(R.id.wifi_setting); sdCardSwitch = (Switch) layout.findViewById(R.id.download_location_switch); sdCardSettinglayout = (LinearLayout) layout.findViewById(R.id.sd_card_setting_layout); updateWifiSwitch(); updateSDCardSwitch(); final LinearLayout settingsLayout = (LinearLayout) layout.findViewById(R.id.settings_layout); for (SettingsExtension extension : extensionRegistry.forType(SettingsExtension.class)) { extension.onCreateSettingsView(settingsLayout); } return layout; }
Source:
<code>public StateDescription getStateDescription(Locale locale) { StateDescription fullStateDescription = null; if (stateDescriptionProviders != null) { BigDecimal minimum = null; BigDecimal maximum = null; BigDecimal step = null; String pattern = null; boolean readOnly = false; List<StateOption> options = null; boolean found = false; for (StateDescriptionProvider stateDescriptionProvider : stateDescriptionProviders) { StateDescription stateDescription = stateDescriptionProvider.getStateDescription(this.name, locale); if (stateDescription != null) { found = true; if (minimum == null) { minimum = stateDescription.getMinimum(); } if (maximum == null) { maximum = stateDescription.getMaximum(); } if (step == null) { step = stateDescription.getStep(); } if (pattern == null) { pattern = stateDescription.getPattern(); } if (stateDescription.isReadOnly()) { readOnly = true; } if (options == null) { options = stateDescription.getOptions(); } } } if (found) { <START> fullStateDescription = new StateDescription(minimum, maximum, step, pattern, readOnly, options); <END> } } return fullStateDescription; }</code><technical_language>idea is mix state descriptions of providers, right? This lead unexpected results, I this is a good idea. I want mix this a PR intends add a default state description (or I understand is related)</technical_language>

Target:
public StateDescription getStateDescription(Locale locale) { if (stateDescriptionProviders != null) { for (StateDescriptionProvider stateDescriptionProvider : stateDescriptionProviders) { StateDescription stateDescription = stateDescriptionProvider.getStateDescription(this.name, locale); if (stateDescription != null) { return stateDescription; } } } return null; }
Source:
<code>private void createHeadLink(final Repository repository, Composite composite) throws IOException { <START> ObjectId objectId = null; <END> String fullBranch = repository.getFullBranch(); if (fullBranch != null) { objectId = repository.resolve(fullBranch); } if (objectId == null) { Text headLabel = createLabeledReadOnlyText(composite, UIText.GitProjectPropertyPage_LabelId); if (repository.getRefDatabase().getRefsByPrefix(RefDatabase.ALL) .isEmpty()) headLabel.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository); else headLabel.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch); } else { Hyperlink headLink = createHeadHyperLink(composite, UIText.GitProjectPropertyPage_LabelId); headLink.setText(objectId.name()); headLink.setUnderlined(true); headLink.setFont(JFaceResources.getDialogFont()); headLink.setForeground(JFaceColors.getHyperlinkText(headLink .getDisplay())); ObjectId linkObjectId = objectId; headLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { RepositoryCommit commit = getCommit(repository, linkObjectId); if(commit != null) CommitEditor.openQuiet(commit); } }); } }</code><technical_language>ternary operator this variable final need define another variable below</technical_language>

Target:
private void createHeadLink(final Repository repository, Composite composite) throws IOException { String fullBranch = repository.getFullBranch(); final ObjectId objectId = (fullBranch != null) ? repository.resolve(fullBranch) : null; if (objectId == null) { Text headLabel = createLabeledReadOnlyText(composite, UIText.GitProjectPropertyPage_LabelId); if (repository.getRefDatabase().getRefsByPrefix(RefDatabase.ALL) .isEmpty()) headLabel.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository); else headLabel.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch); } else { Hyperlink headLink = createHeadHyperLink(composite, UIText.GitProjectPropertyPage_LabelId); headLink.setText(objectId.name()); headLink.setUnderlined(true); headLink.setFont(JFaceResources.getDialogFont()); headLink.setForeground(JFaceColors.getHyperlinkText(headLink .getDisplay())); headLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { RepositoryCommit commit = getCommit(repository, objectId); if(commit != null) CommitEditor.openQuiet(commit); } }); } }
Source:
<code>public CompletableFuture<?> getAvailableFuture() { <START> if (inputSelectionHandler.areAllInputsSelected() || (inputSelectionHandler.isInputUnavailable(0) && !inputSelectionHandler.isInputUnavailable(1))) { <END> return isAnyInputAvailable(); } else { StreamOneInputProcessor<?> input = (inputSelectionHandler.isFirstInputSelected()) ? processor1 : processor2; return input.getAvailableFuture(); } }</code><technical_language>I get this condition. unavailable, while available</technical_language>

Target:
public CompletableFuture<?> getAvailableFuture() { if (inputSelectionHandler.areAllInputsSelected()) { return isAnyInputAvailable(); } else { StreamOneInputProcessor<?> input = (inputSelectionHandler.isFirstInputSelected()) ? processor1 : processor2; return input.getAvailableFuture(); } }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { int itemId = item.getItemId(); if (itemId == R.id.edit_task) { mCallback.onEditTask(mTaskUri, mContentSet); return true; } else if (itemId == R.id.delete_task) { new AlertDialog.Builder(getActivity()).setTitle(R.string.confirm_delete_title).setCancelable(true) .setNegativeButton(android.R.string.cancel, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }).setPositiveButton(android.R.string.ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (mContentSet != null) { mContentSet.delete(mAppContext); mCallback.onDelete(mTaskUri); } } }).setMessage(R.string.confirm_delete_message).create().show(); return true; } else if (itemId == R.id.complete_task) { completeTask(); return true; } else if (itemId == R.id.pin_task) { if (TaskFieldAdapters.PINNED.get(mContentSet)) { item.setIcon(R.drawable.ic_pin_white_24dp); TaskNotificationHandler.unpinTask(mAppContext, mContentSet); } else { item.setIcon(R.drawable.ic_pin_off_white_24dp); TaskNotificationHandler.pinTask(mAppContext, mContentSet); } persistTask(); return true; } else if (itemId == R.id.share_task) { <START> shareTaskDescription(); <END> return true; } else { return super.onOptionsItemSelected(item); } }</code><technical_language>Do need additional method for this one-liner</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { int itemId = item.getItemId(); if (itemId == R.id.edit_task) { mCallback.onEditTask(mTaskUri, mContentSet); return true; } else if (itemId == R.id.delete_task) { new AlertDialog.Builder(getActivity()).setTitle(R.string.confirm_delete_title).setCancelable(true) .setNegativeButton(android.R.string.cancel, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }).setPositiveButton(android.R.string.ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (mContentSet != null) { mContentSet.delete(mAppContext); mCallback.onDelete(mTaskUri); } } }).setMessage(R.string.confirm_delete_message).create().show(); return true; } else if (itemId == R.id.complete_task) { completeTask(); return true; } else if (itemId == R.id.pin_task) { if (TaskFieldAdapters.PINNED.get(mContentSet)) { item.setIcon(R.drawable.ic_pin_white_24dp); TaskNotificationHandler.unpinTask(mAppContext, mContentSet); } else { item.setIcon(R.drawable.ic_pin_off_white_24dp); TaskNotificationHandler.pinTask(mAppContext, mContentSet); } persistTask(); return true; } else if (itemId == R.id.opentasks_share_task) { setShareMenuIntent(); return false; } else { return super.onOptionsItemSelected(item); } }
Source:
<code>public void classTearDown() throws IOException { <START> generateResultAnalysis("InstructorStudentEnrollmentLNPTest", 0.2, 60000); <END> deleteTestData(JSON_DATA_PATH); deleteDataFiles(); }</code><technical_language>shift this line? due some restrictions output is displayed in build output</technical_language>

Target:
public void classTearDown() throws IOException { deleteTestData(); deleteDataFiles(); }
Source:
<code>public void setProgressBarVisibility(boolean visibility) { if(visibility) { <START> submitConfirm.setClickable(false); <END> } else { submitConfirm.setClickable(true); } progressBar.setVisibility(visibility ? View.VISIBLE : View.GONE); }</code><technical_language>simplify this statement: submitConfirm.setClickable(!visibility);</technical_language>

Target:
public void setProgressBarVisibility(boolean visibility) { submitConfirm.setEnabled(!visibility); progressBar.setVisibility(visibility ? View.VISIBLE : View.GONE); }
Source:
<code>private void cleanupWorkflow(String workflow, WorkflowConfig workflowcfg) { LOG.info("Cleaning up workflow: " + workflow); HelixDataAccessor accessor = _manager.getHelixDataAccessor(); for (String job : workflowcfg.getJobDag().getAllNodes()) { cleanupJob(job, workflow); } if (workflowcfg.isTerminable() || workflowcfg.getTargetState() == TargetState.DELETE) { cleanupIdealStateExtView(_manager.getHelixDataAccessor(), workflow); PropertyKey workflowCfgKey = TaskUtil.getWorkflowConfigKey(accessor, workflow); if (accessor.getProperty(workflowCfgKey) != null) { if (!accessor.removeProperty(workflowCfgKey)) { LOG.error(String.format( "Error occurred while trying to clean up workflow %s. Failed to remove node %s from Helix.", workflow, workflowCfgKey)); } } <START> String workflowPropStoreKey = TaskUtil.getWorkflowContextKey(workflow); <END> LOG.info("Removing workflow context: " + workflowPropStoreKey); if (!TaskUtil.removeWorkflowContext(_manager, workflow)) { LOG.error(String.format( "Error occurred while trying to clean up workflow %s. Failed to remove node %s from Helix. Aborting further clean up steps.", workflow, workflowPropStoreKey)); } _scheduledRebalancer.removeScheduledRebalance(workflow); } }</code><technical_language>this is needed, right</technical_language>

Target:
private void cleanupWorkflow(String workflow, WorkflowConfig workflowcfg) { LOG.info("Cleaning up workflow: " + workflow); HelixDataAccessor accessor = _manager.getHelixDataAccessor(); for (String job : workflowcfg.getJobDag().getAllNodes()) { cleanupJob(job, workflow); } if (workflowcfg.isTerminable() || workflowcfg.getTargetState() == TargetState.DELETE) { cleanupIdealStateExtView(_manager.getHelixDataAccessor(), workflow); PropertyKey workflowCfgKey = TaskUtil.getWorkflowConfigKey(accessor, workflow); if (accessor.getProperty(workflowCfgKey) != null) { if (!accessor.removeProperty(workflowCfgKey)) { LOG.error(String.format( "Error occurred while trying to clean up workflow %s. Failed to remove node %s from Helix.", workflow, workflowCfgKey)); } } LOG.info("Removing workflow context: " + workflow); if (!TaskUtil.removeWorkflowContext(_manager, workflow)) { LOG.error(String.format( "Error occurred while trying to clean up workflow %s. Aborting further clean up steps.", workflow)); } _scheduledRebalancer.removeScheduledRebalance(workflow); } }