-
Notifications
You must be signed in to change notification settings - Fork 918
Open
Labels
Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:bugBug report or fixBug report or fixneeds:triageRequires attention from one of the committersRequires attention from one of the committers
Description
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
Java, Hints
How to reproduce
Example:
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:
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:
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:bugBug report or fixBug report or fixneeds:triageRequires attention from one of the committersRequires attention from one of the committers