if (endOffset < startOffset) { int i= endOffset; endOffset= startOffset; startOffset= i; } if (revealEndOffset < revealStartOffset) { int i= revealEndOffset; revealEndOffset= revealStartOffset; revealStartOffset= i; }
		public void restore() {			/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=52257			 * This method may be called inside an asynchronous call posted			 * to the UI thread, so protect against intermediate disposal			 * of the editor.			 */			if (getSourceViewer() == null)				return;			try {				int startOffset, endOffset;				int revealStartOffset, revealEndOffset;				if (showsHighlightRangeOnly()) {					IJavaElement newStartElement= fStartOffset.getElement();					startOffset= fStartOffset.getRememberedOffset(newStartElement);					revealStartOffset= fStartOffset.getRevealOffset(newStartElement, startOffset);					if (revealStartOffset == -1)						startOffset= -1;					IJavaElement newEndElement= fEndOffset.getElement();					endOffset= fEndOffset.getRememberedOffset(newEndElement);					revealEndOffset= fEndOffset.getRevealOffset(newEndElement, endOffset);					if (revealEndOffset == -1)						endOffset= -1;				} else {					startOffset= fStartOffset.getOffset();					revealStartOffset= startOffset;					endOffset= fEndOffset.getOffset();					revealEndOffset= endOffset;				}				if (startOffset == -1) {					startOffset= endOffset; // fallback to caret offset					revealStartOffset= revealEndOffset;				}				if (endOffset == -1) {					endOffset= startOffset; // fallback to other offset					revealEndOffset= revealStartOffset;				}				IJavaElement element;				if (endOffset == -1) {					 // fallback to element selection					element= fEndOffset.getElement();					if (element == null)						element= fStartOffset.getElement();					if (element != null)						setSelection(element);					return;				}				if (isValidSelection(revealStartOffset, revealEndOffset - revealStartOffset) && isValidSelection(startOffset, endOffset - startOffset))					selectAndReveal(startOffset, endOffset - startOffset, revealStartOffset, revealEndOffset - revealStartOffset);			} finally {				fStartOffset.clear();				fEndOffset.clear();			}		}