Bug 59832 Bindings.findMethodDefininition(binding) finds wrong definition
I20040422 0800 1) Enabled annotation roll-overs 2) Create the following type: package p1; public class A { void doit() { } } 3) Create a subclass in a different package: package p2; import p1.A; public class B extends A { void doit() { // } } I get two roll-overs in the editor next to B.doit: - "The method B.doit() does not override the inherited method from A since it is private to a different package" - "overrides P1.A.doit" These statements contradict eath other.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java
}
		
		ITypeBinding declaringType= overridden.getDeclaringClass();
		ICompilationUnit targetCu= cu;
		if (declaringType != null && declaringType.isFromSource()) {
			targetCu= ASTResolving.findCompilationUnitForBinding(cu, astRoot, declaringType);
		}
		if (targetCu != null) {
			ChangeDescription[] changes= new ChangeDescription[definedExceptions.length + undeclaredExceptions.size()];
			
			for (int i= 0; i < undeclaredExceptions.size(); i++) {
				changes[i + definedExceptions.length]= new InsertDescription((ITypeBinding) undeclaredExceptions.get(i), ""); 
			}
			String[] args= {  declaringType.getName(), overridden.getName() };
			String label= CorrectionMessages.getFormattedString("TypeMismatchSubProcessor.addexceptions.description", args); 
			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_ADD);
			proposals.add(new ChangeMethodSignatureProposal(label, targetCu, astRoot, overridden, null, changes, 7, image));
		}
	}
	
	private static boolean isDeclaredException(ITypeBinding curr, ITypeBinding[] declared) {
		for (int i= 0; i < declared.length; i++) {
			if (Bindings.isSuperType(declared[i], curr)) {
				return true;
			}
		}
		return false;
	}
}