You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/10/11 03:21:34 UTC

[jira] [Closed] (PDFBOX-714) org.apache.fontbox.encoding.getNameFromCharacter always throws exception

     [ 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: Peter_Lenahan@ibi.com
>            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)