Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Patch
Description
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.