You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the work in eclipse-jdt/eclipse.jdt.core#2074 got me thinking that we might see some improvement in corner cases for references given that we use that helper method when looking up references in classfiles that must be decompiled (eg. using a JDK with no sources).
if (element.getElementName().equals(node.getName().getIdentifier())) {
if (elementinstanceofIMethodmethod) {
String[] parameters = method.getParameterTypes();
List<?> astParameters = node.typeArguments();
if (parameters.length == astParameters.size()) {
intsize = astParameters.size();
String[] astParameterTypes = newString[size];
Iterator<?> iterator = astParameters.iterator();
for (inti = 0; i < size; i++) {
Typeparameter = (Type) iterator.next();
astParameterTypes[i] = getSignature(parameter);
}
if (equals(parameters, astParameterTypes)) {
nodes[0] = node;
returnfalse;
}
}
}
}
We're taking the method parameter types from an IMethod, but we're comparing them to the type arguments from the method invocation node, which is something completely different (it's for parameterized types). This seems like a typo. I think what was meant was to take the parameters() of the method invocation node and resolve the type binding of each individual parameter, and then compare it to the parameter types. Either way, this part of the code could use a closer look.
The text was updated successfully, but these errors were encountered:
Looking at the work in eclipse-jdt/eclipse.jdt.core#2074 got me thinking that we might see some improvement in corner cases for references given that we use that helper method when looking up references in classfiles that must be decompiled (eg. using a JDK with no sources).
On top of that, the part of the code that visits method invocations seems strange :
eclipse.jdt.ls/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java
Lines 525 to 545 in 27a1a1e
We're taking the method parameter types from an
IMethod
, but we're comparing them to the type arguments from the method invocation node, which is something completely different (it's for parameterized types). This seems like a typo. I think what was meant was to take theparameters()
of the method invocation node and resolve the type binding of each individual parameter, and then compare it to the parameter types. Either way, this part of the code could use a closer look.The text was updated successfully, but these errors were encountered: