auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public TransactionId execute() throws OseeCoreException { Conditions.checkNotNull(comment, "comment"); if (isEmpty() && execptionIfEmpty) { throw new OseeArgumentException("objects/deleteObjects cannot be empty"); } for (IAtsObject atsObject : new ArrayList<>(atsObjects)) { if (atsObject instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) atsObject; if (workItem.getStateMgr().isDirty()) { atsServer.getStateFactory().writeToStore(asUser, workItem, this); } if (workItem.getLog().isDirty()) { atsServer.getLogFactory().writeToStore(workItem, atsServer.getAttributeResolver(), this); } } } TransactionReadable transactionReadable = getTransaction().commit(); <START> System.err.println("too many listeners or processed too many times"); <END> for (IExecuteListener listener : listeners) { listener.changesStored(this); } notifier.sendNotifications(getNotifications()); if (!workItemsCreated.isEmpty()) { WorkflowRuleRunner runner = new WorkflowRuleRunner(RuleEventType.CreateWorkflow, workItemsCreated, atsServer); runner.run(); } return transactionReadable; }</code><technical_language>remove debug statement</technical_language>

Target:
public TransactionId execute() throws OseeCoreException { Conditions.checkNotNull(comment, "comment"); if (isEmpty() && execptionIfEmpty) { throw new OseeArgumentException("objects/deleteObjects cannot be empty"); } for (IAtsObject atsObject : new ArrayList<>(atsObjects)) { if (atsObject instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) atsObject; if (workItem.getStateMgr().isDirty()) { atsServer.getStateFactory().writeToStore(asUser, workItem, this); } if (workItem.getLog().isDirty()) { atsServer.getLogFactory().writeToStore(workItem, atsServer.getAttributeResolver(), this); } } } TransactionReadable transactionReadable = getTransaction().commit(); for (IExecuteListener listener : listeners) { listener.changesStored(this); } notifier.sendNotifications(getNotifications()); if (!workItemsCreated.isEmpty()) { WorkflowRuleRunner runner = new WorkflowRuleRunner(RuleEventType.CreateWorkflow, workItemsCreated, atsServer); runner.run(); } return transactionReadable; }
Source:
<code><START> public Date getLastActivity() { <END> return latestSuccess != null ? (Date)latestSuccess.clone() : null; }</code><technical_language>Thoughts naming this getLastSuccess() getLastProgress() instead</technical_language>

Target:
public long getLastActivity() { return latestSuccess != null ? latestSuccess.getTime() : 0; }
Source:
<code>public MethodBehavior execute(MethodTree methodTree) { ExplodedGraphWalker walker = egwFactory.createWalker(behaviorCache, (SemanticModel) context.getSemanticModel()); try { Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (methodCanNotBeOverriden(methodSymbol)) { <START> MethodBehavior methodBehavior = behaviorCache.add(methodSymbol); <END> if(!methodBehavior.isVisited()) { methodBehavior = walker.visitMethod(methodTree, methodBehavior); methodBehavior.completed(); } return methodBehavior; } else { return walker.visitMethod(methodTree); } } catch (ExplodedGraphWalker.MaximumStepsReachedException | ExplodedGraphWalker.ExplodedGraphTooBigException | RelationalSymbolicValue.TransitiveRelationExceededException exception) { LOG.debug("Could not complete symbolic execution: ", exception); if(walker.methodBehavior != null) { walker.methodBehavior.visited(); } } return null; }</code><technical_language>I name of this method, more "adding" symbol cache</technical_language>

Target:
public MethodBehavior execute(MethodTree methodTree) { ExplodedGraphWalker walker = egwFactory.createWalker(behaviorCache, (SemanticModel) context.getSemanticModel()); try { Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (methodCanNotBeOverriden(methodSymbol)) { MethodBehavior methodBehavior = behaviorCache.methodBehaviorForSymbol(methodSymbol); if (!methodBehavior.isVisited()) { methodBehavior = walker.visitMethod(methodTree, methodBehavior); methodBehavior.completed(); } return methodBehavior; } else { return walker.visitMethod(methodTree); } } catch (ExplodedGraphWalker.MaximumStepsReachedException | ExplodedGraphWalker.ExplodedGraphTooBigException | RelationalSymbolicValue.TransitiveRelationExceededException exception) { LOG.debug("Could not complete symbolic execution: ", exception); if (walker.methodBehavior != null) { walker.methodBehavior.visited(); } } return null; }
Source:
<code>public void testDisconnectedListOnClose() throws Exception { String connectionId = blockingConnect(); selector.close(connectionId); <START> selector.poll(0); <END> assertEquals("There should be a disconnect", 1, selector.disconnected().size()); assertTrue("Expected connectionId " + connectionId + " missing from selector's disconnected list ", selector.disconnected().contains(connectionId)); }</code><technical_language>add a check ensure a call disconnected() poll return connection id</technical_language>

Target:
public void testDisconnectedListOnClose() throws Exception { String connectionId = blockingConnect(); assertEquals("Disconnect list should be empty", 0, selector.disconnected().size()); selector.close(connectionId); selector.poll(0); assertEquals("There should be a disconnect", 1, selector.disconnected().size()); assertTrue("Expected connectionId " + connectionId + " missing from selector's disconnected list ", selector.disconnected().contains(connectionId)); selector.poll(0); assertEquals("Disconnect list should be empty", 0, selector.disconnected().size()); }
Source:
<code>public Future<BlobInfo> getBlobInfo(String blobId, Callback<BlobInfo> callback) { currentOperationsCount.incrementAndGet(); routerMetrics.getBlobInfoOperationRate.mark(); routerMetrics.operationQueuingRate.mark(); FutureResult<BlobInfo> futureResult = new FutureResult<BlobInfo>(); if (isOpen.get()) { getOperationController().getBlobInfo(blobId, futureResult, callback); } else { RouterException routerException = new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed); routerMetrics.operationDequeuingRate.mark(); <START> routerMetrics.operationAbortCount.inc(); <END> routerMetrics.getBlobInfoErrorCount.inc(); routerMetrics.countError(routerException); operationCompleteCallback.completeOperation(futureResult, callback, null, routerException); } return futureResult; }</code><technical_language>abort is out of place here</technical_language>

Target:
public Future<BlobInfo> getBlobInfo(String blobId, Callback<BlobInfo> callback) { currentOperationsCount.incrementAndGet(); routerMetrics.getBlobInfoOperationRate.mark(); routerMetrics.operationQueuingRate.mark(); FutureResult<BlobInfo> futureResult = new FutureResult<BlobInfo>(); if (isOpen.get()) { getOperationController().getBlobInfo(blobId, futureResult, callback); } else { RouterException routerException = new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed); routerMetrics.operationDequeuingRate.mark(); routerMetrics.getBlobInfoErrorCount.inc(); routerMetrics.countError(routerException); operationCompleteCallback.completeOperation(futureResult, callback, null, routerException); } return futureResult; }
Source:
<code>public static void main(String[] args) throws Exception { Map<String, Object> cl = CLI.opt("w", "wait", null, CLI.AS_INT) .boolOpt("i", "ignore-errors") .arg("TOPO", CLI.INTO_LIST) .parse(args); @SuppressWarnings("unchecked") final List<String> names = (List<String>) cl.get("TOPO"); <START> for (String name : names) { <END> Utils.validateTopologyName(name); } Integer wait = (Integer) cl.get("w"); Boolean continueOnError = (Boolean) cl.get("i"); final KillOptions opts = new KillOptions(); if (wait != null) { opts.set_wait_secs(wait); } NimbusClient.withConfiguredClient(new NimbusClient.WithNimbus() { @Override public void run(Nimbus.Iface nimbus) throws Exception { int errorCount = 0; for (String name : names) { try { nimbus.killTopologyWithOpts(name, opts); LOG.info("Killed topology: {}", name); } catch (Exception e) { errorCount += 1; if (!continueOnError) { throw e; } else { LOG.error( "Caught error killing topology '{}'; continuing as -i was passed.", name, e ); } } } if (errorCount > 0) { throw new RuntimeException("Failed to successfully kill " + errorCount + " topologies."); } } }); }</code><technical_language>This treated differently continueOnError option here</technical_language>

Target:
public static void main(String[] args) throws Exception { Map<String, Object> cl = CLI.opt("w", "wait", null, CLI.AS_INT) .boolOpt("i", "ignore-errors") .arg("TOPO", CLI.INTO_LIST) .parse(args); @SuppressWarnings("unchecked") final List<String> names = (List<String>) cl.get("TOPO"); Boolean continueOnError = (Boolean) cl.get("i"); errorCount = 0; Iterator<String> iterator = names.iterator(); while (iterator.hasNext()) { String name = iterator.next(); try { Utils.validateTopologyName(name); } catch (IllegalArgumentException e) { if (!continueOnError) { throw e; } else { iterator.remove(); errorCount += 1; LOG.error("Format of topology name is not valid ", name); } } } if (names.isEmpty()) { throw new RuntimeException("Failed to successfully kill " + errorCount + " topologies."); } Integer wait = (Integer) cl.get("w"); final KillOptions opts = new KillOptions(); if (wait != null) { opts.set_wait_secs(wait); } NimbusClient.withConfiguredClient(new NimbusClient.WithNimbus() { @Override public void run(Nimbus.Iface nimbus) throws Exception { for (String name : names) { try { nimbus.killTopologyWithOpts(name, opts); LOG.info("Killed topology: {}", name); } catch (Exception e) { errorCount += 1; if (!continueOnError) { throw e; } else { LOG.error( "Caught error killing topology '{}'; continuing as -i was passed.", name, e ); } } } if (errorCount > 0) { throw new RuntimeException("Failed to successfully kill " + errorCount + " topologies."); } } }); }
Source:
<code>public void VEAndRTEDisabledEditorEntryAnonTests_009_actionEdit() { SourceEditModePageObject src = <START> base.navigateToArticleEditPageSrc(wikiURL, PageContent.articleNamePrefix + base.getTimeStamp()); <END> src.verifySourceOnlyMode(); }</code><technical_language>please move creating articleName separate line</technical_language>

Target:
public void VEAndRTEDisabledEditorEntryAnonTests_009_actionEdit() { SourceEditModePageObject src = base.navigateToArticleEditPageSrc(wikiURL, base.getNameForArticle()); src.verifySourceOnlyMode(); }
Source:
<code>protected PersistenceExceptionTranslator detectPersistenceExceptionTranslators(ListableBeanFactory beanFactory) { Map<String, PersistenceExceptionTranslator> pets = BeanFactoryUtils.beansOfTypeIncludingAncestors( beanFactory, PersistenceExceptionTranslator.class, false, false); Comparator<Object> comparatorToUse = null; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } if (comparatorToUse == null) { comparatorToUse = OrderComparator.INSTANCE; <START> } <END> List<PersistenceExceptionTranslator> translators = new ArrayList<>(pets.values()); translators.sort(comparatorToUse); ChainedPersistenceExceptionTranslator cpet = new ChainedPersistenceExceptionTranslator(); for (PersistenceExceptionTranslator pet : translators) { cpet.addDelegate(pet); } return cpet; }</code><technical_language>I code more compact elegant Comparator<Object> comparatorToUse = OrderComparator.INSTANCE; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } simply Comparator<Object> comparatorToUse; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } else { comparatorToUse = OrderComparator.INSTANCE; }</technical_language>

Target:
protected PersistenceExceptionTranslator detectPersistenceExceptionTranslators(ListableBeanFactory beanFactory) { Map<String, PersistenceExceptionTranslator> pets = BeanFactoryUtils.beansOfTypeIncludingAncestors( beanFactory, PersistenceExceptionTranslator.class, false, false); List<PersistenceExceptionTranslator> translators = new ArrayList<>(pets.values()); if (translators.size() > 1) { Comparator<Object> comparatorToUse = null; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } if (comparatorToUse == null) { comparatorToUse = OrderComparator.INSTANCE; } translators.sort(comparatorToUse); } ChainedPersistenceExceptionTranslator cpet = new ChainedPersistenceExceptionTranslator(); for (PersistenceExceptionTranslator pet : translators) { cpet.addDelegate(pet); } return cpet; }
Source:
<code>private static boolean hasConcreteSubclass(CompositeIndex index, ClassInfo classInfo) { final Set<ClassInfo> subclasses; if (Modifier.isInterface(classInfo.flags())) { subclasses = index.getAllKnownImplementors(classInfo.name()); } else { subclasses = index.getAllKnownSubclasses(classInfo.name()); } <START> return subclasses.stream().anyMatch(ModuleJndiBindingProcessor::isConcreteClass); <END> }</code><technical_language>Please a for loop. class metadata memory cost of a method reference a for loop is high for this code pattern in server code</technical_language>

Target:
private static boolean hasConcreteSubclass(CompositeIndex index, ClassInfo classInfo) { final Set<ClassInfo> subclasses; if (Modifier.isInterface(classInfo.flags())) { subclasses = index.getAllKnownImplementors(classInfo.name()); } else { subclasses = index.getAllKnownSubclasses(classInfo.name()); } for (ClassInfo subclass: subclasses) { if (isConcreteClass(subclass)) { return true; } } return false; }
Source:
<code>private List<Map<String, Object>> unfoldFacets(Map<String, List<String>> model) { <START> List<SimpleEntry<String, String>> unlfoldModel = unfoldListMultimap(model); <END> List<Map<String, Object>> results = new ArrayList<>(); for (Map.Entry entry: unlfoldModel) { ImmutableMap.Builder<String, Object> map = ImmutableMap.<String, Object>builder(); map.put("group", entry.getKey()); map.put("value", entry.getKey()); map.put("label", StringUtils.capitalize(entry.getValue().toString())); if(!isNullOrEmpty(getTooltipText(entry.getKey().toString()))){ map.put("description", getTooltipText(entry.getKey().toString())); } results.add(map.build()); } return results; }</code><technical_language>a typo in unlfoldModel. Also, if name. unfoldedModel flattenedModel, I guess</technical_language>

Target:
private List<Map<String, String>> unfoldFacets(Map<String, List<String>> model) { List<SimpleEntry<String, String>> unfoldedModel = unfoldListMultimap(model); List<Map<String, String>> results = new ArrayList<>(); for (Map.Entry<String, String> entry : unfoldedModel) { ImmutableMap.Builder<String, String> mapBuilder = ImmutableMap.<String, String>builder() .put("group", entry.getKey()) .put("value", entry.getKey()) .put("label", StringUtils.capitalize(entry.getValue())); if(!isNullOrEmpty(getTooltipText(entry.getKey()))) { mapBuilder.put("description", getTooltipText(entry.getKey())); } results.add(mapBuilder.build()); } return results; }
Source:
<code>private FedoraResource getBaseVersion(final FedoraResource resource) { final Session internalSession = sessionFactory.getInternalSession(); try { final VersionHistory base = ((Version) resource.getNode()).getContainingHistory(); <START> if (base.hasProperty("jcr:versionableUuid")) { <END> LOGGER.debug("versionableUuid : {}", base.getProperty("jcr:versionableUuid").getValue().getString()); final Node baseNode = internalSession .getNodeByIdentifier(base.getProperty("jcr:versionableUuid").getValue().getString()); return nodeService.cast(baseNode); } } catch (final ItemNotFoundException e) { LOGGER.error("Node with jcr:versionableUuid not found : {}", e.getMessage()); } catch (final RepositoryException e) { throw new RepositoryRuntimeException(e); } return resource; }</code><technical_language>Please pull "jcr:versionableUuid" string a private static final data member</technical_language>

Target:
private FedoraResource getBaseVersion(final FedoraResource resource) { final Session internalSession = sessionFactory.getInternalSession(); try { final VersionHistory base = ((Version) resource.getNode()).getContainingHistory(); if (base.hasProperty(JCR_VERSIONABLE_UUID_PROPERTY)) { final String versionUuid = base.getProperty(JCR_VERSIONABLE_UUID_PROPERTY).getValue().getString(); LOGGER.debug("versionableUuid : {}", versionUuid); final Node baseNode = internalSession.getNodeByIdentifier(versionUuid); return nodeService.cast(baseNode); } } catch (final ItemNotFoundException e) { LOGGER.error("Node with jcr:versionableUuid not found : {}", e.getMessage()); } catch (final RepositoryException e) { throw new RepositoryRuntimeException(e); } return resource; }
Source:
<code>public void reverse() { assertThat( value.apply( "Foo" ).reverse(), equalTo( value.apply( "ooF" ) ) ); assertThat( value.apply( "" ).reverse(), equalTo( StringValue.EMTPY ) ); assertThat( value.apply( " L" ).reverse(), equalTo( value.apply( "L " ) ) ); assertThat( value.apply( "\r\n" ).reverse(), equalTo( value.apply( "\n\r" ) ) ); <START> assertThat( value.apply( "\uD801\uDC37" ).reverse(), equalTo( value.apply( "\uD801\uDC37" ) ) ); <END> }</code><technical_language>reversing for UTF here. is valuable test single char, try a real word</technical_language>

Target:
public void reverse() { assertThat( value.apply( "Foo" ).reverse(), equalTo( value.apply( "ooF" ) ) ); assertThat( value.apply( "" ).reverse(), equalTo( StringValue.EMTPY ) ); assertThat( value.apply( " L" ).reverse(), equalTo( value.apply( "L " ) ) ); assertThat( value.apply( "\r\n" ).reverse(), equalTo( value.apply( "\n\r" ) ) ); assertThat( value.apply( "\uD801\uDC37" ).reverse(), equalTo( value.apply( "\uD801\uDC37" ) ) ); assertThat( value.apply( "This is literally a pile of crap \uD83D\uDCA9, it is fantastic" ).reverse(), equalTo( value.apply( "citsatnaf si ti ,\uD83D\uDCA9 parc fo elip a yllaretil si sihT" ) ) ); assertThat( value.apply( "\uD83D\uDE21\uD83D\uDCA9\uD83D\uDC7B" ).reverse(), equalTo( value.apply( "\uD83D\uDC7B\uD83D\uDCA9\uD83D\uDE21" ) ) ); }
Source:
<code>public void run(ExtendedHiveMetastore metastore) { boolean done = false; try { metastore.createTable(newTable, privileges); done = true; } catch (RuntimeException e) { try { Optional<Table> existingTable = metastore.getTable(newTable.getDatabaseName(), newTable.getTableName()); <START> if (existingTable.isPresent()) { <END> Table table = existingTable.get(); if (getPrestoQueryId(table).equals(getPrestoQueryId(newTable))) { done = true; } else { if (!hasTheSameSchema(newTable, table)) { e = new TableAlreadyExistsException( new SchemaTableName(newTable.getDatabaseName(), newTable.getTableName()), format("Table already exists with a different schema: '%s'", newTable.getTableName()), e); } else { done = ignoreExisting; } } } } catch (RuntimeException ignored) { } if (!done) { throw e; } } tableCreated = true; }</code><technical_language>if write this java metastore.getTable(...).ifPresent(table -> { ... }</technical_language>

Target:
public void run(ExtendedHiveMetastore metastore) { boolean done = false; try { metastore.createTable(newTable, privileges); done = true; } catch (RuntimeException e) { try { Optional<Table> existingTable = metastore.getTable(newTable.getDatabaseName(), newTable.getTableName()); if (existingTable.isPresent()) { Table table = existingTable.get(); if (getPrestoQueryId(table).equals(queryId)) { done = true; } else { if (!hasTheSameSchema(newTable, table)) { e = new PrestoException(TRANSACTION_CONFLICT, format("Table already exists with a different schema: '%s'", newTable.getTableName())); } else { done = ignoreExisting; } } } } catch (RuntimeException ignored) { } if (!done) { throw e; } } tableCreated = true; }
Source:
<code>public void beforeMarshal(final Object o, final QNameMap qmap) { qmap.registerMapping(new QName(KIE.getUri(), COMPONENTS_WIDTHS_EXTENSION_ALIAS, <START> KIE.getPrefix()), <END> COMPONENTS_WIDTHS_EXTENSION_ALIAS); qmap.registerMapping(new QName(KIE.getUri(), COMPONENT_WIDTHS_ALIAS, KIE.getPrefix()), COMPONENT_WIDTHS_ALIAS); qmap.registerMapping(new QName(KIE.getUri(), COMPONENT_WIDTH_ALIAS, KIE.getPrefix()), COMPONENT_WIDTH_ALIAS); }</code><technical_language>I hard-coding prefix result in problems I describe here: <LINK_0></technical_language>

Target:
public void beforeMarshal(final Object o, final QNameMap qmap) { if (o instanceof TDefinitions) { final TDefinitions tDefinitions = (TDefinitions) o; final String prefix = tDefinitions.getPrefixForNamespaceURI(KieDMNModelInstrumentedBase.URI_KIE).orElse(KIE.getPrefix()); qmap.registerMapping(new QName(KIE.getUri(), COMPONENTS_WIDTHS_EXTENSION_ALIAS, prefix), COMPONENTS_WIDTHS_EXTENSION_ALIAS); qmap.registerMapping(new QName(KIE.getUri(), COMPONENT_WIDTHS_ALIAS, prefix), COMPONENT_WIDTHS_ALIAS); qmap.registerMapping(new QName(KIE.getUri(), COMPONENT_WIDTH_ALIAS, prefix), COMPONENT_WIDTH_ALIAS); } }
Source:
<code>public void invert(Matrix matrix) throws SingularMatrixException { if (matrix.getNumRow()!=SIZE || matrix.getNumCol()!=SIZE) { throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_MATRIX_SIZE)); } <START> m00 = 1.0/matrix.getElement(0, 0); <END> }</code><technical_language>check for singularity</technical_language>

Target:
public void invert(Matrix matrix) throws SingularMatrixException { if (matrix.getNumRow()!=SIZE || matrix.getNumCol()!=SIZE) { throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_MATRIX_SIZE)); } if (matrix.getElement(0, 0) == 0) { throw new SingularMatrixException("1 dimensional matrix is singular"); } m00 = 1.0/matrix.getElement(0, 0); }
Source:
<code>private synchronized void handleStreamsAddressRequest(CorfuPayloadMsg<StreamsAddressRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { List<StreamAddressRange> streamsRangesRequested = msg.getPayload().getStreamsRanges(); Map<UUID, StreamAddressSpace> streamsAddressSpaceMapToReturn = new HashMap<>(); Roaring64NavigableMap addressMap; for (StreamAddressRange streamAddressRange : streamsRangesRequested) { UUID streamId = streamAddressRange.getStreamID(); try { addressMap = streamsAddressSpaceMap.get(streamId).getAddressesInRange(streamAddressRange.start, streamAddressRange.end); Long trimMark = streamsAddressSpaceMap.get(streamId).getTrimMark(); streamsAddressSpaceMapToReturn.put(streamId, new StreamAddressSpace(trimMark, addressMap)); <START> } catch (NullPointerException ne) { <END> log.warn("handleStreamsAddressRequest: address space map is not present for stream {}. " + "Verify this is a valid stream.", streamId); } } log.trace("handleStreamsAddressRequest: return address space maps for streams [{}]", streamsAddressSpaceMapToReturn.keySet()); r.sendResponse(ctx, msg, CorfuMsgType.STREAMS_ADDRESS_RESPONSE.payloadMsg( new StreamsAddressResponse(streamsAddressSpaceMapToReturn))); }</code><technical_language>Please if...else check if stream map is present, catching NullPointerException a good practice</technical_language>

Target:
private void handleStreamsAddressRequest(CorfuPayloadMsg<StreamsAddressRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { StreamsAddressRequest req = msg.getPayload(); Map<UUID, StreamAddressSpace> streamsAddressMap; switch (req.getReqType()) { case StreamsAddressRequest.STREAMS: streamsAddressMap = getStreamsAddresses(req.getStreamsRanges()); break; default: streamsAddressMap = new HashMap<>(this.streamsAddressMap); break; } log.trace("handleStreamsAddressRequest: return address space for streams [{}]", streamsAddressMap.keySet()); r.sendResponse(ctx, msg, CorfuMsgType.STREAMS_ADDRESS_RESPONSE.payloadMsg( new StreamsAddressResponse(getGlobalLogTail(), streamsAddressMap))); }
Source:
<code>public void compareLargeSimpleMapTypeReferenceSets() { long startTime = StopWatch.time(); final String baseSimpleMapReferenceSet = "900000000000497000"; final String compareSimpleMapReferenceSet = "447562003"; ComponentURI baseURI = ComponentURI.of(SnomedTerminologyComponentConstants.SNOMED_SHORT_NAME, SnomedTerminologyComponentConstants.REFSET_NUMBER, baseSimpleMapReferenceSet); ComponentURI compareURI = ComponentURI.of(SnomedTerminologyComponentConstants.SNOMED_SHORT_NAME, SnomedTerminologyComponentConstants.REFSET_NUMBER, compareSimpleMapReferenceSet); CodeSystemRequests.prepareConceptMapCompare(baseURI, compareURI) .build(codeSystemURI) .execute(getBus()) <START> .getSync(); <END> long endTime = StopWatch.time(); assertThat(endTime-startTime).isLessThan(1000); }</code><technical_language>Java API, supports timeouts, for test case, desired 1 execution time getSync(1, TimeUnit.SECONDS)</technical_language>

Target:
public void compareLargeSimpleMapTypeReferenceSets() { final String baseSimpleMapReferenceSet = "900000000000497000"; final String compareSimpleMapReferenceSet = "447562003"; ComponentURI baseURI = ComponentURI.of(SnomedTerminologyComponentConstants.SNOMED_SHORT_NAME, SnomedTerminologyComponentConstants.REFSET_NUMBER, baseSimpleMapReferenceSet); ComponentURI compareURI = ComponentURI.of(SnomedTerminologyComponentConstants.SNOMED_SHORT_NAME, SnomedTerminologyComponentConstants.REFSET_NUMBER, compareSimpleMapReferenceSet); CodeSystemRequests.prepareConceptMapCompare(baseURI, compareURI) .build(codeSystemURI) .execute(getBus()) .getSync(1, TimeUnit.SECONDS); }
Source:
<code><START> public XmlPatternSegmentStoreModule() { <END> registerListener(); }</code><technical_language>call super()</technical_language>

Target:
public XmlPatternSegmentStoreModule() { super(); registerListener(); }
Source:
<code>public void saveRuns(final Collection<Run> runs) throws IOException { log.info("Migrating runs..."); for (Run newRun : runs) { Run run = serviceManager.getRunDao().getByAlias(newRun.getAlias()); if (run == null) { run = newRun; <START> run.getStatus().setLastUpdated(new Date()); <END> } else { updateRun(newRun, run); } for (SequencerPartitionContainer<SequencerPoolPartition> container : run.getSequencerPartitionContainers()) { container.setLastModifier(migrationUser); container.setId(serviceManager.getSequencerPartitionContainerDao().save(container)); } run.setLastModifier(migrationUser); run.setId(serviceManager.getRequestManager().saveRun(run)); log.debug("Saved run " + run.getAlias()); } log.info(runs.size() + " runs migrated."); }</code><technical_language>Status is disappear, matter, timeStamp member var of DefaultMigrationTarget instead of new Dates migration's date exact</technical_language>

Target:
public void saveRuns(final Collection<Run> runs) throws IOException { log.info("Migrating runs..."); for (Run newRun : runs) { Run run = serviceManager.getRunDao().getByAlias(newRun.getAlias()); if (run == null) { run = newRun; run.getStatus().setLastUpdated(timeStamp); } else { updateRun(newRun, run); } for (SequencerPartitionContainer<SequencerPoolPartition> container : run.getSequencerPartitionContainers()) { container.setLastModifier(migrationUser); container.setId(serviceManager.getSequencerPartitionContainerDao().save(container)); } run.setLastModifier(migrationUser); run.setId(serviceManager.getRequestManager().saveRun(run)); log.debug("Saved run " + run.getAlias()); } log.info(runs.size() + " runs migrated."); }
Source:
<code>public void testCarsDepth() throws IOException, AggregationException { LatLonRect bbox = new LatLonRect(new LatLonPointImmutable(-44.5, 114), new LatLonPointImmutable(-44.5, 114)); CalendarDateRange timeRange = CalendarDateRange.of(CalendarDate.parseISOformat("gregorian", "2009-01-01T00:00:00"), <START> CalendarDate.parseISOformat("gregorian", "2009-12-26T00:00:00")); <END> NumberRange verticalSubset = new NumberRange(50,100); AggregationOverrides overrides = AggregationOverridesReader.load( resourcePath("au/org/emii/aggregator/CARStemplate.xml")); try (NetcdfAggregator netcdfAggregator = new NetcdfAggregator( outputFile, overrides, null, bbox, verticalSubset, timeRange )) { netcdfAggregator.add(resourcePath("au/org/emii/aggregator/CARSWeeklySubset.nc")); } assertNetcdfFileEqualsCdl(resourcePath("au/org/emii/aggregator/cars_weekly_expected.cdl"), outputFile); }</code><technical_language>worth subset time testing is depth subset feature</technical_language>

Target:
public void testCarsDepth() throws IOException, AggregationException { LatLonRect bbox = new LatLonRect(new LatLonPointImmutable(-44.5, 114), new LatLonPointImmutable(-44.5, 114)); NumberRange verticalSubset = new NumberRange(50,100); AggregationOverrides overrides = AggregationOverridesReader.load( resourcePath("au/org/emii/aggregator/CARStemplate.xml")); try (NetcdfAggregator netcdfAggregator = new NetcdfAggregator( outputFile, overrides, null, bbox, verticalSubset, null )) { netcdfAggregator.add(resourcePath("au/org/emii/aggregator/CARSWeeklySubset.nc")); } assertNetcdfFileEqualsCdl(resourcePath("au/org/emii/aggregator/cars_weekly_expected.cdl"), outputFile); }
Source:
<code>protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RasNode node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { <START> Collection<WorkerSlot> topologyUsedSlots = oneExecutorPerWorker ? node.getUsedSlots(td.getId()) : Collections.emptySet(); <END> for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (node.wouldFit(ws, exec, td, getOneExecutorPerWorker(), getOneComponentPerWorker())) { return ws; } } } } return null; }</code><technical_language>topologyUsedSlots is longer used. removed, unclear check removed</technical_language>

Target:
protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RasNode node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } return null; }
Source:
<code>public ConfigurationNode getNode(Locale locale) { if (this.root == null) { <START> throw new IllegalStateException("Tried to read SimpleConfigTranslationDictionary before it was loaded."); <END> } return this.root.getNode(locale.toString()); }</code><technical_language>checkState :P</technical_language>

Target:
public ConfigurationNode getNode(Locale locale) { checkState(this.root != null, "Tried to read SimpleConfigTranslationDictionary before it was loaded."); return this.root.getNode(locale.toString()); }
Source:
<code>private Type transformState(Type state) { String result = state.toFullString(); try { result = TransformationHelper.transform(service, function, sourceFormat, state.toFullString()); } catch (TransformationException e) { <START> logger.debug("Could not transform state '{}' with function '{}' and format '{}'", state, function, <END> sourceFormat); } StringType resultType = new StringType(result); logger.debug("Transformed '{}' into '{}'", state, resultType); return resultType; }</code><technical_language>log this a warning? is a transformation supposed work time? is default behaviour work for incoming command/state</technical_language>

Target:
private Type transformState(Type state) { String result = state.toFullString(); try { result = TransformationHelper.transform(service, function, sourceFormat, state.toFullString()); } catch (TransformationException e) { logger.warn("Could not transform state '{}' with function '{}' and format '{}'", state, function, sourceFormat); } StringType resultType = new StringType(result); logger.debug("Transformed '{}' into '{}'", state, resultType); return resultType; }
Source:
<code>public List<Document> getClientDocuments(String clientId) throws MambuApiException { <START> if (clientId == null || clientId.trim().isEmpty()) { <END> throw new IllegalArgumentException("ClientId ID must not be null or empty"); } return DocumentsService.getDocuments(mambuAPIService, CLIENTS, clientId); }</code><technical_language>Edge case of duplicate code ;) extracted a common private method params for id type. if want change ;)</technical_language>

Target:
public List<Document> getClientDocuments(String clientId) throws MambuApiException { if (clientId == null || clientId.trim().isEmpty()) { throw new IllegalArgumentException("ClientId ID must not be null or empty"); } return new DocumentsService(mambuAPIService).getDocuments(CLIENTS, clientId); }
Source:
<code>private void updateDurationHistogram(long duration) { if (isClientEventExchangeWithoutAffinityChange()) return; <START> MetricRegistry mreg = cctx.kernalContext().metric().registry(GridMetricManager.SYS_METRICS); <END> HistogramMetric durationHistogram = (HistogramMetric)mreg.findMetric(CACHE_OPERATIONS_BLOCKED_DURATION_HISTOGRAM); durationHistogram.value(duration); }</code><technical_language>store this metric in class field instead of searching PME</technical_language>

Target:
private void updateDurationHistogram(long duration) { cctx.exchange().durationHistogram().value(duration); if (changedAffinity()) cctx.exchange().blockingDurationHistogram().value(duration); }
Source:
<code>@Override public int hashCode() { <START> return Objects.hash(schemaName, tblName); <END> }</code><technical_language>consider Objects.hash a bad practice</technical_language>

Target:
@Override public int hashCode() { int res = schemaName.hashCode(); res = 31 * res + tblName.hashCode(); return res; }
Source:
<code>public void processMutablePointerEvent(PublicKeyHash writer, MaybeMultihash existingRoot, MaybeMultihash newRoot) { if (existingRoot.equals(newRoot)) return; Stat current = currentView.get(writer); if (current == null) throw new IllegalStateException("Unknown writer key hash: " + writer); if (! newRoot.isPresent()) { current.update(MaybeMultihash.empty(), Collections.emptySet(), 0); return; } <START> try { <END> synchronized (current) { long changeInStorage = dht.getChangeInContainedSize(current.target, newRoot.get(), current.directRetainedStorage).get(); Set<PublicKeyHash> updatedOwned = WriterData.getWriterData(writer, newRoot, dht).get().props.ownedKeys; for (PublicKeyHash owned : updatedOwned) { currentView.computeIfAbsent(owned, k -> new Stat(current.owner, MaybeMultihash.empty(), 0, Collections.emptySet())); } while (true) { Long currentUsage = usage.get(current.owner); boolean casSucceeded = usage.replace(current.owner, currentUsage, currentUsage + changeInStorage); if (casSucceeded) break; } current.update(newRoot, updatedOwned, current.directRetainedStorage + changeInStorage); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>implementing a CAS hold lock for time (and async operations)</technical_language>

Target:
public void processMutablePointerEvent(PublicKeyHash writer, MaybeMultihash existingRoot, MaybeMultihash newRoot) { if (existingRoot.equals(newRoot)) return; Stat current = currentView.get(writer); if (current == null) throw new IllegalStateException("Unknown writer key hash: " + writer); if (! newRoot.isPresent()) { current.update(MaybeMultihash.empty(), Collections.emptySet(), 0); if (existingRoot.isPresent()) { try { Set<PublicKeyHash> updatedOwned = WriterData.getWriterData(writer, newRoot, dht).get().props.ownedKeys; processRemovedOwnedKeys(updatedOwned); } catch (Exception e) { e.printStackTrace(); } } return; } try { synchronized (current) { long changeInStorage = dht.getChangeInContainedSize(current.target, newRoot.get()).get(); Set<PublicKeyHash> updatedOwned = WriterData.getWriterData(writer, newRoot, dht).get().props.ownedKeys; for (PublicKeyHash owned : updatedOwned) { currentView.computeIfAbsent(owned, k -> new Stat(current.owner, MaybeMultihash.empty(), 0, Collections.emptySet())); } Usage currentUsage = usage.get(current.owner); currentUsage.addUsage(changeInStorage); HashSet<PublicKeyHash> removedChildren = new HashSet<>(current.getOwnedKeys()); removedChildren.removeAll(updatedOwned); processRemovedOwnedKeys(removedChildren); current.update(newRoot, updatedOwned, current.directRetainedStorage + changeInStorage); } } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>public void testCreateFileOnInternalMountDirWithSameDirTreeExistInFallback() throws Exception { Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/user1/hive/warehouse/partition-0", new Path(targetTestRoot.toString()).toUri()); <START> Path dir1 = new Path(targetTestRoot, <END> "fallbackDir/user1/hive/warehouse/partition-0"); fsTarget.mkdirs(dir1); Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); ConfigUtil.addLinkFallback(conf, fallbackTarget.toUri()); try (FileSystem vfs = FileSystem.get(viewFsDefaultClusterUri, conf)) { Path p = new Path("/user1/hive/warehouse/test.file"); Path test = Path.mergePaths(fallbackTarget, p); assertFalse(fsTarget.exists(test)); assertTrue(fsTarget.exists(test.getParent())); vfs.createNewFile(p); assertTrue(fsTarget.exists(test)); } }</code><technical_language>easier read if written Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); Path dir1 = new Path(fallbackTarget, "user1/hive/warehouse/partition-0"); fsTarget.mkdirs(dir1);</technical_language>

Target:
public void testCreateFileOnInternalMountDirWithSameDirTreeExistInFallback() throws Exception { Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/user1/hive/warehouse/partition-0", new Path(targetTestRoot.toString()).toUri()); Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); Path dir1 = new Path(fallbackTarget, "user1/hive/warehouse/partition-0"); fsTarget.mkdirs(dir1); ConfigUtil.addLinkFallback(conf, fallbackTarget.toUri()); try (FileSystem vfs = FileSystem.get(viewFsDefaultClusterUri, conf)) { Path vfsTestFile = new Path("/user1/hive/warehouse/test.file"); Path testFileInFallback = Path.mergePaths(fallbackTarget, vfsTestFile); assertFalse(fsTarget.exists(testFileInFallback)); assertTrue(fsTarget.exists(testFileInFallback.getParent())); vfs.create(vfsTestFile).close(); assertTrue(fsTarget.exists(testFileInFallback)); } }
Source:
<code>public Collection<Property<?, ?>> getPropertiesFor(final PropertyHolder holder) { final ImmutableList.Builder<Property<?, ?>> builder = ImmutableList.builder(); if (this.tempRegistry != null) { <START> final Set<Class<? extends Property<?, ?>>> used = new ReferenceOpenHashSet<>(); <END> for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.tempRegistry.delegateMap.entrySet()) { used.add(entry.getKey()); entry.getValue().getFor(holder).ifPresent(builder::add); } for (final Map.Entry<Class<? extends Property<?, ?>>, List<PropertyStore<?>>> entry : this.tempRegistry.propertyStoreMap.entrySet()) { if (!used.contains(entry.getKey())) { used.add(entry.getKey()); final ImmutableList.Builder<PropertyStore<?>> propertyStoreBuilder = ImmutableList.builder(); entry.getValue().sort(Constants.Functional.PROPERTY_STORE_COMPARATOR); propertyStoreBuilder.addAll(entry.getValue()); final PropertyStoreDelegate<?> delegate = new PropertyStoreDelegate(propertyStoreBuilder.build()); this.tempRegistry.delegateMap.put(entry.getKey(), delegate); delegate.getFor(holder).ifPresent(builder::add); } } return builder.build(); } for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.delegateMap.entrySet()) { entry.getValue().getFor(holder).ifPresent(builder::add); } return builder.build(); }</code><technical_language>this is a moot set bother using. a temp registry dropped soon game finished loading</technical_language>

Target:
public Collection<Property<?, ?>> getPropertiesFor(final PropertyHolder holder) { final ImmutableList.Builder<Property<?, ?>> builder = ImmutableList.builder(); if (this.tempRegistry != null) { final Set<Class<? extends Property<?, ?>>> used = new HashSet<>(); for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.tempRegistry.delegateMap.entrySet()) { used.add(entry.getKey()); entry.getValue().getFor(holder).ifPresent(builder::add); } for (final Map.Entry<Class<? extends Property<?, ?>>, List<PropertyStore<?>>> entry : this.tempRegistry.propertyStoreMap.entrySet()) { if (!used.contains(entry.getKey())) { used.add(entry.getKey()); final ImmutableList.Builder<PropertyStore<?>> propertyStoreBuilder = ImmutableList.builder(); entry.getValue().sort(Constants.Functional.PROPERTY_STORE_COMPARATOR); propertyStoreBuilder.addAll(entry.getValue()); final PropertyStoreDelegate<?> delegate = new PropertyStoreDelegate(propertyStoreBuilder.build()); this.tempRegistry.delegateMap.put(entry.getKey(), delegate); delegate.getFor(holder).ifPresent(builder::add); } } return builder.build(); } for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.delegateMap.entrySet()) { entry.getValue().getFor(holder).ifPresent(builder::add); } return builder.build(); }
Source:
<code>public void onNext(final CompletedTask task) { final byte[] retBytes = task.get(); if (retBytes == null) { return; } <START> final String filePath = filePathList.get(fileCounter.get()); <END> final int retCnt = Integer.parseInt(new String(retBytes, StandardCharsets.UTF_8)); lineCounter.addAndGet(retCnt); LOG.log(Level.FINE, "Number of lines counted by {0} for a file {1} is {2}", new Object[]{task.getId(), filePath, retCnt}); final int completedTaskCnt = completedTaskCounter.incrementAndGet(); LOG.log(Level.FINER, "Completed tasks: ({0} / {1})", new Object[]{completedTaskCnt, contextList.size()}); if (completedTaskCnt == contextList.size()) { System.out.println(String.format("Total Line Count in %s : %d", filePath, lineCounter.get())); if (tryToLoadNextFile()) { contextList.forEach(ActiveContext::close); } } }</code><technical_language>final int curFileIdx = fileCounter.get();</technical_language>

Target:
public void onNext(final CompletedTask task) { final byte[] retBytes = task.get(); if (retBytes == null) { return; } final int currFileIdx = fileCounter.get() - 1; final String filePath = filePathList.get(currFileIdx); final int retCnt = Integer.parseInt(new String(retBytes, StandardCharsets.UTF_8)); lineCounter.addAndGet(retCnt); LOG.log(Level.FINE, "Number of lines counted by {0} for a file {1} is {2}", new Object[]{task.getId(), filePath, retCnt}); final int completedTaskCnt = completedTaskCounter.incrementAndGet(); LOG.log(Level.FINER, "Completed tasks: ({0} / {1})", new Object[]{completedTaskCnt, contextList.size()}); if (completedTaskCnt == contextList.size()) { System.out.println(String.format("Total Line Count in %s : %d", filePath, lineCounter.get())); if (loadNextFile()) { reset(); } else { contextList.forEach(ActiveContext::close); } } }
Source:
<code>protected List<String> getTokens() { List<String> tokenIds = null; try { List<String> allAliases = aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME); tokenIds = allAliases.stream() .filter(a -> a.contains(TOKEN_MAX_LIFETIME_POSTFIX)) .map(a -> a.substring(0, a.indexOf(TOKEN_MAX_LIFETIME_POSTFIX))) .collect(Collectors.toList()); } catch (AliasServiceException e) { <START> e.printStackTrace(); END> } return (tokenIds != null ? tokenIds : Collections.emptyList()); }</code><technical_language>throwing a stack trace? if this is for debugging wrap in logger throw instead of e.printStackTrace()</technical_language>

Target:
protected List<String> getTokens() { List<String> tokenIds = null; try { List<String> allAliases = aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME); tokenIds = allAliases.stream() .filter(a -> a.contains(TOKEN_MAX_LIFETIME_POSTFIX)) .map(a -> a.substring(0, a.indexOf(TOKEN_MAX_LIFETIME_POSTFIX))) .collect(Collectors.toList()); } catch (AliasServiceException e) { log.errorAccessingTokenState(e); } return (tokenIds != null ? tokenIds : Collections.emptyList()); }
Source:
<code>private String getBearerToken(AnypointCredential credentials) { if (isBlank(bearerToken)) { switch (credentials.credentialType()) { case user: Credentials creds = (Credentials) credentials; <START> bearerToken = authenticationServiceClient.getBearerToken(creds); <END> case token: bearerToken = ((AnypointToken) credentials).getToken(); } } return bearerToken; }</code><technical_language>suggestion bearerToken = authenticationServiceClient.getBearerToken(creds); break;</technical_language>

Target:
private String getBearerToken(AnypointCredential credentials) { if (isBlank(bearerToken)) { switch (credentials.credentialType()) { case user: Credentials creds = (Credentials) credentials; bearerToken = authenticationServiceClient.getBearerToken(creds); break; case token: bearerToken = ((AnypointToken) credentials).getToken(); break; } } return bearerToken; }
Source:
<code><START> public void setLevel(Level level) { <END> }</code><technical_language>SetLevel method implemented,</technical_language>

Target:
public void setLevel(Level level) { this.level = level; }
Source:
<code>public void testIterationStartedWithResize1() { int resizeLimitation = OffHeapConcurrentMap.INITIAL_SIZE - (OffHeapConcurrentMap.INITIAL_SIZE >> 2); WrappedByteArray valueByteArray = new WrappedByteArray(new byte[] { 0, 1, 2, 3, 4, 5 }); for (int i = 0; i < resizeLimitation - 1; ++i) { putInMap(map, valueByteArray); } Iterator<InternalCacheEntry<WrappedBytes, WrappedBytes>> iterator = map.values().iterator(); AssertJUnit.assertTrue(iterator.hasNext()); Assert.assertNotNull(iterator.next()); <START> int entriesFound = 1; <END> putInMap(map, valueByteArray); while (iterator.hasNext()) { Assert.assertNotNull(iterator.next()); entriesFound++; } if (entriesFound != resizeLimitation && entriesFound != resizeLimitation - 1) { AssertJUnit.fail("Iterator returned incorrect number expect " + resizeLimitation + " or " + (resizeLimitation - 1) + ", but got " + entriesFound); } }</code><technical_language>This setup extracted a common method</technical_language>

Target:
public void testIterationStartedWithResize1() { Set<WrappedBytes> expectedKeys = insertUpToResizeLimitation(); Set<WrappedBytes> results = new HashSet<>(); Iterator<InternalCacheEntry<WrappedBytes, WrappedBytes>> iterator = map.values().iterator(); assertTrue(iterator.hasNext()); assertTrue(results.add(iterator.next().getKey())); putInMap(map, valueByteArray); while (iterator.hasNext()) { assertTrue(results.add(iterator.next().getKey())); } for (WrappedBytes expected : expectedKeys) { assertTrue("Results didn't contain: " + expected, results.contains(expected)); } }
Source:
<code><START> private void handleBadgeResetPN(Bundle data) { <END> if (data != null && data.containsKey(PUSH_ARG_NOTE_ID)) { removeNotificationWithNoteIdFromSystemBar(this, data); if (sActiveNotificationsMap.size() > 0) { rebuildAndUpdateNotificationsOnSystemBar(data); } } if (data == null || !data.containsKey(PUSH_ARG_NOTE_ID)) { return; } EventBus.getDefault().post(new NotificationEvents.NotificationsChanged()); }</code><technical_language>Sorry, I thinking of this: java private void handleBadgeResetPN(Bundle data) { if (data == null || !data.containsKey(PUSH_ARG_NOTE_ID)) { // ignore reset-badge PN if a global return; } removeNotificationWithNoteIdFromSystemBar(this, data); //now cleared specific notif, check visual updates if (sActiveNotificationsMap.size() > 0) { rebuildAndUpdateNotificationsOnSystemBar(data); } EventBus.getDefault().post(new NotificationEvents.NotificationsChanged()); }</technical_language>

Target:
private void handleBadgeResetPN(Bundle data) { if (data == null || !data.containsKey(PUSH_ARG_NOTE_ID)) { return; } removeNotificationWithNoteIdFromSystemBar(this, data); if (sActiveNotificationsMap.size() > 0) { rebuildAndUpdateNotificationsOnSystemBar(data); } EventBus.getDefault().post(new NotificationEvents.NotificationsChanged()); }