Details
-
Bug
-
Status: Resolved
-
Resolution: Fixed
-
2.5
-
None
-
None
-
Operating System: All
Platform: All
-
49754
Description
This patch tries to fix the problems with the clone method as reported by findbugs.
The fix is not straightforward. The current design deviates from the design advocated by findbugs and the documentation of Object.clone(). It is sometimes hard to guess the author's intention with the original clone method. Often the clone is not completely deep; was this intentional or not? This patch makes almost always deep copies, esp. in the subclasses of AreaTreeObject. This patch passes all existing junit tests. Since findbugs requires more memory than my machine has, I could not check if this patch removes all findbugs warnings for clone.
How does clone differ from a copy constructor? Is it a bad situation to have both a clone method and a copy constructor? Is it advisable to delete one of them?
Because it is not straightforward, I submit this as a patch, instead of committing it right away.