if (fMarkOccurrenceTargetRegion != null && currentModificationStamp == fMarkOccurrenceModificationStamp) { if (fMarkOccurrenceTargetRegion.getOffset() <= offset && offset <= fMarkOccurrenceTargetRegion.getOffset() + fMarkOccurrenceTargetRegion.getLength())
IRegion markOccurrenceTargetRegion= fMarkOccurrenceTargetRegion; if (markOccurrenceTargetRegion != null && currentModificationStamp == fMarkOccurrenceModificationStamp) { if (markOccurrenceTargetRegion.getOffset() <= offset && offset <= markOccurrenceTargetRegion.getOffset() + markOccurrenceTargetRegion.getLength())
	protected void updateOccurrenceAnnotations(ITextSelection selection, CompilationUnit astRoot) {		if (fOccurrencesFinderJob != null)			fOccurrencesFinderJob.cancel();		if (!fMarkOccurrenceAnnotations)			return;		if (astRoot == null || selection == null)			return;		IDocument document= getSourceViewer().getDocument();		if (document == null)			return;		if (document instanceof IDocumentExtension4) {			int offset= selection.getOffset();			long currentModificationStamp= ((IDocumentExtension4)document).getModificationStamp();			if (fMarkOccurrenceTargetRegion != null && currentModificationStamp == fMarkOccurrenceModificationStamp) {				if (fMarkOccurrenceTargetRegion.getOffset() <= offset && offset <= fMarkOccurrenceTargetRegion.getOffset() + fMarkOccurrenceTargetRegion.getLength())					return;			}			fMarkOccurrenceTargetRegion= JavaWordFinder.findWord(document, offset);			fMarkOccurrenceModificationStamp= currentModificationStamp;		}		List matches= null;				ASTNode selectedNode= NodeFinder.perform(astRoot, selection.getOffset(), selection.getLength());				if (fMarkExceptions || fMarkTypeOccurrences) {			ExceptionOccurrencesFinder exceptionFinder= new ExceptionOccurrencesFinder();			String message= exceptionFinder.initialize(astRoot, selectedNode);			if (message == null) {				matches= exceptionFinder.perform();				if (!fMarkExceptions && !matches.isEmpty())					matches.clear();			}		}		if ((matches == null || matches.isEmpty()) && (fMarkMethodExitPoints || fMarkTypeOccurrences)) {			MethodExitsFinder finder= new MethodExitsFinder();			String message= finder.initialize(astRoot, selectedNode);			if (message == null) {				matches= finder.perform();				if (!fMarkMethodExitPoints && !matches.isEmpty())					matches.clear();			}		}		if ((matches == null || matches.isEmpty()) && (fMarkBreakContinueTargets || fMarkTypeOccurrences)) {			BreakContinueTargetFinder finder= new BreakContinueTargetFinder();			String message= finder.initialize(astRoot, selectedNode);			if (message == null) {				matches= finder.perform();				if (!fMarkBreakContinueTargets && !matches.isEmpty())					matches.clear();			}		}		if ((matches == null || matches.isEmpty()) && (fMarkImplementors || fMarkTypeOccurrences)) {			ImplementOccurrencesFinder finder= new ImplementOccurrencesFinder();			String message= finder.initialize(astRoot, selectedNode);			if (message == null) {				matches= finder.perform();				if (!fMarkImplementors && !matches.isEmpty())					matches.clear();			}		}		if (matches == null) {			IBinding binding= null;			if (selectedNode instanceof Name)				binding= ((Name)selectedNode).resolveBinding();			if (binding != null && markOccurrencesOfType(binding)) {				// Find the matches && extract positions so we can forget the AST				OccurrencesFinder finder = new OccurrencesFinder(binding);				String message= finder.initialize(astRoot, selectedNode);				if (message == null)					matches= finder.perform();			}		}		if (matches == null || matches.size() == 0) {			if (!fStickyOccurrenceAnnotations)				removeOccurrenceAnnotations();			return;		}		Position[] positions= new Position[matches.size()];		int i= 0;		for (Iterator each= matches.iterator(); each.hasNext();) {			ASTNode currentNode= (ASTNode)each.next();			positions[i++]= new Position(currentNode.getStartPosition(), currentNode.getLength());		}		fOccurrencesFinderJob= new OccurrencesFinderJob(document, positions, selection);		//fOccurrencesFinderJob.setPriority(Job.DECORATE);		//fOccurrencesFinderJob.setSystem(true);		//fOccurrencesFinderJob.schedule();		fOccurrencesFinderJob.run(new NullProgressMonitor());	}