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.
Summary: | Unnecessary boxing in generated JSpinner code | ||
---|---|---|---|
Product: | guibuilder | Reporter: | Foolfire |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dacunur |
Priority: | P3 | ||
Version: | 8.0.2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Foolfire
2015-08-09 00:27:41 UTC
I'm using NetBeans 8.0.2 with latest updates for developing projects on Java. I would like to report some kind of workaround. When I'm doing any changes with any component of the form @ design editor, for any JSpinner component on the form the following code will be automatically generated: "<JSpinner's identifier>.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));" Code editor then will show warning hint "Unnecessary boxing to Integer" for this string of the code. If I will replace "Integer.ValueOf(0)" with just 0 and save changes, code will remain unchanged until next changes on the form @ design editor, when code with "Integer.valueOf(0)" will be automatically generated and replaced back once again. spinner model in "model" property editor was set as property using: Spinner Model Editor Model Type = Number Number Type = Integer Initial Value = 0 Minimum = 0 //checked Maximum = 0 //uncheked Step Size = 1 Integrated into 'main-silver', will be available in build *201509100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3c519a7f3583 User: Tomas Pavek <tpavek@netbeans.org> Log: #254218: if either minumum or maximum spinner value is null, we can rely on autoboxing in generated code *** Bug 243423 has been marked as a duplicate of this bug. *** |