Bug 96926 [quick fix] Change method return type quick fix gives invalid proposal for wildcard types
Against I20050527-0010: Code: void a() { ArrayList<? extends Number> b = null; return b.get(0); } Ask for a quick fix on the compile error. Three things happen: 1) BAD: The quick fix is entitled "Change method return type to '? extends Number'". 2) GOOD: The correct return type, Number, is shown originally. 3) BAD: However, the top completion proposal, and the one chosen if the user simply hits return, is "? extends Number", which creates a compile error.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewCUCompletionUsingWizardProposal.java
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.util.PixelConverter;
import org.eclipse.jdt.internal.ui.wizards.NewAnnotationCreationWizard;
import org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard;
import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
import org.eclipse.jdt.internal.ui.wizards.NewEnumCreationWizard;
import org.eclipse.jdt.internal.ui.wizards.NewInterfaceCreationWizard;
/**
 * This proposal is listed in the corrections list for a "type not found" problem.
 * It offers to create a new type by running the class/interface wizard.
 * If selected, this proposal will open a {@link NewClassCreationWizard},
 * {@link NewInterfaceCreationWizard}, {@link NewEnumCreationWizard} or {@link NewAnnotationCreationWizard}.
 *
 * @see UnresolvedElementsSubProcessor#getTypeProposals(IInvocationContext, IProblemLocation, Collection)
 */
public class NewCUCompletionUsingWizardProposal extends ChangeCorrectionProposal {
	public static final int K_CLASS= 1;
	public static final int K_INTERFACE= 2;
	public static final int K_ENUM= 3;
	public static final int K_ANNOTATION= 4;
	private Name fNode;
	private ICompilationUnit fCompilationUnit;
	private int fTypeKind;
	private IJavaElement fTypeContainer; 
	private boolean fShowDialog;
	public NewCUCompletionUsingWizardProposal(ICompilationUnit cu, Name node, int typeKind, IJavaElement typeContainer, int severity) {
		super("", null, severity, null); 
		fCompilationUnit= cu;
		fNode= node;
		fTypeKind= typeKind;