Bug 48293 - [DCR] IJavaElement should implement ISchedulingRule
Summary: [DCR] IJavaElement should implement ISchedulingRule
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-08 12:44 EST by Dirk Baeumer CLA
Modified: 2004-02-12 13:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2003-12-08 12:44:11 EST
I20031203

Now that we use jobs more often and can use IResources for fine grained 
looking we have the need to use IJavaElement as scheduling rules as well 
(especially in the upcoming refactoring processor/participant work).
Comment 1 Philipe Mulet CLA 2004-01-08 10:37:14 EST
Dirk - the best we could do is to provide a #getSchedulingRule() API on 
IJavaElement. We cannot simply have IJavaElement implement ISchedulingRule as 
it would not combine nicely with IResource implementation.

Would this work for you still ? Alternatively, you could simply use #getResource
() in most cases.
Comment 2 Dirk Baeumer CLA 2004-01-08 11:41:01 EST
This would work for me as well. However I don't fully understand why this is 
easier for you given that getSchedulingRule doesn't return null.
Comment 3 Jerome Lanneluc CLA 2004-01-08 11:48:05 EST
It is easier because we don't control the IResource's implementation of 
ISchedulingRule. This implementation doesn't know about IJavaElement and thus 
would return false to contains(...) when the Java element is really contained 
in a resource.

Thus the implementation of getSchedulingRule() will return an IResource in most 
cases (we will handle special cases where the element doesn't have a resource)
Comment 4 Jerome Lanneluc CLA 2004-01-08 12:31:36 EST
Added IJavaElement.getSchedulingRule() and added regression test 
JavaModelTests.getSchedulingRule1() to getSchedulingRule4()
Comment 5 David Audel CLA 2004-02-12 13:04:18 EST
Verified for 3.0M7