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.

Bug 223998 - Custom Extending Type Parameters on component uses redundant type parameters in assignment
Summary: Custom Extending Type Parameters on component uses redundant type parameters ...
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P4 normal with 3 votes (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 228807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-18 21:31 UTC by MrLore
Modified: 2016-01-20 12:25 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MrLore 2012-12-18 21:31:29 UTC
When using custom type parameters for a Component set in Component Properties > Code > Type Parameters, the generated assignment of the component also calls the type rather than using the diamond operator. For example, when creating a JComboBox which I have extended using "<TweekerParameter>", it is created in the generated code blocks as:

private javax.swing.JComboBox<TweekerParameter> parametersList;

Which is then later assigned as:

parametersList = new javax.swing.JComboBox<TweekerParameter>();

Using the "redundant type arguments in new expression (use diamond operator instead)." as my IDE kindly points out. I'm aware that the diamond operator was only introduced in Java 7, and the code generation may be designed to do this to be properly backwards-compatible, however it would be nice if either the generator detects the version and uses the appropriate assignment, or the editor detects that the code block is generated (via the editor-fold tag) and suppresses the code markings for it (dealer's choice ;-) ).
Comment 1 Tomas Pavek 2015-09-10 16:29:45 UTC
*** Bug 228807 has been marked as a duplicate of this bug. ***
Comment 2 bugmenot1 2016-01-20 12:25:05 UTC
Fixed in bug 227943