Bug 130000

Summary: [API] ReconcileContext API: Does getAST3 return AST with bindings?
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, frederic_fusier, jerome_lanneluc, Olivier_Thomann, srikanth_sankaran
Version: 3.2   
Target Milestone: 3.6 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Proposed fix + regression test none

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.