Bug 81105 [quick fix] Change field to method: does not appear when non-accessible field exists
I20041214-2000 import java.util.HashMap; public class A { { int s= new HashMap().size; // No suggestion int s2= new HashMap().siz; // OK } }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java
private static String getVisibilityString(int code) {
		if (Modifier.isPublic(code)) {
			return "public"; 
		} else if (Modifier.isProtected(code)) {
			return "protected"; 
		} else if (Modifier.isPrivate(code)) {
			return "private"; 
		}
		return CorrectionMessages.ModifierCorrectionSubProcessor_default;
	}
	private static int getNeededVisibility(ASTNode currNode, ITypeBinding targetType) {
		ITypeBinding currNodeBinding= Bindings.getBindingOfParentType(currNode);
		if (currNodeBinding == null) { 
			return Modifier.PUBLIC;
		}
		if (Bindings.isSuperType(targetType, currNodeBinding)) {
			return Modifier.PROTECTED;
		}
		if (currNodeBinding.getPackage().getKey().equals(targetType.getPackage().getKey())) {
			return 0;
		}
		return Modifier.PUBLIC;
	}
	public static void addAbstractMethodProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) {
		ICompilationUnit cu= context.getCompilationUnit();
		CompilationUnit astRoot= context.getASTRoot();
		ASTNode selectedNode= problem.getCoveringNode(astRoot);
		if (selectedNode == null) {
			return;
		}