Inspectopedia
 
2024.3

'public static' collection field

Warning
New
Last modified: 03 December 2024

Reports modifiable public static Collection fields.

Even though they are often used to store collections of constant values, these fields nonetheless represent a security hazard, as their contents may be modified even if the field is declared as final.

Example:

Use the table in the Options section to specify methods returning unmodifiable collections. public static collection fields initialized with these methods will not be reported.