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.
So we switched to Java 7 and I've been busy getting rid of all these [unchecked] warnings. One area I got a lot of warnings on was JComboBox which is generic. Getting warnings on matisse-geneared (and therefore readonly) JComboBoxes was a bit alarming until I discovered the TypeParameters property in the Property editor under Code. I eventually got it to work but I have a coupla comments ... 1) It turns out the TypeParameters property requires that you enter the parameters surrounded with <>'s. If you enter just "XXX" you'll end up with a javax.swing.JComboBoxXXX in the code and it won't compile. Perhaps there should be some validation or automatic adding of <>'s? 2) The TypeParameters property is used to create two pieces of code. A declaration: private javax.swing.JComboBox<ColorValue> foregroundComboBox; and an instantiation: foregroundComboBox = new javax.swing.JComboBox<ColorValue>(); The problem is that the instantiation is going to give you the "use diamond operator" hint so you won't get to have squeaky-clean code.
ad 1) Let's keep bug 237573 for this request. ad 2) The diamond should be generated automatically when on Java 8 (source level at least 1.8).
Correction, diamonds are used since 1.7.
I can not confirm diamonds on JDK7 and NetBeans 8. - Create a new JavaSE Project - Add a new "JFrame Form" - Drag a ComboBox from Palette to the Editor In the source code there are no diamonds used and the "use diamond operator"-hint shows for the creation of the JComboBox and also for the setModel() default implementation.
I'm using NetBeans Dev Build 201507200001, and I can still confirm this bug. The instantiation in the generated initComponents doesn't use diamond operator, which leads to the warning "redundant type arguments in new expression (use diamond operator instead)."
"redundant type arguments 223998 *** This bug has been marked as a duplicate of bug 223998 ***