matthiasblaesing opened a new pull request, #6268:
URL: https://github.com/apache/netbeans/pull/6268
Testsetup:
```java
public class TestParamResolution {
public static void main(String[] args) {
List.of("Hallo", "World");
testMethod("Hello", "World", "Test");
testMethod(1, "Hello", "World");
}
public static <S extends String & Comparable<String> & Serializable>
void testMethod(S genericParam, String dummy1_1, String dummy1_2) {}
public static <S extends Integer> void testMethod(S genericParam, String
dummy2_1, String dummy2_2) {}
public static <T extends Integer & Externalizable> void
testArgumentTypeVariableParameter(T genericParam, List<? super String> x) {
testMethod(genericParam, "x", "dfd");
}
}
```
Inside main the problem can be demonstrated with all demonstrated calls.
When the caret is placed in the first argument (before first comma), the
parameter popup (CTRL+P) can be opened for all case. If the caret is placed in
the second argument (after first comma), it does not work anymore.
Investigation shows that `javax.lang.model.util.Types#isAssignable` returns
false if the target type is a TypeVariable. To fix this the upper bound of the
TypeMirror is unwrapped and the check is repeated. This also works if the
argument is a TypeVariable itself.
With this fix applied all places (main and
testArgumentTypeVariableParameter) allow to invoke the parameter popup.
Visualization (none of these were shown before the patch):




--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists