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 06:33:59 UTC

[jira] Updated: (PDFBOX-404) ClassCastException in COSDictionaryMap

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

Peter_Lenahan@ibi.com updated PDFBOX-404:
-----------------------------------------

    Affects Version/s: 0.8.0-incubator

> ClassCastException in COSDictionaryMap 
> ---------------------------------------
>
>                 Key: PDFBOX-404
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-404
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 0.8.0-incubator
>         Environment: All
>            Reporter: Peter_Lenahan@ibi.com
>
> The Findbugs tool reported this as an issue, 
> I don't have a reproduction of the case, but it is easy to see why it reported the issue.
> Just take a look at the code, it was probably a cut and paste typo that happened when the code was written.
> This is a very easy thing to fix.
> Thanks,
> Peter
> Impossible cast 
> This cast will always throw a ClassCastException. 
> In this method, there is a small issue that is easy to resolve.
> package org.apache.pdfbox.pdmodel.common;
>  
> public static COSDictionaryMap convertBasicTypesToMap( COSDictionary map) throws IOException  
>  
> else if( cosObj instanceof COSFloat )
>                 {
>                     actualObject = new Float(((COSInteger)cosObj).floatValue() );
>                 }
> Perhaps you meant to code it like this with a cast to COSFloat.
>   else if( cosObj instanceof COSFloat )
>                 {
>                     actualObject = new Float(((COSFloat)cosObj).floatValue() );
>                 }

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