You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privatestaticfinalint[] TEST = newint[0];
// and methodpublicint[] test() {
returnTEST;
}
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
publicclassTest {
privatestaticfinalint[] TEST = newint[0];
// private static final int[] TEST = new int[] {};publicstaticint[] getTest() {
returnTEST;
}
}
Activity