Source:
<code>public <START> synchronized TmfModelResponse<ITmfCommonXAxisModel> <END> fetchXY(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { if (!(fProvider instanceof IAnalysisModule)) { return TmfCommonXAxisResponseFactory.createFailedResponse(Messages.SegmentStoreDataProvider_SegmentMustBeAnIAnalysisModule); } if (!(((IAnalysisModule) fProvider).waitForCompletion())) { return TmfCommonXAxisResponseFactory.createFailedResponse(CommonStatusMessage.ANALYSIS_INITIALIZATION_FAILED); } final ISegmentStore<ISegment> segStore = fProvider.getSegmentStore(); if (segStore == null) { return TmfCommonXAxisResponseFactory.createFailedResponse(Messages.SegmentStoreDataProvider_SegmentNotAvailable); } long start = filter.getStart(); long end = filter.getEnd(); fPixelSize = Math.max(1, (end - start) / filter.getTimesRequested().length); final Iterable<ISegment> intersectingElements = segStore.getIntersectingElements(start, end, SegmentComparators.INTERVAL_START_COMPARATOR); final Iterable<ISegment> displayData = compactList(start, intersectingElements); List<Long> xSeries = new ArrayList<>(); List<Double> yValues = new ArrayList<>(); for (ISegment segment : displayData) { if (monitor != null && monitor.isCanceled()) { return TmfCommonXAxisResponseFactory.createCancelledResponse(CommonStatusMessage.TASK_CANCELLED); } xSeries.add(segment.getStart()); yValues.add((double) segment.getLength()); } IYModel yModel = new YModel(Objects.requireNonNull(Messages.SegmentStoreDataProvider_Duration), Objects.requireNonNull(Doubles.toArray(yValues))); Map<String, IYModel> ySeries = ImmutableMap.of(Objects.requireNonNull(Messages.SegmentStoreDataProvider_Duration), yModel); return TmfCommonXAxisResponseFactory.create(Objects.requireNonNull(Messages.SegmentStoreScatterGraphViewer_title), Objects.requireNonNull(Longs.toArray(xSeries)), ySeries, true); }</code><technical_language>synchronized, segment store is thread safe? Making fPixel size a local variable class variable a fix for concurrency</technical_language>

Target:
public TmfModelResponse<ITmfCommonXAxisModel> fetchXY(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { ISegmentStoreProvider provider = fProvider; if (!(provider instanceof IAnalysisModule)) { return TmfCommonXAxisResponseFactory.createFailedResponse(Messages.SegmentStoreDataProvider_SegmentMustBeAnIAnalysisModule); } if (!(((IAnalysisModule) provider).waitForCompletion())) { return TmfCommonXAxisResponseFactory.createFailedResponse(CommonStatusMessage.ANALYSIS_INITIALIZATION_FAILED); } final ISegmentStore<ISegment> segStore = provider.getSegmentStore(); if (segStore == null) { return TmfCommonXAxisResponseFactory.createFailedResponse(Messages.SegmentStoreDataProvider_SegmentNotAvailable); } long start = filter.getStart(); long end = filter.getEnd(); long pixelSize = Math.max(1, (end - start) / filter.getTimesRequested().length); final Iterable<ISegment> intersectingElements = segStore.getIntersectingElements(start, end, SegmentComparators.INTERVAL_START_COMPARATOR); final Iterable<ISegment> displayData = compactList(start, intersectingElements, pixelSize); List<Long> xSeries = new ArrayList<>(); List<Double> yValues = new ArrayList<>(); for (ISegment segment : displayData) { if (monitor != null && monitor.isCanceled()) { return TmfCommonXAxisResponseFactory.createCancelledResponse(CommonStatusMessage.TASK_CANCELLED); } xSeries.add(segment.getStart()); yValues.add((double) segment.getLength()); } IYModel yModel = new YModel(Objects.requireNonNull(Messages.SegmentStoreDataProvider_Duration), Objects.requireNonNull(Doubles.toArray(yValues))); Map<String, IYModel> ySeries = ImmutableMap.of(Objects.requireNonNull(Messages.SegmentStoreDataProvider_Duration), yModel); return TmfCommonXAxisResponseFactory.create(Objects.requireNonNull(Messages.SegmentStoreScatterGraphViewer_title), Objects.requireNonNull(Longs.toArray(xSeries)), ySeries, true); }