auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String processDatastreamPositionRequest(URI request) { _logger.debug("Processing datastream position request: {}", request); boolean hasParams = request.getQuery() != null; DatastreamPositionResponse response = _runningTasks.values() .stream() .map(AbstractKafkaBasedConnectorTask::getPositionResponse) .reduce(DatastreamPositionResponse::merge) .orElse(new DatastreamPositionResponse()); _logger.debug("Unfiltered datastream position response: {}", response); if (hasParams) { <START> Optional<String> datastreamName = URLEncodedUtils.parse(request.getQuery(), Charset.defaultCharset()) <END> .stream() .filter(pair -> DATASTREAM_KEY.equalsIgnoreCase(pair.getName())) .map(NameValuePair::getValue) .findFirst(); datastreamName.ifPresent(name -> response.retainAll(Collections.singleton(name))); Optional<String> topicName = URLEncodedUtils.parse(request.getQuery(), Charset.defaultCharset()) .stream() .filter(pair -> TOPIC_KEY.equalsIgnoreCase(pair.getName())) .map(NameValuePair::getValue) .findFirst(); if (topicName.isPresent()) { for (PhysicalSources sources : response.getDatastreamToPhysicalSources().values()) { Map<String, PhysicalSourcePosition> positions = sources.getPhysicalSourceToPosition(); for (String position : positions.keySet()) { if (!position.matches("^" + topicName.get() + "-\\d+$")) { positions.remove(position); } } } } } _logger.debug("Filtered datastream position response: {}", response); return DatastreamPositionResponse.toJson(response); }</code><technical_language>write a helper method for extracting optional parameter values query</technical_language>

Target:
private String processDatastreamPositionRequest(URI request) { _logger.debug("Processing datastream position request: {}", request); DatastreamPositionResponse response = _runningTasks.values() .stream() .map(AbstractKafkaBasedConnectorTask::getPositionResponse) .reduce(DatastreamPositionResponse::merge) .orElse(new DatastreamPositionResponse()); _logger.debug("Unfiltered datastream position response: {}", response); extractQueryParam(request, DATASTREAM_KEY).ifPresent(name -> response.retainAll(Collections.singleton(name))); extractQueryParam(request, TOPIC_KEY).ifPresent(topic -> { for (PhysicalSources sources : response.getDatastreamToPhysicalSources().values()) { Map<String, PhysicalSourcePosition> positions = sources.getPhysicalSourceToPosition(); for (String position : positions.keySet()) { if (!position.matches("^" + topic + "-\\d+$")) { positions.remove(position); } } } }); _logger.debug("Filtered datastream position response: {}", response); return DatastreamPositionResponse.toJson(response); }
Source:
<code>private void addSortOrder(Optional<QueryOrdering> ordering, SearchRequestBuilder reqBuilder) { QueryOrdering order = ordering.get(); for (QueryOrdering.Node node : order.getSortOrder()) { if ("relevance".equalsIgnoreCase(node.getPath())) { <START> reqBuilder.addSort(SortBuilders.scoreSort().order(SortOrder.DESC)); <END> } else { reqBuilder.addSort( SortBuilders .fieldSort(translateOrderField(node.getPath())) .missing("_last") .order(node.isAscending() ? SortOrder.ASC : SortOrder.DESC) ); } } }</code><technical_language>is this special case required? Surely if user silly notified early cover-up</technical_language>

Target:
private void addSortOrder(Optional<QueryOrdering> ordering, SearchRequestBuilder reqBuilder) { QueryOrdering order = ordering.get(); for (QueryOrdering.Clause clause : order.getSortOrder()) { if ("relevance".equalsIgnoreCase(clause.getPath())) { reqBuilder.addSort(SortBuilders.scoreSort().order(SortOrder.DESC)); } else { reqBuilder.addSort( SortBuilders .fieldSort(translateOrderField(clause.getPath())) .missing("_last") .order(clause.isAscending() ? SortOrder.ASC : SortOrder.DESC) ); } } }
Source:
<code>public SRResult similarity(String phrase1, String phrase2, Language language, boolean explanations) throws DaoException { if (phrase1 == null || phrase2 == null) { throw new NullPointerException("Null phrase passed to similarity"); } try { TIntDoubleHashMap scores1 = getConceptVector(phrase1, language); TIntDoubleHashMap scores2 = getConceptVector(phrase2, language); double sim = SimUtils.cosineSimilarity(scores1, scores2); <START> return new SRResult(sim); END> } catch (WikapidiaException e) { throw new DaoException(e); } }</code><technical_language>this normalize(new SRResult(sim))</technical_language>

Target:
public SRResult similarity(String phrase1, String phrase2, Language language, boolean explanations) throws DaoException { if (phrase1 == null || phrase2 == null) { throw new NullPointerException("Null phrase passed to similarity"); } TIntDoubleHashMap scores1 = getConceptVector(phrase1, language); TIntDoubleHashMap scores2 = getConceptVector(phrase2, language); double sim = SimUtils.cosineSimilarity(scores1, scores2); return new SRResult(sim); }
Source:
<code><START> public AmqpInboundPolledChannelAdapterSpec(ConnectionFactory connectionFactory, <END> AmqpAckCallbackFactory ackCallbackFactory, String queue) { this.target = new AmqpMessageSource(connectionFactory, ackCallbackFactory, queue); }</code><technical_language>allow create Spec - factory above. I mind start ctors protected for cases missed some property expose end-user Spec extend for omitted property</technical_language>

Target:
AmqpInboundPolledChannelAdapterSpec(ConnectionFactory connectionFactory, AmqpAckCallbackFactory ackCallbackFactory, String queue) { this.target = new AmqpMessageSource(connectionFactory, ackCallbackFactory, queue); }
Source:
<code>public OutputColumns getOutputColumns() { StringBuilder builder = new StringBuilder("Hash of "); for (int i = 0; i < _columns.length; i++) { if (i != 0) { builder.append(", "); <START> } <END> builder.append(_columns[i].getName()); if (i == COLUMNS_LIMIT) { builder.append("..."); break; } } return new OutputColumns(String.class, builder.toString(), "Input length"); }</code><technical_language>StringJoiner remaking algorithm</technical_language>

Target:
public OutputColumns getOutputColumns() { final StringJoiner joiner = new StringJoiner(", "); for (InputColumn<?> column : _columns) { joiner.add(column.getName()); } return new OutputColumns(String.class, "Hash of " + joiner.toString(), "Input length"); }
Source:
<code>public void update(CommandsInterface ci, IccCardStatus ics, int phoneId) { synchronized (mLock) { CardState oldState = mCardState; mCardState = ics.mCardState; mPhoneId = phoneId; parseAtr(ics.atr); mCi = ci; RadioState radioState = mCi.getRadioState(); if (DBG) { log("update: radioState=" + radioState + " mLastRadioState=" + mLastRadioState); } if <START> ((oldState == null || oldState != CardState.CARDSTATE_ABSENT) <END> && mCardState == CardState.CARDSTATE_ABSENT) { if (radioState == RadioState.RADIO_ON && mLastRadioState == RadioState.RADIO_ON) { if (DBG) log("update: notify card removed"); sendMessage(obtainMessage(EVENT_CARD_REMOVED, null)); } UiccController.updateInternalIccState( IccCardConstants.INTENT_VALUE_ICC_ABSENT, null, mPhoneId); if (mUiccCard != null) { mUiccCard.dispose(); mUiccCard = null; } } else if ((oldState == null || oldState == CardState.CARDSTATE_ABSENT) && mCardState != CardState.CARDSTATE_ABSENT) { if (radioState == RadioState.RADIO_ON && mLastRadioState == RadioState.RADIO_ON) { if (DBG) log("update: notify card added"); sendMessage(obtainMessage(EVENT_CARD_ADDED, null)); } if (mUiccCard != null) { loge("update: mUiccCard != null when card was present; disposing it now"); mUiccCard.dispose(); } if (!mIsEuicc) { mUiccCard = new UiccCard(mContext, mCi, ics, mPhoneId); } else { mUiccCard = new EuiccCard(mContext, mCi, ics, phoneId); } } else { if (mUiccCard != null) { mUiccCard.update(mContext, mCi, ics); } } mLastRadioState = radioState; } }</code><technical_language>Agree. I need a null check here</technical_language>

Target:
public void update(CommandsInterface ci, IccCardStatus ics, int phoneId) { synchronized (mLock) { CardState oldState = mCardState; mCardState = ics.mCardState; mPhoneId = phoneId; parseAtr(ics.atr); mCi = ci; RadioState radioState = mCi.getRadioState(); if (DBG) { log("update: radioState=" + radioState + " mLastRadioState=" + mLastRadioState); } if (oldState != CardState.CARDSTATE_ABSENT && mCardState == CardState.CARDSTATE_ABSENT) { if (radioState == RadioState.RADIO_ON && mLastRadioState == RadioState.RADIO_ON) { if (DBG) log("update: notify card removed"); sendMessage(obtainMessage(EVENT_CARD_REMOVED, null)); } UiccController.updateInternalIccState( IccCardConstants.INTENT_VALUE_ICC_ABSENT, null, mPhoneId); if (mUiccCard != null) { mUiccCard.dispose(); mUiccCard = null; } } else if ((oldState == null || oldState == CardState.CARDSTATE_ABSENT) && mCardState != CardState.CARDSTATE_ABSENT) { if (radioState == RadioState.RADIO_ON && mLastRadioState == RadioState.RADIO_ON) { if (DBG) log("update: notify card added"); sendMessage(obtainMessage(EVENT_CARD_ADDED, null)); } if (mUiccCard != null) { loge("update: mUiccCard != null when card was present; disposing it now"); mUiccCard.dispose(); } if (!mIsEuicc) { mUiccCard = new UiccCard(mContext, mCi, ics, mPhoneId); } else { mUiccCard = new EuiccCard(mContext, mCi, ics, phoneId); } } else { if (mUiccCard != null) { mUiccCard.update(mContext, mCi, ics); } } mLastRadioState = radioState; } }
Source:
<code>public Collection<trainingListeners> getTrainingListeners() { <START> return trainingListeners; <END> }</code><technical_language>This right. this camel case? case classes</technical_language>

Target:
public Collection<TrainingListener> getTrainingListeners() { return trainingListeners; }
Source:
<code>public List<ICommand> getSortedCommandList() { <START> List<ICommand> list = new ArrayList<ICommand>(commandMap.size()); <END> list.addAll(commandMap.values()); Collections.sort(list); return list; }</code><technical_language>do new ArrayList<ICommand>(commandMap.values()); instead of separate addAll</technical_language>

Target:
public List<ICommand> getSortedCommandList() { List<ICommand> list = new ArrayList<ICommand>(getSubCommands()); Collections.sort(list); return list; }
Source:
<code>private boolean rewrite() { match(subject); if (success) { List<ExtendedSubstitution> normalizedExtSubsts = getCNFExtendedSubstitutions( fExtSubst, fMultiExtSubsts); Profiler.startTimer(Profiler.EVALUATE_SIDE_CONDITIONS_TIMER); ExtendedSubstitution solution = null; for (ExtendedSubstitution extSubst : normalizedExtSubsts) { Map<Variable, Term> updatedSubst = RewriteEngineUtils. evaluateConditions(rule, extSubst.substitution(), context); if (updatedSubst != null) { extSubst.setSubst(updatedSubst); solution = extSubst; break; } } Profiler.stopTimer(Profiler.EVALUATE_SIDE_CONDITIONS_TIMER); if (solution != null) { Profiler.startTimer(Profiler.LOCAL_REWRITE_BUILD_RHS_TIMER); Transformer substAndEvalTransformer = new CopyOnShareSubstAndEvalTransformer( solution.substitution(), rule.reusableVariables().elementSet(), context); for (Cell cell : solution.writeCells()) { CellLabel cellLabel = cell.getLabel(); Term rightHandSide = getWriteCellRHS(cellLabel); if (rule.cellsToCopy().contains(cellLabel)) { rightHandSide = DeepCloner.clone(rightHandSide); } cell.unsafeSetContent((Term) rightHandSide.accept(substAndEvalTransformer)); } <START> context.setTopTerm(subject); <END> Profiler.stopTimer(Profiler.LOCAL_REWRITE_BUILD_RHS_TIMER); } else { success = false; } } return success; }</code><technical_language>I comfortable idea of context mutable I set rewriting. I this is error-prone</technical_language>

Target:
private boolean rewrite() { match(subject); if (success) { List<ExtendedSubstitution> normalizedExtSubsts = getCNFExtendedSubstitutions( fExtSubst, fMultiExtSubsts); Profiler.startTimer(Profiler.EVALUATE_SIDE_CONDITIONS_TIMER); ExtendedSubstitution solution = null; for (ExtendedSubstitution extSubst : normalizedExtSubsts) { Map<Variable, Term> updatedSubst = RewriteEngineUtils. evaluateConditions(rule, extSubst.substitution(), context); if (updatedSubst != null) { extSubst.setSubst(updatedSubst); solution = extSubst; break; } } Profiler.stopTimer(Profiler.EVALUATE_SIDE_CONDITIONS_TIMER); if (solution != null) { Profiler.startTimer(Profiler.LOCAL_REWRITE_BUILD_RHS_TIMER); Transformer substAndEvalTransformer = new CopyOnShareSubstAndEvalTransformer( solution.substitution(), rule.reusableVariables().elementSet(), context); for (Cell cell : solution.writeCells()) { CellLabel cellLabel = cell.getLabel(); Term rightHandSide = getWriteCellRHS(cellLabel); if (rule.cellsToCopy().contains(cellLabel)) { rightHandSide = DeepCloner.clone(rightHandSide); } cell.unsafeSetContent((Term) rightHandSide.accept(substAndEvalTransformer)); } Profiler.stopTimer(Profiler.LOCAL_REWRITE_BUILD_RHS_TIMER); } else { success = false; } } return success; }
Source:
<code>public void benchSyncOnSubscribe(final SingleInput input) { <START> createSyncOnSubscribe(input.iterator).call(input.newSubscriber()); <END> }</code><technical_language>problem this is iterator consumed benchmark fast empty iterator completion operator</technical_language>

Target:
public void benchSyncOnSubscribe(final SingleInput input) { createSyncOnSubscribe(input.iterable.iterator()).call(input.newSubscriber()); }
Source:
<code>public void createAndClaimRadiologyReport_shouldThrowAnUnsupportedOperationExceptionIfGivenOrderHasACompletedRadiologyReport() throws Exception { RadiologyOrder existingRadiologyOrder = radiologyService <START> .getRadiologyOrderByOrderId(RADIOLOGY_ORDER_WITH_STUDY_AND_CLAIMED_RADIOLOGY_REPORT); <END> RadiologyReport existingRadiologyReport = radiologyService .getRadiologyReportByRadiologyReportId(EXISTING_RADIOLOGY_REPORT_ID); existingRadiologyReport.setRadiologyReportStatus(RadiologyReportStatus.CLAIMED); radiologyService.saveRadiologyReport(existingRadiologyReport); radiologyService.completeRadiologyReport(existingRadiologyReport, providerService.getProvider(1)); expectedException.expect(UnsupportedOperationException.class); expectedException .expectMessage("cannot create radiologyReport for this radiologyOrder because it is already completed"); radiologyService.createAndClaimRadiologyReport(existingRadiologyOrder); }</code><technical_language>RADIOLOGY_ORDER_WITH_STUDY_AND_COMPLETED_RADIOLOGY_REPORT ?</technical_language>

Target:
public void createAndClaimRadiologyReport_shouldThrowAnUnsupportedOperationExceptionIfGivenOrderHasACompletedRadiologyReport() throws Exception { RadiologyOrder existingRadiologyOrder = radiologyService .getRadiologyOrderByOrderId(RADIOLOGY_ORDER_WITH_STUDY_AND_COMPLETED_RADIOLOGY_REPORT); RadiologyReport existingRadiologyReport = radiologyService .getRadiologyReportByRadiologyReportId(EXISTING_RADIOLOGY_REPORT_ID); existingRadiologyReport.setReportStatus(RadiologyReportStatus.CLAIMED); radiologyService.saveRadiologyReport(existingRadiologyReport); radiologyService.completeRadiologyReport(existingRadiologyReport, providerService.getProvider(1)); expectedException.expect(UnsupportedOperationException.class); expectedException .expectMessage("cannot create radiologyReport for this radiologyOrder because it is already completed"); radiologyService.createAndClaimRadiologyReport(existingRadiologyOrder); }
Source:
<code>public Object isSlaFailed() { final ExecutableFlow flow; try { flow = this.executorLoader.fetchExecutableFlow(this.execId); <START> logger.info("Flow for execid " + this.execId + " is " + flow.toString()); <END> } catch (final ExecutorManagerException e) { logger.error("Can't get executable flow.", e); return true; } return isSlaMissed(flow); }</code><technical_language>need print out flow.toString()? flow.getId() better</technical_language>

Target:
public Object isSlaFailed() { final ExecutableFlow flow; try { flow = this.executorLoader.fetchExecutableFlow(this.execId); logger.info("Flow for execid " + this.execId + " is " + flow.getId()); } catch (final ExecutorManagerException e) { logger.error("Can't get executable flow.", e); return true; } return isSlaMissed(flow); }
Source:
<code>protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); <START> int indice; <END> if (!iter.hasNext()) { addToResult(); groupStates.addTuple(tb, gfields, row, true); for (int i = 0; i < internalAggs.size(); ++i) { internalAggs.get(i).initState(groupStates.getData()); } indice = groupStates.getData().numTuples() - 1; } else { indice = iter.next(); } for (int i = 0; i < internalAggs.size(); ++i) { internalAggs.get(i).addRow(tb, row, groupStates.getData(), indice); } } if (resultBuffer.hasFilledTB()) { return resultBuffer.popFilled(); } tb = child.nextReady(); } if (child.eos()) { addToResult(); return resultBuffer.popAny(); } return null; }</code><technical_language>index</technical_language>

Target:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int index; if (!iter.hasNext()) { generateResult(); groupStates.addTuple(tb, gfields, row, true); int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.initState(groupStates.getData(), offset); offset += agg.getStateSize(); } index = groupStates.getData().numTuples() - 1; } else { index = iter.next(); } int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.addRow(tb, row, groupStates.getData(), index, offset); offset += agg.getStateSize(); } } if (resultBuffer.hasFilledTB()) { return resultBuffer.popFilled(); } tb = child.nextReady(); } if (child.eos()) { generateResult(); return resultBuffer.popAny(); } return null; }
Source:
<code>public static NodeBuilder getNode(@NotNull NodeBuilder nodeBuilder, @NotNull String path) { for (String name : PathUtils.elements(checkNotNull(path))) { <START> nodeBuilder = nodeBuilder.getChildNode(checkNotNull(name)); <END> } return nodeBuilder; }</code><technical_language>I tend re-assign method's parameters. create a temp variable here. a separate note, this type of logic refers a [**fold**](<LINK_1> in functional paradigm. This helps write this logic in a more idiomatic way. In java this is requires a bit more "ceremony" compared other languages: java return StreamSupport.stream(PathUtils.elements(checkNotNull(path)).spliterator(), false) .reduce(nodeBuilder, (nb, name) -> nb.getChildNode(checkNotNull(name)), (nb, nb2) -> nb); // combinator function, needed in sequential reductions in java needs :-( find a nice explanation of <LINK_0></technical_language>

Target:
public static NodeBuilder getNode(@NotNull NodeBuilder nodeBuilder, @NotNull String path) { NodeBuilder resultNodeBuilder = nodeBuilder; for (String name : PathUtils.elements(checkNotNull(path))) { resultNodeBuilder = resultNodeBuilder.getChildNode(checkNotNull(name)); } return resultNodeBuilder; }
Source:
<code>public UserIdentity getUserIdentityByToken(String token) throws AuthException { log.debug("KeystoneService: entered getUserIdentityByToken. Token={}", token); if (StringUtils.isEmpty(token)) { throw new InvalidCredentialsException("No token was passed in."); } KeystoneAccess access; try { access = client.getToken(token); <START> } catch (Exception ex) { <END> log.debug("Authentication failed: "+ex.getMessage()); throw new InvalidCredentialsException("Invalid token"); } return (access == null) ? null : getUserIdentity(access); }</code><technical_language>please catch more specific exceptions here? KeystoneServerException KeystoneConnectionException. In if KeystoneConnectionException, correct re-throw InvalidCredentialsException</technical_language>

Target:
public UserIdentity getUserIdentityByToken(String token) throws AuthException { log.debug("KeystoneService: entered getUserIdentityByToken. Token={}", token); if (StringUtils.isEmpty(token)) { throw new InvalidCredentialsException("No token was passed in."); } KeystoneAccess access = null; try { access = client.getToken(token); } catch (KeystoneConnectionException kex) { log.debug("Authentication connection failed: "+kex.getMessage()); } catch (KeystoneServerException ex) { log.debug("Authentication failed: "+ex.getMessage()); throw new InvalidCredentialsException("Invalid token"); } return (access == null) ? null : getUserIdentity(access); }
Source:
<code>public void send(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { <START> req.setAttribute(Const.ParamsNames.ERROR, "" + isError); <END> addStatusMessagesToPageData(req); clearStatusMessageForRequest(req); resp.setContentType("application/json"); resp.setCharacterEncoding("UTF-8"); String jsonData = (new Gson()).toJson(data); resp.getWriter().write(jsonData); }</code><technical_language>Const.ParamsNames.ERROR previously colour status messages red, is used</technical_language>

Target:
public void send(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { req.setAttribute(Const.ParamsNames.ERROR, "" + isError); addStatusMessagesToPageData(req); if (isClearingStatusMessage) { clearStatusMessageForRequest(req); } resp.setContentType("application/json"); resp.setCharacterEncoding("UTF-8"); String jsonData = (new Gson()).toJson(data); resp.getWriter().write(jsonData); }
Source:
<code>private void addGeoOverlay(final RelativeLayout imageViewLayout, final Image img) { try { final File file = LocalStorage.getStorageFile(geocode, img.getUrl(), true, true); if (file == null) { return; } final Metadata metadata = ImageMetadataReader.readMetadata(file); final Collection<GpsDirectory> gpsDirectories = metadata.getDirectoriesOfType(GpsDirectory.class); if (gpsDirectories == null) { return; } <START> for (GpsDirectory gpsDirectory : gpsDirectories) { <END> final GeoLocation geoLocation = gpsDirectory.getGeoLocation(); if (geoLocation != null && !geoLocation.isZero()) { final ImageView geoOverlay = (ImageView) imageViewLayout.findViewById(R.id.geo_overlay); geoOverlay.setVisibility(View.VISIBLE); geoOverlay.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View wpNavView) { final Geopoint gpt = new Geopoint(geoLocation.getLatitude(), geoLocation.getLongitude()); wpNavView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { NavigationAppFactory.startDefaultNavigationApplication(1, activity, gpt); } }); wpNavView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(final View v) { NavigationAppFactory.startDefaultNavigationApplication(2, activity, gpt); return true; } }); } }); break; } } } catch(Exception e) { Log.e("ImagesList.addGeoOverlay", e); } }</code><technical_language>Missing final</technical_language>

Target:
private void addGeoOverlay(final RelativeLayout imageViewLayout, final Image img) { try { final File file = LocalStorage.getStorageFile(geocode, img.getUrl(), true, false); final Metadata metadata = ImageMetadataReader.readMetadata(file); final Collection<GpsDirectory> gpsDirectories = metadata.getDirectoriesOfType(GpsDirectory.class); if (gpsDirectories == null) { return; } for (final GpsDirectory gpsDirectory : gpsDirectories) { final GeoLocation geoLocation = gpsDirectory.getGeoLocation(); if (geoLocation != null && !geoLocation.isZero()) { final ImageView geoOverlay = (ImageView) imageViewLayout.findViewById(R.id.geo_overlay); geoOverlay.setVisibility(View.VISIBLE); geoOverlay.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View wpNavView) { final Geopoint gpt = new Geopoint(geoLocation.getLatitude(), geoLocation.getLongitude()); wpNavView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { NavigationAppFactory.startDefaultNavigationApplication(1, activity, gpt); } }); wpNavView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(final View v) { NavigationAppFactory.startDefaultNavigationApplication(2, activity, gpt); return true; } }); } }); break; } } } catch (final Exception e) { Log.e("ImagesList.addGeoOverlay", e); } }
Source:
<code>public int getDeploymentDeficit(AtBContract contract) { if (!contract.isActive()) { return 0; } else if (contract.getStartDate().after(getDate())) { return 0; <START> } else if (contract.getStartDate().equals(getDate())) { <END> return 0; } int total = -contract.getRequiredLances(); int role = -Math.max(1, contract.getRequiredLances() / 2); for (Lance l : lances.values()) { if (l.getMissionId() == contract.getId() && l.getRole() != Lance.ROLE_UNASSIGNED) { total++; if (l.getRole() == contract.getRequiredLanceType()) { role++; } } } if (total >= 0 && role >= 0) { return 0; } return Math.abs(Math.min(total, role)); }</code><technical_language>This simplified combining previous if (!getDate().after(contract.getStartDate()). For matter, conditions in a row combined a single statement</technical_language>

Target:
public int getDeploymentDeficit(AtBContract contract) { if (!contract.isActive()) { return 0; } else if (contract.getStartDate().compareTo(getDate()) >= 0) { return 0; } int total = -contract.getRequiredLances(); int role = -Math.max(1, contract.getRequiredLances() / 2); for (Lance l : lances.values()) { if (l.getMissionId() == contract.getId() && l.getRole() != Lance.ROLE_UNASSIGNED) { total++; if (l.getRole() == contract.getRequiredLanceType()) { role++; } } } if (total >= 0 && role >= 0) { return 0; } return Math.abs(Math.min(total, role)); }
Source:
<code>public String getTitle() { <START> return "LibraryScreen"; <END> }</code><technical_language>i18n</technical_language>

Target:
public String getTitle() { return ts.getTranslation( LibraryConstants.LibraryScreen ); }
Source:
<code>public static BaseFilterOperator getLeafFilterOperator(PredicateEvaluator predicateEvaluator, DataSource dataSource, int numDocs) { if (predicateEvaluator.isAlwaysFalse()) { return EmptyFilterOperator.getInstance(); } else if (predicateEvaluator.isAlwaysTrue()) { return new MatchAllFilterOperator(numDocs); } Predicate.Type predicateType = predicateEvaluator.getPredicateType(); if (predicateType == Predicate.Type.RANGE) { <START> if (dataSource.getDataSourceMetadata().isSorted() && (dataSource.getDictionary() != null)) { <END> return new SortedIndexBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } if (dataSource.getRangeIndex() != null) { return new RangeIndexBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } return new ScanBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } else if (predicateType == Predicate.Type.REGEXP_LIKE) { return new ScanBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } else { if (dataSource.getDataSourceMetadata().isSorted() && (dataSource.getDictionary() != null)) { return new SortedIndexBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } if (dataSource.getInvertedIndex() != null) { return new BitmapBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } return new ScanBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } }</code><technical_language>(nit) suggestion if (dataSource.getDataSourceMetadata().isSorted() && dataSource.getDictionary() != null) {</technical_language>

Target:
public static BaseFilterOperator getLeafFilterOperator(PredicateEvaluator predicateEvaluator, DataSource dataSource, int numDocs) { if (predicateEvaluator.isAlwaysFalse()) { return EmptyFilterOperator.getInstance(); } else if (predicateEvaluator.isAlwaysTrue()) { return new MatchAllFilterOperator(numDocs); } Predicate.Type predicateType = predicateEvaluator.getPredicateType(); if (predicateType == Predicate.Type.RANGE) { if (dataSource.getDataSourceMetadata().isSorted() && dataSource.getDictionary() != null) { return new SortedIndexBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } if (dataSource.getRangeIndex() != null) { return new RangeIndexBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } return new ScanBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } else if (predicateType == Predicate.Type.REGEXP_LIKE) { return new ScanBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } else { if (dataSource.getDataSourceMetadata().isSorted() && dataSource.getDictionary() != null) { return new SortedIndexBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } if (dataSource.getInvertedIndex() != null) { return new BitmapBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } return new ScanBasedFilterOperator(predicateEvaluator, dataSource, numDocs); } }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_webview, container, false); mWebView = (WebView) view.findViewById(R.id.webview); mLayout = (ViewGroup) view; WebSettings webViewSettings = mWebView.getSettings(); webViewSettings.setSupportZoom(true); webViewSettings.setBuiltInZoomControls(false); webViewSettings.setJavaScriptEnabled(true); AirMapType mapType = AirMapType.fromBundle(getArguments()); mWebView.loadDataWithBaseURL(mapType.getDomain(), mapType.getMapData(getResources()), "text/html", "base64", null); <START> mWebView.addJavascriptInterface(new MapsJavaScriptInterface(), "Android"); <END> return view; }</code><technical_language>rename interface declared "Android" "AirMapView"</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_webview, container, false); mWebView = (WebView) view.findViewById(R.id.webview); mLayout = (ViewGroup) view; WebSettings webViewSettings = mWebView.getSettings(); webViewSettings.setSupportZoom(true); webViewSettings.setBuiltInZoomControls(false); webViewSettings.setJavaScriptEnabled(true); AirMapType mapType = AirMapType.fromBundle(getArguments()); mWebView.loadDataWithBaseURL(mapType.getDomain(), mapType.getMapData(getResources()), "text/html", "base64", null); mWebView.addJavascriptInterface(new MapsJavaScriptInterface(), "AirMapView"); return view; }
Source:
<code>TextLayout getTextLayout(int lineIndex) { if (lineSpacingProvider == null) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); } int newLineSpacing = styledText.lineSpacing; Integer spacing = lineSpacingProvider.getLineSpacing(lineIndex); if (spacing != null && spacing.intValue() >= 0) { newLineSpacing = spacing; } if (isSameLineSpacing(lineIndex, newLineSpacing)) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), newLineSpacing); } TextLayout layout = getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); if (layout.getSpacing() != newLineSpacing) { layout.setSpacing(newLineSpacing); <START> reset(lineIndex, 0); <END> if (lineSpacingComputing) { return layout; } int lastLineIndex = styledText.getPartialBottomIndex() + 1; if (lineIndex >= styledText.topIndex && lineIndex <= lastLineIndex) { try { lineSpacingComputing = true; styledText.resetCache(lineIndex, 1); styledText.setVariableLineHeight(); styledText.setCaretLocation(); styledText.redraw(); } finally { lineSpacingComputing = false; } } } return layout; }</code><technical_language>I calling reset(...) text layout is desired. reset() basically informs re-create layout recreating layout..</technical_language>

Target:
TextLayout getTextLayout(int lineIndex) { if (lineSpacingProvider == null) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); } int newLineSpacing = styledText.lineSpacing; Integer spacing = lineSpacingProvider.getLineSpacing(lineIndex); if (spacing != null && spacing.intValue() >= 0) { newLineSpacing = spacing; } if (isSameLineSpacing(lineIndex, newLineSpacing)) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), newLineSpacing); } TextLayout layout = getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), newLineSpacing); if (layout.getSpacing() != newLineSpacing) { layout.setSpacing(newLineSpacing); lineSpacingChanged.add(lineIndex); } return layout; }
Source:
<code>protected DocumentModel createCollection(final String newTitle, final String newDescription, final DocumentModel context, final CoreSession session) { DocumentModel defaultCollections = getUserDefaultCollections(session); PathSegmentService pss = Framework.getService(PathSegmentService.class); String pssTitle = pss.generatePathSegment(newTitle); Map<String, Object> options = new HashMap<>(); options.put(CoreEventConstants.PARENT_PATH, defaultCollections.getPath().toString()); <START> options.put(CoreEventConstants.DESTINATION_NAME, pssTitle); <END> DocumentModel newCollection = session.createDocumentModel(CollectionConstants.COLLECTION_TYPE, options); newCollection.setPathInfo(defaultCollections.getPath().toString(), pssTitle); newCollection.setPropertyValue("dc:title", newTitle); newCollection.setPropertyValue("dc:description", newDescription); return session.createDocument(newCollection); }</code><technical_language>Is this change related <LINK_0> In wich case deserve a unit test please :pray:</technical_language>

Target:
protected DocumentModel createCollection(final String newTitle, final String newDescription, final DocumentModel context, final CoreSession session) { DocumentModel defaultCollections = getUserDefaultCollections(session); PathSegmentService pss = Framework.getService(PathSegmentService.class); Map<String, Object> options = new HashMap<>(); options.put(CoreEventConstants.PARENT_PATH, defaultCollections.getPath().toString()); options.put(CoreEventConstants.DESTINATION_NAME, pss.generatePathSegment(newTitle)); DocumentModel newCollection = session.createDocumentModel(CollectionConstants.COLLECTION_TYPE, options); newCollection.setPropertyValue("dc:title", newTitle); newCollection.setPropertyValue("dc:description", newDescription); return session.createDocument(newCollection); }
Source:
<code>private List<JobTaskMoveAssignment> pruneTaskReassignments(Iterable<JobTaskMoveAssignment> candidateAssignments) { List<JobTaskMoveAssignment> rv = new ArrayList<>(); Map<String, Boolean> snapshot = new HashMap<>(recentlyBalancedHosts.asMap()); for (JobTaskMoveAssignment assignment : candidateAssignments) { String newHostID = assignment.getTargetUUID(); if(assignment.delete()) { rv.add(assignment); <START> } <END> if (newHostID == null) { continue; } JobKey jobKey = assignment.getJobKey(); String jobID = (jobKey == null) ? null : jobKey.getJobUuid(); if (isExtremeHost(newHostID, true, true)) { log.warn("[spawn.balancer] decided not to move task from job to host " + "because it is already heavily loaded", jobID, newHostID); continue; } HostState newHost = hostManager.getHostState(newHostID); if ((newHost == null) || newHost.hasLive(jobKey) || !canReceiveNewTasks(newHost)) { log.warn("[spawn.balancer] decided not to move task from job to host " + "because it cannot receive the new task", jobID, newHostID); continue; } if (snapshot.containsKey(newHostID)) { log.warn("[spawn.balancer] decided not to move task from job to host " + "because it already received a different task recently", jobID, newHostID); continue; } rv.add(assignment); recentlyBalancedHosts.put(newHostID, true); } return rv; }</code><technical_language>need add code above. change line if (newHostID == null && !assignment.delete()) { continue; } I explained, targetUUID delete redundant actual usage in code - targetUUID is null, delete is true, condition calls out invalid combo explicitly</technical_language>

Target:
private List<JobTaskMoveAssignment> pruneTaskReassignments(Iterable<JobTaskMoveAssignment> candidateAssignments) { List<JobTaskMoveAssignment> rv = new ArrayList<>(); Map<String, Boolean> snapshot = new HashMap<>(recentlyBalancedHosts.asMap()); for (JobTaskMoveAssignment assignment : candidateAssignments) { String newHostID = assignment.getTargetUUID(); if(assignment.delete()) { rv.add(assignment); } else { if (newHostID == null) { continue; } JobKey jobKey = assignment.getJobKey(); String jobID = (jobKey == null) ? null : jobKey.getJobUuid(); if (isExtremeHost(newHostID, true, true)) { log.warn("[spawn.balancer] decided not to move task from job to host " + "because it is already heavily loaded", jobID, newHostID); continue; } HostState newHost = hostManager.getHostState(newHostID); if ((newHost == null) || newHost.hasLive(jobKey) || !canReceiveNewTasks(newHost)) { log.warn("[spawn.balancer] decided not to move task from job to host " + "because it cannot receive the new task", jobID, newHostID); continue; } if (snapshot.containsKey(newHostID)) { log.warn("[spawn.balancer] decided not to move task from job to host " + "because it already received a different task recently", jobID, newHostID); continue; } rv.add(assignment); recentlyBalancedHosts.put(newHostID, true); } } return rv; }
Source:
<code><START> public List<TranscriptConsequence> findCanonicalTranscriptCandidates( <END> List<TranscriptConsequence> transcriptConsequences ) { List<TranscriptConsequence> transcripts = new ArrayList<>(); for (TranscriptConsequence transcript : transcriptConsequences) { if (transcript.getTranscriptId() != null && transcript.getCanonical() != null && transcript.getCanonical().equals("1")) { transcripts.add(transcript); } } return transcripts; }</code><technical_language>@onursumer wondering if this function private avoid people accidentally it</technical_language>

Target:
private List<TranscriptConsequence> findCanonicalTranscriptCandidates( List<TranscriptConsequence> transcriptConsequences ) { List<TranscriptConsequence> transcripts = new ArrayList<>(); for (TranscriptConsequence transcript : transcriptConsequences) { if (transcript.getTranscriptId() != null && transcript.getCanonical() != null && transcript.getCanonical().equals("1")) { transcripts.add(transcript); } } return transcripts; }
Source:
<code>protected Boolean doInBackground(Void... params) { try { populateHtml(inputFile, values); return true; } catch (IOException e) { <START> errorType = IO_ERROR; <END> return false; } catch (RuntimeException e) { errorType = VALIDATION_ERROR; return false; } }</code><technical_language>odd this errorType state-ness... this return integer 0 success, 1 IO error, etc.</technical_language>

Target:
protected PrintTaskResult doInBackground(Void... params) { try { populateAndSaveHtml(templateFile, templatePopulationMapping, populatedFilepath); return PrintTaskResult.SUCCESS; } catch (IOException e) { return PrintTaskResult.IO_ERROR; } catch (PrintValidationException e) { problemString = e.getMessage(); return e.getErrorType(); } }
Source:
<code>public Response resolve(Action action) { validateParameters(action, "resolutionType"); <START> ResolutionType resolutionType = validateEnum(ResolutionType.class, action.getResolutionType().toUpperCase()); <END> switch (resolutionType) { case ADD: return addToMissingServers(action); case COPY: return copy(action); default: return null; } }</code><technical_language>a signature passing boolean true validate enum transferring UpperCase (so you, do manually)</technical_language>

Target:
public Response resolve(Action action) { validateParameters(action, "resolutionType"); ResolutionType resolutionType = EnumValidator.validateEnum(ResolutionType.class, action.getResolutionType(),true); switch (resolutionType) { case ADD: return addToMissingServers(action); case COPY: return copy(action); default: return null; } }
Source:
<code>private void connectionChanged(Connection connection, ConnectionState state) { if (state == ConnectionState.CONNECTING) { roster = connection.getRoster(); if (roster == null) { log.fatal("A new connection without a roster should not happen!"); return; } roster.addRosterListener(rosterListener); discoveryService.connectionChanged(connection); contacts.clear(); } else if (state == ConnectionState.CONNECTED) { <END> contacts.init(roster); notifyListeners(null, UpdateType.CONNECTED); } else { if (roster != null) roster.removeRosterListener(rosterListener); roster = null; discoveryService.connectionChanged(null); contacts.getAll().forEach(XMPPContact::removeResources); notifyListeners(null, UpdateType.NOT_CONNECTED); } }</code><technical_language>fatal means application -> boom this a reason for fatal ? error assert</technical_language>

Target:
private void connectionChanged(Connection connection, ConnectionState state) { if (state == ConnectionState.CONNECTING) { roster = connection.getRoster(); if (roster == null) { log.fatal("A new connection without a roster should not happen!"); return; } roster.addRosterListener(rosterListener); discoveryService.connectionChanged(connection); contacts.clear(); } else if (state == ConnectionState.CONNECTED) { contacts.init(roster); notifyListeners(null, UpdateType.CONNECTED); } else if (state == ConnectionState.DISCONNECTING || state == ConnectionState.ERROR) { if (roster != null) roster.removeRosterListener(rosterListener); roster = null; discoveryService.connectionChanged(null); contacts.getAll().forEach(XMPPContact::removeResources); notifyListeners(null, UpdateType.NOT_CONNECTED); } }
Source:
<code>public ForkJoinStrategy createForkJoinStrategy(ProcessingStrategy processingStrategy, int maxConcurrency, boolean delayErrors, long timeout, Scheduler timeoutScheduler, ErrorType timeoutErrorType) { reactor.core.scheduler.Scheduler reactorTimeoutScheduler = Schedulers.fromExecutorService(timeoutScheduler); return (original, routingPairs) -> { final AtomicInteger count = new AtomicInteger(); final CoreEvent.Builder resultBuilder = builder(original); return from(routingPairs) .map(addSequence(count)) .flatMapSequential(processRoutePair(processingStrategy, maxConcurrency, delayErrors, timeout, reactorTimeoutScheduler, timeoutErrorType), maxConcurrency) .collectList() .doOnNext(list -> { if (list.stream().anyMatch(event -> event.getError().isPresent() <START> && !isOriginalError(event.getError().get(), original.getError()))) { <END> throw propagate(createCompositeRoutingException(list.stream() .map(event -> removeOriginalError(event, original.getError())).collect(toList()))); } }) .doOnNext(mergeVariables(original, resultBuilder)) .map(createResultEvent(original, resultBuilder)); }; }</code><technical_language>a stream, call isOriginalError a filter in stream</technical_language>

Target:
public ForkJoinStrategy createForkJoinStrategy(ProcessingStrategy processingStrategy, int maxConcurrency, boolean delayErrors, long timeout, Scheduler timeoutScheduler, ErrorType timeoutErrorType) { reactor.core.scheduler.Scheduler reactorTimeoutScheduler = Schedulers.fromExecutorService(timeoutScheduler); return (original, routingPairs) -> { final AtomicInteger count = new AtomicInteger(); final CoreEvent.Builder resultBuilder = builder(original); return from(routingPairs) .map(addSequence(count)) .flatMapSequential(processRoutePair(processingStrategy, maxConcurrency, delayErrors, timeout, reactorTimeoutScheduler, timeoutErrorType), maxConcurrency) .reduce(new Pair<List<CoreEvent>, Boolean>(new ArrayList<>(), false), (pair, event) -> { pair.getFirst().add(event); boolean hasNewError = event.getError().map(err -> !isOriginalError(err, original.getError())).orElse(false); return new Pair(pair.getFirst(), pair.getSecond() || hasNewError); }) .doOnNext(p -> { Pair<List<CoreEvent>, Boolean> pair = (Pair<List<CoreEvent>, Boolean>) p; if (pair.getSecond()) { throw propagate(createCompositeRoutingException(pair.getFirst().stream() .map(event -> removeOriginalError(event, original.getError())).collect(toList()))); } }) .map(pair -> ((Pair<List<CoreEvent>, Boolean>) pair).getFirst()) .doOnNext(mergeVariables(original, resultBuilder)) .map(createResultEvent(original, resultBuilder)); }; }
Source:
<code>@Override public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); Request.Builder builder = originalRequest.newBuilder(); final String token = loginPrefs.getAuthorizationHeader(); if (token != null) { builder.addHeader("Authorization", token); } else { <START> logger.warn("Token cannot be null when AUTH_JSON is also null, something is WRONG!"); <END> } return chain.proceed(builder.build()); }</code><technical_language>this is out of scope: I this in log is wrong. Is this supposed a warning</technical_language>

Target:
public Response intercept(Chain chain) throws IOException { final Request.Builder builder = chain.request().newBuilder(); final String token = loginPrefs.getAuthorizationHeader(); if (token != null) { builder.addHeader("Authorization", token); } return chain.proceed(builder.build()); }
Source:
<code>public void withPoller() { <START> assertTrue(this.withPoller instanceof PollingConsumer); <END> }</code><technical_language>Hi, Biju! Thank for more contribution. In addition Gary's concerns I suggest change this assertTrue the: assertThat(this.withPoller, Matchers.instanceOf(PollingConsumer.class)); more informative, if target expected type</technical_language>

Target:
public void withPoller() { assertThat(this.withPoller1, Matchers.instanceOf(PollingConsumer.class)); }
Source:
<code>String generateDeclarations( List<SourceFile> sourceFiles, List<SourceFile> externs, Depgraph depgraph) throws AssertionError { compiler.initOptions(opts.getCompilerOptions()); <START> for (SourceFile sf : sourceFiles) { <END> Node ast = compiler.parse(sf); String moduleId = getGoogModuleId(ast); if (moduleId != null) { importRenameMap.putAll(getImportRenameMap(moduleId, ast)); } } compiler.compile(externs, sourceFiles, opts.getCompilerOptions()); unknownType = compiler.getTypeRegistry().getNativeType(JSTypeNative.UNKNOWN_TYPE); numberType = compiler.getTypeRegistry().getNativeType(JSTypeNative.NUMBER_TYPE); iterableType = compiler.getTypeRegistry().getType("Iterable"); iteratorIterableType = compiler.getTypeRegistry().getType("IteratorIterable"); String dts = ""; if (compiler.getTopScope() != null) { precomputeChildLists(); collectTypedefs(); dts = produceDts(depgraph); } errorManager.doGenerateReport(); return dts; }</code><technical_language>move this entire calculation out of DeclarationGenerator? file is large, this a easy pull out</technical_language>

Target:
String generateDeclarations( List<SourceFile> sourceFiles, List<SourceFile> externs, Depgraph depgraph) throws AssertionError { compiler.compile(externs, sourceFiles, opts.getCompilerOptions()); if (opts.partialInput) { importRenameMap = ImportRenameMapBuilder.build(compiler.getParsedInputs()); } unknownType = compiler.getTypeRegistry().getNativeType(JSTypeNative.UNKNOWN_TYPE); numberType = compiler.getTypeRegistry().getNativeType(JSTypeNative.NUMBER_TYPE); iterableType = compiler.getTypeRegistry().getType("Iterable"); iteratorIterableType = compiler.getTypeRegistry().getType("IteratorIterable"); String dts = ""; if (compiler.getTopScope() != null) { precomputeChildLists(); collectTypedefs(); dts = produceDts(depgraph); } errorManager.doGenerateReport(); return dts; }
Source:
<code>public void visitCfg() { if (cfgStartNode instanceof ControlFlowBlock) { ProgramState initialState = ProgramState.emptyState(); <START> for (Symbol localVar : trackedVariables) { <END> if ("arguments".equals(localVar.name())) { initialState = initialState.copyAndAddValue(localVar, SymbolicValue.UNKNOWN); } } for (Symbol functionParameter : functionParameters) { initialState = initialState.copyAndAddValue(functionParameter, SymbolicValue.UNKNOWN); } workList.addLast(new BlockExecution((ControlFlowBlock) cfgStartNode, initialState)); } for (int i = 0; i < 10000 && !workList.isEmpty(); i++) { BlockExecution blockExecution = workList.removeFirst(); Tree branchingTree = blockExecution.block.branchingTree(); if (branchingTree != null && branchingTree.is(Kind.TRY_STATEMENT)) { return; } execute(blockExecution); } if (workList.isEmpty()) { reportIssues(); } }</code><technical_language>@pynicolas this loop over-complicated. save scope call Scope#getSymbol(String) insert break</technical_language>

Target:
public void visitCfg() { workList.addLast(new BlockExecution(cfgStartBlock, initialState())); for (int i = 0; i < MAX_BLOCK_EXECUTIONS && !workList.isEmpty(); i++) { BlockExecution blockExecution = workList.removeFirst(); if (!alreadyProcessed.contains(blockExecution)) { if (hasTryBranchingTree(blockExecution.block())) { return; } execute(blockExecution); alreadyProcessed.add(blockExecution); } } if (workList.isEmpty()) { reportIssues(); } }