You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Nick Burch (JIRA)" <ji...@apache.org> on 2015/09/24 19:01:04 UTC

[jira] [Resolved] (TIKA-1750) CachedTranslator.isAvailable() throws NPE when underlying translator is null

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

Nick Burch resolved TIKA-1750.
------------------------------
    Resolution: Fixed

Thanks for this, fixed in r1705107.

> CachedTranslator.isAvailable() throws NPE when underlying translator is null
> ----------------------------------------------------------------------------
>
>                 Key: TIKA-1750
>                 URL: https://issues.apache.org/jira/browse/TIKA-1750
>             Project: Tika
>          Issue Type: Bug
>          Components: translation
>            Reporter: Yaniv Kunda
>            Priority: Minor
>             Fix For: 1.11
>
>         Attachments: TIKA-1750.patch
>
>
> When initialized with no underlying translator, CachedTranslator throws NPE when calling isAvailable(), although a user should initialize the translator (as it says in the default constructor's javadoc), it doesn't always happen and since CachedTranslator is defined as a registered service in tika-translate\src\main\resources\META-INF\services\org.apache.tika.language.translate.Translator, it normally doesn't (causing DumpTikaConfigExampleTest to fail).
> Since CachedTranslator is returning the source text when calling translate(String, String, String) when the translator is null, it makes sense that isAvailable returns false under the same condition.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)