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 104526 - Support highlighting of auto boxing and unboxing
Summary: Support highlighting of auto boxing and unboxing
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-22 17:01 UTC by _ sandipchitale
Modified: 2016-07-01 18:08 UTC (History)
2 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 _ sandipchitale 2007-05-22 17:01:23 UTC
JDK 5 introduces the auto boxing and unboxing feature. The compiler silently 
applies the boxing and unboxing of primitive types to corresponding object 
types and back in many places (e.g. int->Integer and Integer->int). This helps 
the user many times. However it also introduces strange NPEs at run time while 
auto-unboxing, which puzzles the user completely. It may be that javac must 
warn the user of that possibility at least once in a file. But that is a 
separate enhancement against javac. This and other related issues with auto 
boxing and unboxing were discussed in one of the talks at JavaOne also.

I think with the help of the Java editor infrastructure, it should be possible 
to support a mode in the Java editor to show all the expressions where the 
auto boxing and unboxing is happening. There should be a way to control 
showing/hiding of this highlight. I think we should use a subtle but noticable 
highlight for this.

IMHO this should not be mixed in with the Mark Occurrences mode as someone 
(don't recall who) suggested - as there could be overlaps. Also highlight auto 
boxing/unboxing is not caret sensitive.
Comment 1 _ sandipchitale 2007-11-19 19:24:33 UTC
The Highlight Boxing Unboxing Varargs module
(http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4130) implements this functionality.
Comment 2 stephan_bauer 2014-07-17 07:08:21 UTC
Hi Folks,

the plugin that is referenced from the comment before is experimental and obviously not maintained for NB 7/8.

I really think that this feature should be added to NB asap!

best regards,
Stephan