Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Bindings fail after moving from JLS 11 to JLS 21

Hello,
We have been using Eclipse JDT for parsing and binding resolution for Java programs. 

We were previously using JLS11, and have moved to JLS 21 recently.

While we see the improvement in parsing otherwise, some improved Java features are not supported. 

For example, we are previously able to resolve the binding for this
Pair<String, Integer> entry = new Pair<>("A", 1);

But after the update, we are not able to resolve the binding anymore. We get null for the binding.

Note, if we change the above code to this, we get the binding again.

Pair<String, Integer> entry = new Pair<String, Integer>("A", 1);
Here is how we are calling this.

ITypeBinding instantiatedClassBinding = classInstanceCreation.resolveTypeBinding();

We also get null for the resolveMethodBinding() call.

This (no parameter in a constructor for a parameterized type) is an improved feature of Java that is pretty common. It will be great if the binding is supported for such cases.

Do we need to change anything to get the correct binding? 

Dr. Munawar Hafiz
Founder and CEO,
OpenRefactory, Inc.,


Back to the top