You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2020/04/14 05:07:00 UTC

[jira] [Commented] (TIKA-3091) java.lang.NullPointerException when calling hashCode after instantiating PDFParserConfig

    [ https://issues.apache.org/jira/browse/TIKA-3091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17082835#comment-17082835 ] 

Tilman Hausherr commented on TIKA-3091:
---------------------------------------

Ouch.
Two ways to solve this:
- check for null in equals() and hashcode()
or
- initialize with default values. Maybe add static public constants in PDFBox and use these? Current code there:

{code:java}
    private float spacingTolerance = .5f;
    private float averageCharTolerance = .3f;
{code}



> java.lang.NullPointerException when calling hashCode after instantiating PDFParserConfig
> ----------------------------------------------------------------------------------------
>
>                 Key: TIKA-3091
>                 URL: https://issues.apache.org/jira/browse/TIKA-3091
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.24
>            Reporter: Eduardo Guimarães
>            Priority: Major
>
> _averageCharTolerance_ and _spacingTolerance_ are null after instantiating PDFParserConfig
> that can cause NullPointerException when calling hashCode. 
> {code:java}
> PDFParserConfig pdfParserConfig = new PDFParserConfig();
> pdfParserConfig.hashCode();
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)