Hi,

I just noticed while checking the problems around the ExternalParsers that the 
TIKA's build no longer runs the forbidden-apis Maven plugin, so we got a few 
new violation especially regarding the toUpper/LowerCase(). In fact the 
following commit broke this:

Revision: 1624185
Author: mattmann
Date: Donnerstag, 11. September 2014 05:11:19
Message:
surround in plugin management to resolve 
http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
----
Modified : /tika/trunk/tika-parent/pom.xml

Since that change, the plugin is no longer run by default. I have no idea, why 
this is like this, but in fact this broke some of the globally defined check 
tasks. I have no idea how to reenable it easily.
So I cannot help, but reverting that commit restores behavior. What is the 
reason for this commit, there is not even an issue about that. I think it seems 
to be a workaround for some Eclipse issue, but in fact this disables the whole 
plugins. To reenable forbidden-apis you have to now explicitely enable it in 
every module (because pluginManagement just gives the config of a plugin, where 
without that it also enables its execution.

In addition, there is already version 1.7 of forbiddenapis, so you can replace 
1.6.1 of forbidden-apis with version 1.7 (which fixes a few bugs with Java 8 
and Java 9).

The following new violations were found -> and in fact those broke code in 
turkish locale:
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tika core 1.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- forbiddenapis:1.7:testCheck (default) @ tika-core ---
[INFO] Scanning for classes to check...
[INFO] Reading bundled API signatures: jdk-unsafe
[INFO] Reading bundled API signatures: jdk-deprecated
[INFO] Loading classes to check...
[INFO] Scanning for API signatures and dependencies...
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:79)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:80)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:88)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:133)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:176)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:221)
[ERROR] Forbidden method invocation: java.lang.String#toLowerCase() [Uses 
default locale]
[ERROR]   in org.apache.tika.sax.BasicContentHandlerFactoryTest 
(BasicContentHandlerFactoryTest.java:273)
[ERROR] Scanned 52 (and 331 related) class file(s) for forbidden API 
invocations (in 0.16s), 7 error(s).
[INFO] ------------------------------------------------------------------------
[...]
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tika parsers 1.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- forbiddenapis:1.7:check (default-cli) @ tika-parsers ---
[INFO] Scanning for classes to check...
[INFO] Reading bundled API signatures: jdk-unsafe
[INFO] Reading bundled API signatures: jdk-deprecated
[INFO] Loading classes to check...
[INFO] Scanning for API signatures and dependencies...
[ERROR] Forbidden method invocation: 
java.io.InputStreamReader#<init>(java.io.InputStream) [Uses default charset]
[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRParser$2 
(TesseractOCRParser.java:309)
[ERROR] Forbidden method invocation: java.lang.String#<init>(byte[],int,int) 
[Uses default charset]
[ERROR]   in org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet 
(ChmDirectoryListingSet.java:240)
[ERROR] Forbidden method invocation: 
java.text.SimpleDateFormat#<init>(java.lang.String) [Uses default locale]
[ERROR]   in org.apache.tika.parser.image.ImageMetadataExtractor$ExifHandler$1 
(ImageMetadataExtractor.java:304)
[ERROR] Forbidden method invocation: 
java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default 
locale]
[ERROR]   in org.apache.tika.parser.ocr.TesseractOCRConfig 
(TesseractOCRConfig.java:214)
[ERROR] Scanned 281 (and 813 related) class file(s) for forbidden API 
invocations (in 0.38s), 4 error(s).

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


Reply via email to