@Nullable
public String[] getX() {
return x;
}
public void setX(@Nullable final String[] x) {
this.x= x;
}
The above code gives a PMD Security warning - " Security - Method returns internal array : Returning 'x' may expose an internal array for getter and similar one for setter.
One way to fix this is .clone() the array. Since these are nullable, i'll have to do a null check. Do we have a way to do this using google's guava library?
Thanks