Project: JDT
Bug 78688 [1.5] [Generics] Erroneous quick fix results generated for this code. [quick fix]
Reported: 2004-11-15 22:05:09 | Status: resolved fixed

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 >>

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ImportsStructure.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeChangeCompletionProposal.java