Bug 36481 Quickfix (create method) generates wrong parameter type if same name exists in other package [quick fix]
given two types with same name, package a; public class A { } package b; public class A { public void doSomething(a.A obj) { newMethod(obj); // this should be quickfixed } } the generated method has the signature private void newMethod(A obj), but should have private void newMethod(a.A obj). I admit this to be not the classic style, we experience this behaviour, because we are generating lots of code and all the generated code goes to one directory, making calls to handwritten code with the same type name (by convention) in other packages.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AssignToVariableAssistProposal.java
assignment.setRightHandSide((Expression) rewrite.createCopy(expression));
		rewrite.markAsReplaced(expression, assignment, "ID"); 
		
		decls.add(findInsertIndex(decls, fExpressionStatement.getStartPosition()), newDecl);
		
		addImport(fTypeBinding);
		rewrite.markAsInserted(newDecl);
		return rewrite;		
	}
	
	private String suggestLocalVariableNames(ITypeBinding binding) {
		IJavaProject project= getCompilationUnit().getJavaProject();
		ITypeBinding base= binding.isArray() ? binding.getElementType() : binding;
		IPackageBinding packBinding= base.getPackage();
		String packName= packBinding != null ? packBinding.getName() : ""; 
		
		String[] excludedNames= new String[0];
		String typeName= base.getName();
		String[] names= NamingConventions.suggestLocalVariableNames(project, packName, typeName, binding.getDimensions(), excludedNames);
		if (names.length == 0) {
			return "class1"; 
		}
		return names[0]; 
	}
	
	private String suggestFieldNames(ITypeBinding binding) {
		IJavaProject project= getCompilationUnit().getJavaProject();
		ITypeBinding base= binding.isArray() ? binding.getElementType() : binding;
		IPackageBinding packBinding= base.getPackage();
		String packName= packBinding != null ? packBinding.getName() : "";