org.apache.fontbox.encoding.getNameFromCharacter always throws exception
------------------------------------------------------------------------

                 Key: PDFBOX-714
                 URL: https://issues.apache.org/jira/browse/PDFBOX-714
             Project: PDFBox
          Issue Type: Improvement
          Components: FontBox
    Affects Versions: 1.1.0
            Reporter: [email protected]
            Priority: Minor


Findbugs reported an incorrect type conversion from a char to an object, upon 
further investigation 

This method references a private variable, CHARACTER_TO_NAME.
This private HashMap is never set by anyone, therefore this method will always 
have a name == null and always throw an exception.
The class is only extended in 1 place, and that place makes no attempt to 
override this method.

This method should be deleted from the class.


   public String getNameFromCharacter( char c ) throws IOException
    {
        String name = CHARACTER_TO_NAME.get( c );
        if( name == null )
        {
            throw new IOException( "No name for character '" + c + "'" );
        }
        return name;
    }

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

Reply via email to