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 210699

Summary: No way to find all occurrences of a fixless hint
Product: java Reporter: Jesse Glick <jglick>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: normal Keywords: USABILITY
Priority: P4    
Version: 7.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Jesse Glick 2012-04-04 13:14:06 UTC
Suppose you have recently changed the element (or key) type on a collection in your (large) program. You have noticed a few places where the old element type is still in use in contravariant positions, because the editor displays a warning in those files, but you do not have time to open every single class in the program looking for this warning, and the Action Items window does not show them.

The obvious approach is to use Inspect & Transform. Assuming you can find the right hint in the long list - its name does not mention "collection", and there is an open RFE to do launch I&T with this hint as a pseudo-fix - and you run Refactor, you are just left with the error message

---%<---
The following warnings and errors were found. You can continue only with warnings.

List of Errors:

No fix for: Suspicious call to java.util.Map.get:
Given object cannot contain instances of String (expected URI) at Uses.java:14.
---%<---

So the warnings are listed in this dialog, but not in a usable way; clicking Preview just claims to find "no patterns".

Even when there is no automated fix for a warning, I expect to be able to get a dockable window of the Search Results type listing known occurrences with some manner of hyperlink, so that I can quickly navigate through potential problems and fix them (or @SuppressWarnings).
Comment 1 Jan Lahoda 2012-04-04 13:29:40 UTC
There of course is a way to do that in NB7.2: use Source/Inspect. There are a couple things broken around I&T, some of which I am going to fix by using this bug's number.

Also, no need to look for the warning in the combo, if you don't know which exact warning you are looking for: use the Browse button. The dialog also provides the "Search" function, and typing "Collection" will make it easy to find the warning (tested in I&T). This functionality is not working in Source/Inspect in the current dev builds, but fix is on the way under bug #210087.

Adding a subfix to find all similar warnings (and apply fixes to all similar warnings, if available) is definitely on the list, but there is *much* more on the list than what could possibly be done in foreseeable future, so no guarantees on when that will be implemented.
Comment 2 Jesse Glick 2012-04-04 18:28:56 UTC
(In reply to comment #1)
> There of course is a way to do that in NB7.2: use Source/Inspect.

Confirmed that Source > Inspect works for this use case. So could the I&T dialog gently point you in that direction when given a hint with no fixes?

> no need to look for the warning in the combo, if you don't know which
> exact warning you are looking for: use the Browse button.

Yes, I did this. Was looking for the text of the hint instance (as in status bar), which was not easily visible; needed to look for the title of hint instead.

> The dialog also provides the "Search" function

Good, did not see that.
Comment 3 markiewb 2013-07-03 21:38:41 UTC
(In reply to comment #1)
> 
> Adding a subfix to find all similar warnings (and apply fixes to all similar
> warnings, if available) is definitely on the list, but there is *much* more on
> the list than what could possibly be done in foreseeable future, so no
> guarantees on when that will be implemented.

For the record: This part is fixed in 7.3
http://wiki.netbeans.org/NewAndNoteworthyNB73#Run_inspections.26transform_for_wider_scope_from_fixable_hint_in_editor
Comment 4 Martin Balin 2016-07-07 07:15:28 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss