IMarker[] markers= resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ONE); if (markers.length != 0) {  return NO_ADORNMENT; }  markers= resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
	public int computeAdornmentFlags(IResource resource) {		if (resource == null || !resource.isAccessible()) {			return NO_ADORNMENT;		}		int flag= NO_ADORNMENT;		try {			IMarker[] markers= resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ONE);			if (markers.length != 0) {				//it's already been marked by a ProblemsLabelDecorator				return NO_ADORNMENT;			}			//find marker with highest severity			markers= resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);			if (markers != null) {				for (int i= 0; i < markers.length && (flag != JavaElementImageDescriptor.ERROR); i++) {					IMarker curr= markers[i];					int priority= curr.getAttribute(IMarker.SEVERITY, -1);					if (priority == IMarker.SEVERITY_WARNING && flag==NO_ADORNMENT) {						flag= JavaElementImageDescriptor.WARNING;					} else if (priority == IMarker.SEVERITY_ERROR && (flag==NO_ADORNMENT || flag==JavaElementImageDescriptor.WARNING)) {						return JavaElementImageDescriptor.ERROR;					}				}			}		} catch (CoreException e) {			JavaPlugin.log(e);		}		return flag;	}