...
Non-compliant Code Example
Code Block | ||
---|---|---|
| ||
 public static final SomeType [] SOMETHINGS = { ... };
|
Wiki Markup |
---|
With this declaration, {{SOMETHINGS\[1\]}}, etc. can be modified by clients of the code. |
Code Block | ||
---|---|---|
| ||
 public static final SomeType [] SOMETHINGS = { ... };
|
Compliant Solution
One approach is to make use of above method: first define a private array and then provide a public method that returns a copy of the array:
...