Apache NetBeans version
Apache NetBeans 29
What happened
Since Java 9, the constructor calls for a parameterized anonymous class can use the diamond operator instead of repeating the type arguments. However, NetBeans code completion still inserts the type arguments.
Language / Project Type / NetBeans Component
Java
How to reproduce
Example:
abstract class Example<T>
{
abstract T foo();
static
{
Example<ThreadLocal<StackTraceElement>> example = new Example
}
}
Invoking code completion results in unnecessarily repeating the type argument:
Example<ThreadLocal<StackTraceElement>> example = new Example<ThreadLocal<StackTraceElement>>() {
...
};
Expected result for source level ≥ 9:
Example<ThreadLocal<StackTraceElement>> example = new Example<>() {
...
};
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows
JDK
21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No
Apache NetBeans version
Apache NetBeans 29
What happened
Since Java 9, the constructor calls for a parameterized anonymous class can use the diamond operator instead of repeating the type arguments. However, NetBeans code completion still inserts the type arguments.
Language / Project Type / NetBeans Component
Java
How to reproduce
Example:
Invoking code completion results in unnecessarily repeating the type argument:
Expected result for source level ≥ 9:
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows
JDK
21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No