Bug 27561 ProblemsLabelDecorator.getErrorTicksFromWorkingCopy should avoid calling exists()
input for 20021203 calling exists() is expensive ironically, it may be cheaper to let the exception happen (we do not expect it to heppen to frequently), catch it and do the right thing will attach profile showing that method taking 8% of time needed to open java editor
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/ProblemsLabelDecorator.java
}
		return info;
	}
			
	private IMarker isAnnotationInRange(IAnnotationModel model, Annotation annot, ISourceReference sourceElement) throws CoreException {
		if (annot instanceof MarkerAnnotation) {
			IMarker marker= ((MarkerAnnotation) annot).getMarker();
			if (marker.exists() && marker.isSubtypeOf(IMarker.PROBLEM)) {
				Position pos= model.getPosition(annot);
				if (isInside(pos.getOffset(), sourceElement)) {
					return marker;
				}
			}
		}
		return null;
	}
	
	/**
	 * Tests if a position is inside the source range of an element.
	 * @param pos Position to be tested.
	 * @param sourceElement Source element (must be a IJavaElement)
	 * @return boolean Return <code>true</code> if position is located inside the source element.
	 * @throws CoreException Exception thrown if element range could not be accessed.
	 */
	protected boolean isInside(int pos, ISourceReference sourceElement) throws CoreException {
		ISourceRange range= sourceElement.getSourceRange();
		int rangeOffset= range.getOffset();
		return (rangeOffset <= pos && rangeOffset + range.getLength() > pos);
	}