Bug 98341 Override/Implement Methods shows nonvisible methods.
The Override/Implement Methods refactoring dialog shows all methods with package-private access, even if they are in other packages. Example: package foo; public class Foo { void method() {} } package bar; public class Bar extends foo.Foo { } Activating the Override/Implement Methods on Bar shows Foo.method.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java
}
	private CompilationUnit fUnit= null;
	public OverrideMethodDialog(Shell shell, CompilationUnitEditor editor, IType type, boolean isSubType) throws JavaModelException {
		super(shell, new BindingLabelProvider(), new OverrideMethodContentProvider(), editor, type, false);
		RefactoringASTParser parser= new RefactoringASTParser(AST.JLS3);
		fUnit= parser.parse(type.getCompilationUnit(), true);
		ITypeBinding binding= null;
		if (type.isAnonymous()) {
			final IJavaElement parent= type.getParent();
			if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) {
				final EnumConstantDeclaration constant= (EnumConstantDeclaration) NodeFinder.perform(fUnit, ((ISourceReference) parent).getSourceRange());
				if (constant != null) {
					final AnonymousClassDeclaration declaration= constant.getAnonymousClassDeclaration();
					if (declaration != null)
						binding= declaration.resolveBinding();
				}
			} else {
				final ClassInstanceCreation creation= (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(fUnit, type.getNameRange()), ClassInstanceCreation.class);
				if (creation != null)
					binding= creation.resolveTypeBinding();
			}
		} else {
			final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(fUnit, type.getNameRange()), AbstractTypeDeclaration.class);
			if (declaration != null)
				binding= declaration.resolveBinding();
		}
		List toImplement= new ArrayList();
		IMethodBinding[] overridable= null;
		if (binding != null)
			overridable= StubUtility2.getOverridableMethods(fUnit.getAST(), binding, false);