Community
Participate
Working Groups
200412210800: Bindings unlike the java model currently provide only a method to retrieve the modifiers of the resolved object, which are limited to the ones listed in class org.eclipse.jdt.core.dom.Modifier. The information whether a variable binding resolves to an enum constant or to a field declared in an enum therefore cannot be retrieved from the binding. Surprisingly, the corresponding java element has this information when asked for its flags (see class org.eclipse.jdt.core.Flags and constant AccEnum). For consistency, bindings should offer at least as much information in this case.
The specific request for IVariableBinding#isEnumConstant() has been provided in bug 82216. Keeping this PR open as a general request for all flags.
Not sure what flags are missing. Please reopen when you have more info.
The following flags are available on ..jdt.core.Flags, but not from IBinding#getModifiers(): AccInterface AccSuper AccSynthetic AccDeprecated AccBridge AccVarargs AccEnum AccAnnotation Interface, Synthetic, Deprecated, Varargs, Enum, and Annotation flags can currently be obtained from IBindings via other queries, but Super and Bridge are currently inaccessible from bindings. Super is not really interesting, but seeing whether a method is Bridge could be interesting at some time. Since IBinding#getModifiers() can't supply the non-modifier flags without breaking API, the only missing information is IMethodBinding#isBridge(). Low priority for me.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.