I have a Java gettor method that looks like the following:
import java.util.Date; //... public Date getSomeDate() { return someDate; }
an
No,we need to clone that object using below code :
public Date getSomeDate() { return new Date(someDate.getTime()).clone(); }
I just realized that Findbugs analyzes compiled code (.class files), not source code. After rebuilding and re-running Findbugs, the problem went away.
.class