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() );

                }

 

Peter Lenahan

Reply via email to