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 204043 - Show descriptions for hints to explain why the change might be helpful
Summary: Show descriptions for hints to explain why the change might be helpful
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2011-10-20 23:04 UTC by tomwheeler
Modified: 2014-09-02 10:38 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description tomwheeler 2011-10-20 23:04:11 UTC
NetBeans Java editor does some static analysis of the code one writes in the IDE via the "hints" feature.  This is a very helpful way to catch problems early, when the cost of fixing them is very low.  I would like to suggest a way in which this could further be improved.

In addition to showing a hint that explains what change is possible, it would be even better to also show a brief description of why that change might be necessary.  For example:

1.  Create a class Foo in the IDE

2.  Add a private static boolean variable "isExample" to the Foo class.

3.  Add a static initializer block which attempts to modify isExample

4.  You will see an available hint "Usage of static non-final variable during initialization" 

At this point, you see that there may be a problem with your code but aren't informed why using a static non-final variable during initialization might be a problem or what bad effects it could have.  

As it turns out, you can click the "Configure static non-final variable during initialization" item for the hint to bring up the Options dialog to the appropriate section.  At that point you can see the description "Using static non-final variables can be dangerous in the initialization code because their values may depend on the order of initialization statements."

However, what would be better IMHO is if the hint popup showed this description, perhaps similar to how Javadoc is shown in a popup within the IDE.
Comment 1 ophers 2014-09-02 10:38:38 UTC
I'd like to second this request.
Incidentally this is the exact hint that got me Google-ing for its meaning.