Bug 8043 - [Tasks] Tasks filtered incorrectly for java elements
Summary: [Tasks] Tasks filtered incorrectly for java elements
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 31784 62229 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-22 16:22 EST by Cagatay Kavukcuoglu CLA
Modified: 2009-08-30 02:11 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cagatay Kavukcuoglu CLA 2002-01-22 16:22:50 EST
From platform-ui mailing list:

I think I also came upon a bug(?) in the task list and/or the JDT
extension to it. The filtering function uses DEPTH_INFINITE to find all
tasks for a resource and its children. For Java packages, this means all
packages "under the hierarchy" are included in the marker search as
well. This is not the right thing since there isn't a hierarchical
relationship between packages in Java. It comes about only because a
folder hierarchy is used to represent packages. You can test this out,
for instance, by setting up Apache log4j as an Eclipse project. After
you make a breaking change in org.apache.log4j.Category class, you can
see all the errors in all org.apache.log4j.* packages when you select
org.apache.log4j package.

It seems there are two alternatives to fix this as far as I can see.
Provide another resource filtering option that will use
Iresource.DEPTH_ONE to search for markers, or extend the
ITaskListResourceAdapter interface to ask the adapter the maximum depth
a marker search for the given resource can go.
Comment 1 Nick Edgar CLA 2002-01-22 17:02:19 EST
Moving to JDT for comment.
Comment 2 Erich Gamma CLA 2002-01-23 08:27:43 EST
Given the current support the JDT cannot help to improve this. JDT gets only 
involved when mapping the selected Java element in the packages view to a 
resource, the recursive travsal is done by the Task list. To fix this the JDT 
would also need a way to control the traversal. One option would be a custom 
adapter interface with methods to retrieve the makers for children.

Moving back to Platform UI

Comment 3 Nick Edgar CLA 2002-01-23 15:21:20 EST
I recently proposed having an IMarkerProvider adapter on the selected element 
which had a method IMarker[] getMarkers(boolean includeChildren).
This would address this case, but would not support more general filters (such 
as the one Cagatay added for all markers in project).
One option would be to ask the filter first, then it would get the markers from 
the appropriate place.
For example,
  - the default filter (all tasks in workspace) would just query the workspace 
root for all markers with depth infinity
  - the "On Selected Resource" filter would check for an IMarkerProvider and 
pass false for includeChildren.  It would fall back on the current IResource 
adapter approach if no IMarkerProvider.
  - the "On Selected Resource Including Children" filter would be the same as 
previous but with includeChildren==true.
  - the "On Same Project" filter would determine the current project of the 
element (also using the IResource adapter approach)

Would also need isAffectedBy(IMarkerDelta).
Also, it would help to know the topmost resource the marker provider cares 
about, as an optimization (could ignore all other marker deltas if only looking 
at those for a single file, without having to test each marker delta).

Comment 4 Erich Gamma CLA 2002-01-24 06:47:37 EST
I'm still in favor of the IMarkerProvider proposal. It is a step forward to 
remove an IResource dependency in the UI. It would be straightforward for JDT 
to leverage the new support. 

There already is an ITaskListResourceAdapter could this additional hierarchy 
traversal protocol and isAffected be folded into this interface?
Comment 5 Nick Edgar CLA 2002-01-24 10:58:11 EST
An IMarkerProvider (or ITaskListMarkerProvider) would replace 
ITaskListResourceAdapter, which is still too resource-centric.
Still need to sort out how to divide filtering responsibilities for the other 
items in the filters dialog (marker types, attribute filters).
Comment 6 Nick Edgar CLA 2003-02-20 14:28:24 EST
Bug 25274 and bug 32293 address the logical-to-physical problem for java 
packages.

The ITaskListMarkerProvider approach would still be useful to handle elements 
that are at a finer granularity than the file, e.g. Java methods.
Comment 7 Stefan Xenos CLA 2004-08-25 14:42:57 EDT
*** Bug 31784 has been marked as a duplicate of this bug. ***
Comment 8 Stefan Xenos CLA 2004-08-25 14:57:04 EDT
*** Bug 62229 has been marked as a duplicate of this bug. ***
Comment 9 Tod Creasey CLA 2006-04-07 10:05:34 EDT
I think this is no longer an issue.
Comment 10 Denis Roy CLA 2009-08-30 02:11:14 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.