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 243423 - Unnecessary boxing to Integer in generated JSpinner code
Summary: Unnecessary boxing to Integer in generated JSpinner code
Status: RESOLVED DUPLICATE of bug 254218
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.0
Hardware: PC Windows 8 x64
: P3 normal with 2 votes (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 01:20 UTC by dacunur
Modified: 2015-09-11 16:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dacunur 2014-04-01 01:20:43 UTC
When you add a jSpinner via the GUI form builder and set the Model to "Number" with type "Integer" something along the following lines is created by netbeans:

spNumber.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(0), null, Integer.valueOf(1)));

The cast to integer throws a warning message "Unnecessary boxing to Integer".

However if you define a "minimum value" and "maximum value", the code being generated seems to be correct:

spNumber.setModel(new javax.swing.SpinnerNumberModel(1, 0, 99999, 1));

If either "minimum value" or "maximum value" is not set, improper code is produced.
Comment 1 Tomas Pavek 2015-09-11 16:19:56 UTC
Actually fixed as bug 254218.

*** This bug has been marked as a duplicate of bug 254218 ***