stefike69 opened a new issue, #9747:
URL: https://github.com/apache/netbeans/issues/9747
### Apache NetBeans version
Apache NetBeans 31
### What happened
In Apache NetBeans 29, an intentionally empty private constructor is marked
as unused:
public class Connect {
@SuppressWarnings("unused")
private Connect() {
}
public static void open() {
}
}
The private constructor deliberately prevents instantiation of a class used
through static methods.
Adding @SuppressWarnings("unused") removes the yellow hint indicator, but
the constructor remains underlined as unused.
Expected behavior: the annotation should suppress the unused-element
underline as well. An empty private constructor together with explicit
suppression clearly indicates intentional non-use.
Disabling unused-element highlighting globally is unsuitable because it
hides useful feedback elsewhere.
Environment: Apache NetBeans 29, JDK 25, Windows.
### Language / Project Type / NetBeans Component
_No response_
### How to reproduce
In Apache NetBeans 29, an intentionally empty private constructor is marked
as unused:
public class Connect {
@SuppressWarnings("unused")
private Connect() {
}
public static void open() {
}
}
The private constructor deliberately prevents instantiation of a class used
through static methods.
Adding @SuppressWarnings("unused") removes the yellow hint indicator, but
the constructor remains underlined as unused.
Expected behavior: the annotation should suppress the unused-element
underline as well. An empty private constructor together with explicit
suppression clearly indicates intentional non-use.
Disabling unused-element highlighting globally is unsuitable because it
hides useful feedback elsewhere.
Environment: Apache NetBeans 29, JDK 25, Windows.
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 10
### JDK
jdk-21.0.11
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
Every times
### 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