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

   ### Apache NetBeans version
   
   Apache NetBeans 28
   
   ### What happened
   
   In a new-expression with diamond operator (`<>`) for a generic class, like 
`new Example<>`, code completion to select between constructors works before 
the diamond operator, but not after it; the popup shows "No suggestions". 
Strangely, it does work for classes like ArrayList from the JDK. It does not 
work for in-project classes, or for other dependencies, like for example 
JAXBElement in javax/jakarta.xml.bind.
   
   ### Language / Project Type / NetBeans Component
   
   Java, Editor
   
   ### How to reproduce
   
   In a Java project, add the following class:
   ```java
   public class Example<T> {
       public Example(T value) { }
       public Example(String name, T value) { }
   }
   ```
   Anywhere in the project, in an expression/statement context, enter the 
partial expression `new Example<>`. Add an import for the class if necessary.
   Invoke code completion before the `<>` => the popup shows both constructors, 
and `Example<T>` as a third entry.
   Invoke code completion after the `<>` => the popup shows "No suggestions".
   
   Add the JAXB API as a dependency and try the same for `new JAXBElement<>` => 
same result.
   
   Do the same for (java.util) `new ArrayList<>` => code completion shows all 
three constructors both before and after the diamond operator.
   
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows
   
   ### JDK
   
   JDK 21
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   When adding type parameters, i.e. not using the diamond operator, code 
completion does work after type-argument list, as in `new Example<String>`.
   
   ### 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