Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] correct usage of WorkingCopyOwner

You got the basic idea, what you did should just have worked. In term, in
order to grab a default buffer implementation, our abstract owner
implementation should do exactly what you did as a workaround.
Jerome is currently writing some tests for this new functionality, we will
add one for your scenario.



|---------+------------------------------>
|         |           "Adam Kiezun"      |
|         |           <adam.kiezun@xxxxxx|
|         |           t>                 |
|         |           Sent by:           |
|         |           jdt-core-dev-admin@|
|         |           eclipse.org        |
|         |                              |
|         |                              |
|         |           07/01/2003 06:29 PM|
|         |           Please respond to  |
|         |           jdt-core-dev       |
|         |                              |
|---------+------------------------------>
  >----------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                  |
  |       To:       <jdt-core-dev@xxxxxxxxxxx>                                                                                       |
  |       cc:                                                                                                                        |
  |       Subject:  [jdt-core-dev] correct usage of WorkingCopyOwner                                                                 |
  |                                                                                                                                  |
  >----------------------------------------------------------------------------------------------------------------------------------|




Hi all,

I'd like to utilize the new functionality provided by the AST
(see https://bugs.eclipse.org/bugs/show_bug.cgi?id=36232)

And I'm unsure how to use the WorkingCopyOwner class.
What I'd like to achieve is that binding resolution considers working
copies that I created and that have no backing in java files.

This is probably very bogus but here's what I did:
- i subclasses WorkingCopyOwner and because there were no other examples
provided I called
return BufferManager.getDefaultBufferManager().createBuffer(workingCopy);
in the create buffer method
(BufferManager is internal, I know, but like I said, I found no other
examples)

- I used that 'owner' to create the new working copies, using:
ICompilationUnit:getWorkingCopy(WorkingCopyOwner, IProblemRequestor,
IProgressMonitor)
i passed null as requestor

- I also used the same owner instance to create ASTs
(AST.parseCompilationUnit(ICompilationUnit, true, owner))


Then, I started resolving bindings but, sadly, the new working copies were
not considered.
I probably did something very bogus - please bounce me in the right
direction.

Thanks
a.

ps. my concrete example:
A.java (exists on disk)
class A{}

A.java (working copy created using the owner)
class A implements I{}

I.java (working copy existing only in memory - created using the owner)
interface I{}

resolve type binding of A (from the working copy) and look at supertypes -
I is not there

_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-core-dev







Back to the top