This is a security hole in java:
// Potential security hole!
static public final Thing[] VALUES = { ... };
A general solution can be
private static final String[] VALUES = { "a", "b" };
public static final String[] values()
{
return VALUES.clone();
}
I thought that a cloned array still allows modifying the internal values, why this is considered an accepted solution?