Open ThrawnCA opened 6 years ago
I'm inclined to switch off the SonarQube rule, or at least greatly turn down the severity. The standard clone
implementation has some gotchas, but that doesn't make it useless.
Kryo's clone is fast and reliable, you might prefer it over JDK clone.
I think we'd prefer not to add dependencies, since SpotBugs should be compatible with as many projects and systems as possible. Thanks for the suggestion, though.
I don't like clone()
that is slow and outdated. I think copy constructor is enough and intuitive. If we can add dependency, Kryo or protocol buffers would be nice.
Currently, the project contains contradictory information about cloning.
Interfaces like
StatelessDetector
show a clear intent to support standard Javaclone
, but the SpotBugsBot logs a Blocker-level problem whenclone
is actually used.Should we be converting all
StatelessDetector
implementations to use alternatives toclone
? Or should we switch off that SonarQube rule and supportclone
fully?