if (timeStamp != getTimestamp())
if (isCanceled())
	private void internalUpdatePresentation(TextPresentation textPresentation, HighlightedPosition[] addedPositions, HighlightedPosition[] removedPositions, Object timeStamp) {		if (fSourceViewer == null)			return;				checkOrdering("added positions: ", Arrays.asList(addedPositions)); //$NON-NLS-1$		checkOrdering("removed positions: ", Arrays.asList(removedPositions)); //$NON-NLS-1$		checkOrdering("old positions: ", fPositions); //$NON-NLS-1$				// TODO: double-check consistency with document.getPositions(...)		// TODO: reuse removed positions		if (timeStamp != getTimestamp())			return;				IDocument document= fSourceViewer.getDocument();		if (document == null)			return;				String positionCategory= getPositionCategory();				List removedPositionsList= Arrays.asList(removedPositions);				try {			synchronized (fPositionLock) {				List oldPositions= fPositions;				int newSize= fPositions.size() + addedPositions.length - removedPositions.length;				List newPositions= new ArrayList(newSize);				Position position= null;				Position addedPosition= null;				for (int i= 0, j= 0, n= oldPositions.size(), m= addedPositions.length; i < n || j < m;) {					while (position == null && i < n) {						position= (Position) oldPositions.get(i++);						if (position.isDeleted() || contain(removedPositionsList, position)) {							document.removePosition(positionCategory, position);							position= null;						}					}					if (addedPosition == null && j < m) {						addedPosition= addedPositions[j++];						document.addPosition(positionCategory, addedPosition);					}										if (position != null)						if (addedPosition != null)							if (position.getOffset() <= addedPosition.getOffset()) {								newPositions.add(position);								position= null;							} else {								newPositions.add(addedPosition);								addedPosition= null;							}						else {							newPositions.add(position);							position= null;						}					else if (addedPosition != null) {						newPositions.add(addedPosition);						addedPosition= null;					}				}				fPositions= newPositions;			}		} catch (BadPositionCategoryException e) {			// Should not happen			JavaPlugin.log(e);		} catch (BadLocationException e) {			// Should not happen			JavaPlugin.log(e);		}		checkOrdering("new positions: ", fPositions); //$NON-NLS-1$				if (textPresentation != null)			fSourceViewer.changeTextPresentation(textPresentation, false);	}