Bug 33831 - ast API: add FieldAccess.resolveFieldBinding
Summary: ast API: add FieldAccess.resolveFieldBinding
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2003-03-05 08:38 EST by Adam Kiezun CLA
Modified: 2003-06-05 09:44 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2003-03-05 08:38:23 EST
20030227
similarly to MethodInvocation.resolveMethodBinding
and ContrucotorInvocation.resolveConstructorBinding

we should have FieldAccess.resolveFieldBinding
Comment 1 Olivier Thomann CLA 2003-03-05 11:42:36 EST
I will add it.
Comment 2 Olivier Thomann CLA 2003-03-05 11:59:41 EST
Don't you have a workaround using the fieldAccess.getName().resolveBinding()?
Comment 3 Olivier Thomann CLA 2003-03-05 14:34:32 EST
I checked that fieldAccess beging a field access node, the following code allows
you to get the binding:
Name name = fieldAccess.getName();
IBinding binding = name.resolveBinding();
if (binding != null && IBinding.VARIABLE == binding.getKind()) {
    IVariableBinding variableBinding = (IVariableBinding) binding;
    .....
}

I agree that to be consistent this method resolveVariableBinding() rather than
resolveFieldBinding() should be added on FieldAccess and SuperFieldAccess.

Defer for post 2.1.
Comment 4 Adam Kiezun CLA 2003-03-06 05:14:40 EST
no probs, post 2.2 is fine
Comment 5 Adam Kiezun CLA 2003-03-06 05:14:59 EST
post 2.1, i meant :)
Comment 6 Philipe Mulet CLA 2003-04-02 06:44:03 EST
reopen
Comment 7 Olivier Thomann CLA 2003-04-02 13:43:32 EST
Trivial to add.
Comment 8 Olivier Thomann CLA 2003-04-04 17:04:09 EST
Fixed and released in 2.2 stream.
Regression tests added (updating existing tests to use the new APIs).
Comment 9 David Audel CLA 2003-06-05 09:44:57 EDT
Verified.