I have a java class:
class MyObj{
private Timestamp myDate;
public Timestamp getMyDate(){
return mydate;
}
...
}
when I check it by Findbugs, it says:
Bug kind and pattern: EI - EI_EXPOSE_REP May expose internal representation by returning reference to mutable object
so, what is the better way to write the getter for Date and Timestamp types in Java?