-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> I suggest to clone such data and return the clone instead. >> >> WDYT? >> > This is not so simple. For instance, in the Value class, we returns the > direct internal object for performance reasons. It should be checked > case by case.
I can agree the performance reasons. OTOH it's a 'public' class which may be used by other (third party) projects as well. For these projects we will need to have either a big warning in the javadocs or to implement it in a save way. > > If we consider that the returned value is ok even if it's not a clone, > then we should add a @suppressWarnig with a comment explaining why we > are allowing such a behavior. > > Otherwise, returning a clone is an option, another option being that we > return an Immutable object, ie the interned object should be immutable > (but this is more work). > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvvwCkACgkQ2lZVCB08qHEN4wCgkIcD9v/hJ01z+is5WTgMbEK3 ROwAoJotkDX8difP4XkrZbzWlks1y30j =ee07 -----END PGP SIGNATURE-----
