Bug 130000 - [API] ReconcileContext API: Does getAST3 return AST with bindings?
Summary: [API] ReconcileContext API: Does getAST3 return AST with bindings?
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-01 12:54 EST by Martin Aeschlimann CLA
Modified: 2010-01-25 02:13 EST (History)
5 users (show)

See Also:


Attachments
Proposed fix (1.83 KB, patch)
2010-01-06 12:20 EST, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression test (4.04 KB, patch)
2010-01-06 21:30 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2006-03-01 12:54:39 EST
20060301

The spec of ReconcileContext.getAST3 should tell the client if the return AST is one with resolved bindings and if statement recovery is enabled.

Most clients depend on bindings and statement recovery. If they get a AST without that they will have to recreate one, which will lead to bad performance.
Comment 1 Olivier Thomann CLA 2006-10-10 16:52:35 EDT
Rigth now this is not true.
getAST3() doesn't trigger the statement recovery.
This would require a new API for 3.3.
Comment 2 Olivier Thomann CLA 2009-06-25 15:07:02 EDT
org.eclipse.jdt.core.compiler.ReconcileContext.isResolvingBindings() to know if the returned AST has resolved bindings.
A corresponding API could be added to query the ReconcileContext about statement recovery.
Would this be good enough ?
Comment 3 Olivier Thomann CLA 2010-01-05 09:43:03 EST
I'll try to implement comment 2.
Daniel, is this something required for JDT/UI or JDT/Text?
Comment 4 Dani Megert CLA 2010-01-05 12:00:48 EST
>Daniel, is this something required for JDT/UI or JDT/Text?
No, we don't even use that method currently.
Comment 5 Olivier Thomann CLA 2010-01-06 12:17:57 EST
To be consistent we should add the requested API.
Comment 6 Olivier Thomann CLA 2010-01-06 12:20:09 EST
Created attachment 155429 [details]
Proposed fix
Comment 7 Olivier Thomann CLA 2010-01-06 14:53:42 EST
Released for 3.6M5.
Implementation is trivial.
Added regression tests in:
org.eclipse.jdt.core.tests.model.ReconcilerTests#testIgnoreMethodBodies3
org.eclipse.jdt.core.tests.model.ReconcilerTests#testIgnoreMethodBodies4
Comment 8 Olivier Thomann CLA 2010-01-06 21:30:52 EST
Created attachment 155471 [details]
Proposed fix + regression test

I prefer to expose the reconcile flags. This will allow to expose any further bits used by the reconciler. All bits are API so it is not like we expose bits that cannot be checked by the user.
Comment 9 Srikanth Sankaran CLA 2010-01-25 02:13:01 EST
Verified for 3.6M5 by code inspection.