jherkel opened a new issue, #9753:
URL: https://github.com/apache/netbeans/issues/9753
### Apache NetBeans version
Apache NetBeans 32 latest release candidate
### What happened
If there is a field declaration
private static final int[] TEST = new int[0];
and method
public int[] test() {
return TEST;
}
I can see "Return of Array field" hint.
However, for a final variable with zero length (often used as a static
constant), it is questionable whether this is truly a problem. This field is
thread-safe and, for all practical purposes, behaves like an immutable object
(except, of course, that it can be synchronized)."
I have a patch for this if we want to fix it...
### Language / Project Type / NetBeans Component
Java
### How to reproduce
public class Test {
private static final int[] TEST = new int[0];
// private static final int[] TEST = new int[] {};
public static int[] getTest() {
return TEST;
}
}
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Fedora Silverblue 44
### JDK
openjdk 27
### Apache NetBeans packaging
Other
### Anything else
_No response_
### Are you willing to submit a pull request?
Yes
--
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