Source:
<code>public @Nullable ICommonXAxisResponse fetch(double[] x, AnalysisBaseQueryFilter filter, @Nullable IProgressMonitor monitor) { if (fProvider == null) { return null; } if (fProvider instanceof IAnalysisModule) { <START> if (!(((IAnalysisModule) fProvider).waitForCompletion())) { return null; } <END> } final ISegmentStore<ISegment> segStore = fProvider != null ? fProvider.getSegmentStore() : null; if (segStore == null) { return null; } long start = filter.getQueryInterval().getStartTime(); long end = filter.getQueryInterval().getEndTime(); fPixelStart = start; fPixelSize = Math.max(1, (end - start) / MAX_POINTS); final Iterable<ISegment> intersectingElements = segStore.getIntersectingElements(start, end, SegmentComparators.INTERVAL_START_COMPARATOR); final Iterable<ISegment> displayData = compactList(start, intersectingElements); if (end == start) { return null; } List<Double> xSeries = new ArrayList<>(); List<Double> yValues = new ArrayList<>(); Set<IYSeries> ySeries = new HashSet<>(); for (ISegment segment : displayData) { if (monitor != null && monitor.isCanceled()) { return null; } xSeries.add((double) (segment.getStart() - start)); yValues.add((double) segment.getLength()); } ySeries.add(new YSeries("", "GREEN", 1, "", Messages.SegmentStoreDataProvider_Duration, Doubles.toArray(yValues))); return CommonXAxisResponseFactory.build("Latency vs Time", Doubles.toArray(xSeries), ySeries, filter.getQueryInterval().getEndTime(), true); }</code><technical_language>return results analysis is completed</technical_language>

Target:
public ICommonXAxisResponse fetch(double[] x, AnalysisBaseQueryFilter filter, @Nullable IProgressMonitor monitor) { long start = filter.getQueryInterval().getStartTime().toNanos(); long end = filter.getQueryInterval().getEndTime().toNanos(); if (end == start) { return CommonXAxisResponseFactory.createFailedResponse(CommonStatusMessage.END_AND_START_MUST_BE_DIFFERENT); } if (!(fProvider instanceof IAnalysisModule)) { return CommonXAxisResponseFactory.createFailedResponse("Segment provider should be an IAnalysisModule"); } if (!(((IAnalysisModule) fProvider).waitForCompletion())) { return CommonXAxisResponseFactory.createFailedResponse("Segment provider should be an IAnalysisModule"); } final ISegmentStore<ISegment> segStore = fProvider.getSegmentStore(); if (segStore == null) { return CommonXAxisResponseFactory.createFailedResponse("No segment store at the moment"); } fPixelStart = start; fPixelSize = Math.max(1, (end - start) / MAX_POINTS); final Iterable<ISegment> intersectingElements = segStore.getIntersectingElements(start, end, SegmentComparators.INTERVAL_START_COMPARATOR); final Iterable<ISegment> displayData = compactList(start, intersectingElements); List<Double> xSeries = new ArrayList<>(); List<Double> yValues = new ArrayList<>(); Map<String, IYSeries> ySeries = new HashMap<>(); for (ISegment segment : displayData) { if (monitor != null && monitor.isCanceled()) { return CommonXAxisResponseFactory.createCancelledResponse(CommonStatusMessage.PROGRESS_MONITOR_CANCELLED); } xSeries.add((double) (segment.getStart() - start)); yValues.add((double) segment.getLength()); } ySeries.put(Messages.SegmentStoreDataProvider_Duration, new YSeries("", "BLUE", 1, "", Messages.SegmentStoreDataProvider_Duration, Doubles.toArray(yValues))); return CommonXAxisResponseFactory.create(Messages.SegmentStoreScatterGraphViewer_title, Doubles.toArray(xSeries), ySeries, filter.getQueryInterval().getEndTime().toNanos(), true); }