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 165111 - [67cat] Fix undocumented behaviour for hints in guarded sections
Summary: [67cat] Fix undocumented behaviour for hints in guarded sections
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2009-05-13 21:05 UTC by misterm
Modified: 2013-09-02 14:21 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 misterm 2009-05-13 21:06:03 UTC
There is an unspecified behaviour in the way hints work today that should be changed. It's implemented in HintsTask.

Currently, hints are not invoked in a guarded section. It is a good default, as guarded sections shouldn't be changed 
directly by hints, but there are valid use cases for evaluating a hint in a guarded section.

First, one might have written a specialized hint that knows what to do to fix errors in a guarded section - changing 
the .form file for Matisse, for instance, or applying the fix correctly in a editor-generated BeanInfo file. 

Also a hint might be displayed next to the element it refers, but the fix will actually change code somewhere else - in 
the same file or even in a related file.

It's possible to work around these limitations by writing a hint that runs on COMPILATION_UNIT, but it's a hack and 
makes hints analyze files that don't actually contain the trees they are interested in.

Therefore, an annotation, marker interface or separate layer folder should be made available, since most hints 
shouldn't run on guarded blocks, but there must be a valid way for the ones who need to do so to state that.
Comment 1 Max Sauer 2009-05-19 14:09:39 UTC
Yes, I also think that cooperation with guarded sections can be improved.