This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ BUILD # : 201112012200 ] [ JDK VERSION : 1.7.1 ] Consider the following class: class MyClass<T> { Map<Map<?, ?>, ?> myMap = new HashMap<Map<?, ?>, Object>(); Set<Map<? super T, ?>> getLists() { return myMap.keySet();| } void assignLists() { Set<Map<? super T, ?>> lists = myMap.keySet();| } } Observed Behaviour Pressing Ctrl-Enter (show hints) at the first carat position shows one hint: "Change method return type to Set>" (note the trailing angle bracket) Invoking the hint changes the first method signature as follows: Set<Map< ?, ?>> getLists() { (note the spaces inside the angle brackets) Pressing Ctrl-Enter (show hints) at the second carat position shows one hint: "Change type of lists to Set<Map<?,?>>" Invoking the hint changes the variable assignment in the second method signature as follows: Set<Map< ?, ?>> lists = myMap.keySet(); (note the spaces inside the angle brackets) Expected Behaviour: The first hint should read something like "Change method return type to Set<Map<?, ?>>" (adding the type argument of Set), and produce the same code but without extra spaces within the angle brackets (i.e. the method signature should be "Set<Map<?, ?>> getLists() {" ). The second hint should produce the same code but without the angle brackets (i.e. the variable assignment should be " Set<Map<?, ?>> lists = myMap.keySet();")
The display name fixed by: http://hg.netbeans.org/jet-main/rev/fbffc200d896 The rest is a bug in the code generator.
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/fbffc200d896 User: Jan Lahoda <jlahoda@netbeans.org> Log: #206052: fix display name must escape '<'.
I tried a recent trunk build, at it seems it is working OK now. There were 10+ changes in the related areas, so presumably some of these fixed this problem as well. Please reopen if it still happens to you. Thanks.