You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2009/07/12 18:15:14 UTC

[jira] Resolved: (PDFBOX-407) PDLineDashPattern missing call to super.clone()

     [ https://issues.apache.org/jira/browse/PDFBOX-407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-407.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.8.0-incubator

I've added Peter's suggestions with version 793370. Thanks Peter for your hint

> PDLineDashPattern missing call to super.clone()
> -----------------------------------------------
>
>                 Key: PDFBOX-407
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-407
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 0.8.0-incubator
>         Environment: All
>            Reporter: Peter_Lenahan@ibi.com
>             Fix For: 0.8.0-incubator
>
>
> PDLineDashPattern should be declared as a final class or in the clone method you should call super.clone()
> If another class sub-classed PDLineDashPattern, then a call to the clone method would return the incorrect type of the parent class and not the child class.
> A simple solution is to add a call to super.clone() as the first line in the clone method
>    public Object clone()
>     {
>         super.clone() ; // add this line to resolve the issue.
>         COSArray dash = getCOSDashPattern();
>         COSArray copy = new COSArray();
>         copy.addAll(dash);
>         PDLineDashPattern pattern = new PDLineDashPattern(copy,getPhaseStart() );
>         return pattern;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.