I ran FindBugs on my project and I received the following warning:
new foo.pkg.Key(Client, Product, Date, String) may expose internal representation by storing an externally mutable object into Key.expireDate MALICIOUS_CODE EI_EXPOSE_REP2 60 Medium
Keyis an Entity that has Date expireDate, with its corresponding getter and setter, and it uses them in the constructor.
So what happened? Why is this wrong? Is it because Date is a mutable type?
In fact, I just return (Date) dataNascimento.clone()and use the same strategy in the installer. Is this the best way to do this?
source
share