-
Notifications
You must be signed in to change notification settings - Fork 918
Closed
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)hintskind:bugBug report or fixBug report or fix
Milestone
Description
Apache NetBeans version
Apache NetBeans 28
What happened
The hint to add an import for a static method is not offered inside record classes.
Language / Project Type / NetBeans Component
Java, Hints
How to reproduce
Example:
record Example(String name)
{
Example { Objects.requireNonNull(name); }
void f() { System.currentTimeMillis(); }
}=> No static-import hint is offered for requireNonNull() and currentTimeMillis().
Compare to the case of a regular class:
class Example
{
Example(String name) { Objects.requireNonNull(name); }
void f() { System.currentTimeMillis(); }
}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
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)hintskind:bugBug report or fixBug report or fix