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
if (marker.isSubtypeOf(IMarker.TEXT)) {
			int pos= marker.getAttribute(IMarker.CHAR_START, -1);
			return isInside(pos, sourceElement);
		}
		return false;
	}
	
	
	private int getErrorTicksFromWorkingCopy(ICompilationUnit original, ISourceReference sourceElement) throws CoreException {
		int info= 0;
		if (!original.exists()) {
			return 0;
		}
		
		FileEditorInput editorInput= new FileEditorInput((IFile) original.getResource());
		IAnnotationModel model= JavaPlugin.getDefault().getCompilationUnitDocumentProvider().getAnnotationModel(editorInput);
		if (model != null) {
			Iterator iter= model.getAnnotationIterator();
			while ((info != ERRORTICK_ERROR) && iter.hasNext()) {
				Annotation curr= (Annotation) iter.next();
				IMarker marker= isAnnotationInRange(model, curr, sourceElement);
				if (marker != null) {
					int priority= marker.getAttribute(IMarker.SEVERITY, -1);
					if (priority == IMarker.SEVERITY_WARNING) {
						info= ERRORTICK_WARNING;
					} else if (priority == IMarker.SEVERITY_ERROR) {
						info= ERRORTICK_ERROR;
					}
				}
			}