Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 256450 - Builder could report unused API problem filters
Summary: Builder could report unused API problem filters
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.5   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 244676 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-25 10:41 EST by Michael Rennie CLA
Modified: 2009-02-03 12:21 EST (History)
3 users (show)

See Also:
Michael_Rennie: review+


Attachments
work in progress (11.50 KB, patch)
2008-12-01 17:01 EST, Michael Rennie CLA
no flags Details | Diff
patch (105.42 KB, patch)
2008-12-03 17:14 EST, Michael Rennie CLA
no flags Details | Diff
icon (621 bytes, image/gif)
2008-12-03 17:16 EST, Michael Rennie CLA
no flags Details
Proposed fix (5.91 KB, patch)
2009-02-03 11:14 EST, Olivier Thomann CLA
Olivier_Thomann: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2008-11-25 10:41:56 EST
With code always changing, it could happen that API problem filters become stale. This could also happen due to changes in the filters themselves. 

In our current world we just leave the filters there and it is the responsibility of the user to clean them up. We could do better. We could hook into our builder and report when a filter is no longer used. 

The detection should:

1. work with a full and incremental build
2. create a problem marker on the resource (maybe the project?) the filter used to apply to
3. offer a quick-fix to remove the filter and / or open the property page
Comment 1 Michael Rennie CLA 2008-12-01 17:01:31 EST
Created attachment 119211 [details]
work in progress

adds in new problem ids, type and ui elements. Still need to finish adding a hook to the filter store to ask for unused filters
Comment 2 Darin Wright CLA 2008-12-03 13:31:18 EST
*** Bug 244676 has been marked as a duplicate of this bug. ***
Comment 3 Michael Rennie CLA 2008-12-03 17:14:48 EST
Created attachment 119437 [details]
patch

This patch allows the API builder to report about stale API problem filters an includes regression tests. Stale filters are detected in a full and incremental build, and have two quick fixes available (1) remove the filter (2) open the filters property page. 

Problems for stale filters are reported on the compilation unit the filter used to apply to.
Comment 4 Michael Rennie CLA 2008-12-03 17:16:41 EST
Created attachment 119438 [details]
icon

icon for the the 'open property page' quick-fix. to be placed in o.e.p.api.tools.ui/icons/full/elcl/
Comment 5 Michael Rennie CLA 2008-12-04 12:20:00 EST
released to HEAD, please verify Olivier.
Comment 6 Olivier Thomann CLA 2009-02-03 09:50:39 EST
I only see one quickfix for unused filter. I cannot directly remove the filter. I can only open the property page.
Comment 7 Michael Rennie CLA 2009-02-03 10:52:20 EST
Th problem is that the hash code is not matching when we are trying to resolve  if the problem selected for the quick fix and the underlying problem in the filter match. This is happening because a ',' is used as a delimiter in the filter handle, which also appears in a listing of method arguments in the handle: so we incorrectly end up splitting the string to recompute the hash code (thanks for finding this Olivier).
Comment 8 Olivier Thomann CLA 2009-02-03 11:14:28 EST
Created attachment 124557 [details]
Proposed fix

This patch is splitting the filter handle on ',' without also splitting the message arguments that can also contain ','.
Michael, please review.
Comment 9 Michael Rennie CLA 2009-02-03 12:20:34 EST
applied patch, remarking as fixed
Comment 10 Michael Rennie CLA 2009-02-03 12:21:54 EST
verified