nmatt opened a new issue, #9159:
URL: https://github.com/apache/netbeans/issues/9159

   ### Apache NetBeans version
   
   Apache NetBeans 28
   
   ### What happened
   
   Assign Return Value To New Variable in some cases yields code that doesn't 
compile due to type errors. See the example below.
   
   ### Language / Project Type / NetBeans Component
   
   _No response_
   
   ### How to reproduce
   
   Example:
   ```java
   List<? extends CharSequence> list = Collections.emptyList();
   list.stream().collect(Collectors.groupingBy(CharSequence::toString));
   ```
   Performing "Assign Return Value To New Variable" on the collect() call 
results in:
   ```java
   Map<String, List<? extends CharSequence>> collect = 
list.stream().collect(Collectors.groupingBy(CharSequence::toString));
   ```
   However, this is incorrect and doesn't compile.
   
   A correct result would be:
   ```java
   Map<String, ? extends List<? extends CharSequence>> collect = 
list.stream().collect(Collectors.groupingBy(CharSequence::toString));
   ```
   Maybe wildcard captures aren't considered correctly.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows
   
   ### JDK
   
   NetBeans runs on JDK 21, the project is JDK 17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


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