Source:
<code>public TmfModelResponse<List<TmfTreeDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { <START> if (fCached != null) { return fCached; } <END> 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); }</code><technical_language>remove, cache is set tree depends filter range</technical_language>

Target:
public TmfModelResponse<List<TmfTreeDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { 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 (INamedSegment segment : Iterables.filter(intersectingElements, INamedSegment.class)) { if (monitor != null && monitor.isCanceled()) { return new TmfModelResponse<>(null, ITmfResponse.Status.CANCELLED, CommonStatusMessage.TASK_CANCELLED); } segmentTypes.add(segment.getName()); } Builder<TmfTreeDataModel> nodes = new ImmutableList.Builder<>(); nodes.add(new TmfTreeDataModel(fTraceId, -1, String.valueOf(getTrace().getName()))); for (String seriesName : segmentTypes) { long seriesId = getUniqueId(seriesName); nodes.add(new TmfTreeDataModel(seriesId, fTraceId, seriesName)); } return new TmfModelResponse<>(nodes.build(), complete ? ITmfResponse.Status.COMPLETED : ITmfResponse.Status.RUNNING, complete ? CommonStatusMessage.COMPLETED: CommonStatusMessage.RUNNING); }