You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Peter_Lenahan@ibi.com (JIRA)" <ji...@apache.org> on 2009/01/24 20:41:59 UTC
[jira] Updated: (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 ]
Peter_Lenahan@ibi.com updated PDFBOX-407:
-----------------------------------------
Component/s: PDModel
> 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
>
> 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.