https://issues.apache.org/bugzilla/show_bug.cgi?id=49754

           Summary: [PATCH] Bring clone() in line with the recommendations
                    in Object.clone()
           Product: Fop
           Version: 1.1dev
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: spepp...@apache.org


Created an attachment (id=25892)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25892)
patch

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.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to