You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "matthiasblaesing (via GitHub)" <gi...@apache.org> on 2023/07/28 21:00:06 UTC
[GitHub] [netbeans] matthiasblaesing opened a new pull request, #6268: Fix: Java completion parameter tooltip is not shown if previous parameter is TypeVariable
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing merged pull request #6268: Fix: Java completion parameter tooltip is not shown if previous parameter is TypeVariable
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing merged PR #6268:
URL: https://github.com/apache/netbeans/pull/6268
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing commented on pull request #6268: Fix: Java completion parameter tooltip is not shown if previous parameter is TypeVariable
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #6268:
URL: https://github.com/apache/netbeans/pull/6268#issuecomment-1675956754
@dbalek thanks for review.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists