Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 36232

Summary: binding do not fully consider working copies
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 3.0 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Adam Kiezun CLA 2003-04-08 13:45:31 EDT
(i asked on the mailing list but received no answer so i will treat it as a bug)

I have a cu on disk - the cu looks like this:
class A{}
it has a corresponding shared working copy

then i create 2 working copies:
the first exists only in memory and has no corresponding cu on disk
interface I{}

and seconds one (this is _not_ the shared working copy - this one should shadow 
the shared working copy)
class A implements I{}

The problem is, that when I call resolveBinding() on A in the second
working copy i get a binding with no superinterfaces.
Comment 1 Philipe Mulet CLA 2003-04-11 03:01:01 EDT
Agreed. The unit where the resolve action is initiated should take precedence.
Shared working copies are triggered in resolution slightly too early.
Comment 2 Philipe Mulet CLA 2003-04-16 08:20:26 EDT
Ignore my previous comment, I misunderstood the problem.

Resolution of non local names only searches in existing units, as opposed to 
working copies (shared or not). What you are requesting instead is a mechanism 
for providing a set of working copies to override these existing units.

This isn't currently planned.
Comment 3 Adam Kiezun CLA 2003-04-16 08:27:56 EDT
this is not good since it stops me from implementing important functionality
i will try to come with a workaround and if i am not able to i will ask for 
reconsideration
Comment 4 Jerome Lanneluc CLA 2003-06-16 09:25:11 EDT
Reopening to consider with the work on closing the gap between cus and working 
copies.
Comment 5 Jerome Lanneluc CLA 2003-06-27 06:02:22 EDT
Added APIs to take a working copy owner (that now defines how working copies 
are shared) into argument:
- AST.parseCompilationUnit(char[] source, String unitName, IJavaProject 
project, WorkingCopyOwner owner)
- AST.parseCompilationUnit(IClassFile classFile, boolean resolveBindings, 
WorkingCopyOwner owner)
- AST.parseCompilationUnit(ICompilationUnit unit, boolean resolveBindings, 
WorkingCopyOwner owner)

These APIs do the resolution considering the working copies of the given owner 
first.
Comment 6 David Audel CLA 2003-07-16 04:51:11 EDT
Verified.