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):
   
   
![image](https://github.com/apache/netbeans/assets/2179736/c58ef1b9-c3f3-401c-9740-61bb8950f0d9)
   
![image](https://github.com/apache/netbeans/assets/2179736/440a7dea-0ae9-4fae-b555-4cc0b6c0437c)
   
![image](https://github.com/apache/netbeans/assets/2179736/f1347c4e-1f2e-4c13-b1ce-1642fbc53928)
   
![image](https://github.com/apache/netbeans/assets/2179736/6df5caec-ad30-48a7-a739-5840a6995c7d)
   


-- 
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

Reply via email to