Source:
<code>public TmfModelResponse<List<TmfTreeDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { if (fCached != null) { return fCached; <START> } <END> ISegmentStore<ISegment> segStore= fProvider.getSegmentStore(); if (segStore == null) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.ANALYSIS_INITIALIZATION_FAILED); } long start = filter.getStart(); long end = filter.getEnd(); final Predicate<ISegment> startInRangePredication = s -> { return s.getStart() >= start; }; final Iterable<ISegment> intersectingElements = Iterables.filter(segStore.getIntersectingElements(start, end, SegmentComparators.INTERVAL_START_COMPARATOR), startInRangePredication); Set<String> segmentTypes = new HashSet<>(); IAnalysisModule module = (fProvider instanceof IAnalysisModule) ? (IAnalysisModule) fProvider : null; boolean complete = module == null ? true : module.isQueryable(filter.getEnd()); for (ISegment segment : intersectingElements) { if (monitor != null && monitor.isCanceled()) { return new TmfModelResponse<>(null, ITmfResponse.Status.CANCELLED, CommonStatusMessage.TASK_CANCELLED); } if (segment instanceof INamedSegment) { segmentTypes.add(((INamedSegment) segment).getName()); } } List<TmfTreeDataModel> nodes = new ArrayList<>(); nodes.add(new TmfTreeDataModel(fTraceId, -1, getTrace().getName())); for (String seriesName : segmentTypes) { long seriesId = getUniqueId(seriesName); nodes.add(new TmfTreeDataModel(seriesId, fTraceId, seriesName)); } return new TmfModelResponse<>(nodes, complete ? ITmfResponse.Status.COMPLETED : ITmfResponse.Status.RUNNING, CommonStatusMessage.RUNNING); }</code><technical_language>space</technical_language>

Target:
public TmfModelResponse<List<TmfTreeDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { if (fCached != null) { return fCached; } ISegmentStoreProvider provider = fProvider; ISegmentStore<ISegment> segStore= provider.getSegmentStore(); if (segStore == null) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.ANALYSIS_INITIALIZATION_FAILED); } long start = filter.getStart(); long end = filter.getEnd(); final Predicate<ISegment> startInRangePredication = s -> s.getStart() >= start; final Iterable<ISegment> intersectingElements = Iterables.filter(segStore.getIntersectingElements(start, end), startInRangePredication); Set<String> segmentTypes = new HashSet<>(); IAnalysisModule module = (provider instanceof IAnalysisModule) ? (IAnalysisModule) provider : null; boolean complete = module == null ? true : module.isQueryable(filter.getEnd()); for (ISegment segment : Iterables.filter(intersectingElements, INamedSegment.class)) { if (monitor != null && monitor.isCanceled()) { return new TmfModelResponse<>(null, ITmfResponse.Status.CANCELLED, CommonStatusMessage.TASK_CANCELLED); } segmentTypes.add(((INamedSegment) segment).getName()); } List<TmfTreeDataModel> nodes = new ArrayList<>(); nodes.add(new TmfTreeDataModel(fTraceId, -1, getTrace().getName())); for (String seriesName : segmentTypes) { long seriesId = getUniqueId(seriesName); nodes.add(new TmfTreeDataModel(seriesId, fTraceId, seriesName)); } return new TmfModelResponse<>(nodes, complete ? ITmfResponse.Status.COMPLETED : ITmfResponse.Status.RUNNING, CommonStatusMessage.RUNNING); }