Bug 31794 Types views show too many errors
create this in 1 file (e.g. A.java) class B{} class A extends B{ + //<<syntax error } class P {} class O extends P{} in java browsing you see error decorations for all 4 types, which is incorrect
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/TopLevelTypeProblemsLabelDecorator.java
public TopLevelTypeProblemsLabelDecorator(ImageDescriptorRegistry registry) {
		super(registry);
	}
	/* (non-Javadoc)
	 * @see org.eclipse.jdt.ui.ProblemsLabelDecorator#isInside(int, ISourceReference)
	 */
	protected boolean isInside(int pos, ISourceReference sourceElement) throws CoreException {
		
		if (!(sourceElement instanceof IType) || ((IType)sourceElement).getDeclaringType() != null)
			return false;
		ICompilationUnit cu= ((IType)sourceElement).getCompilationUnit();
		if (cu == null)
			return false;
		IType[] types= cu.getAllTypes();
		if (types.length < 1)
			return false;
		ISourceRange range= types[0].getSourceRange();
		if (range == null)
			return false;
		return pos < range.getOffset() || isInside(pos, cu.getSourceRange());
	}
	
	private boolean isInside(int pos, ISourceRange range) {
		if (range == null)
			return false;
		int offset= range.getOffset();
		return offset <= pos && pos < offset + range.getLength();
	}
}