I have a member variable
private ArrayList<CalendarableItem>[] resourceColumns = null;
and getter for the same
public ArrayList<CalendarableItem>[] getResourceColumns()
{
return resourceColumns;
}
I am seeing findbugs for above getter method. Malicious code vulnerability : EI: Method returning array may expose internal representation
I found that I have to do a deep copy of array object to remove this error Malicious code vulnerability - May expose internal representation by incorporating reference to mutable object
I dont want to do clone of this object due to performance issue. Do we have any other better solution.