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:29:59 UTC

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

ClassCastException in COSDictionaryMap 
---------------------------------------

                 Key: PDFBOX-404
                 URL: https://issues.apache.org/jira/browse/PDFBOX-404
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
         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.


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

Posted by "Peter_Lenahan@ibi.com (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

       Resolution: Fixed
    Fix Version/s: 0.8.0-incubator

I've provided a patch. The issue is solved with version 737322

Thanks Peter.

> 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
>             Fix For: 0.8.0-incubator
>
>
> 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.