Bug 78688 [1.5] [Generics] Erroneous quick fix results generated for this code. [quick fix]
I had this code which needs fixing where marked. % cat Test.java import java.util.LinkedHashMap; public class Test<K, V> { public void check() { final LinkedHashMap<K, V> data = new LinkedHashMap<K, V>(); final Integer x = data.entrySet(); // this line needs fixing. } } <<<< So I did Ctrl-1 to get the quickfix and selected "Change type of 'x' to 'Set<Map.Entry<K,V>>'" - this gives a drop down of choices .. Set<Map.Entry<K,V>> Collection<Map.Entry<K,V>> Iterable<Map.Entry<K,V>> So I choose Iterable<Map.Entry<K,V>> but notice the code is inserted incorrectly -- I get final Iterable<Entry<K,V x = data.entrySet(); // this line needs fixing. ^^^^^ missing terminating >>
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeChangeCompletionProposal.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.ui.text.correction;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.*;
import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider;
public class TypeChangeCompletionProposal extends LinkedCorrectionProposal {