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

John Hewson closed PDFBOX-714.
------------------------------
    Resolution: Won't Fix

This no longer applies to the trunk.

> 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 was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to