[ https://issues.apache.org/jira/browse/PDFBOX-404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
peter_lena...@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_lena...@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.