Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.8, 2.2.1
-
None
-
None
Description
Many methods in Java (and libraries) used to convert Strings, Numbers, Dates rely on the system-specific default locale / character set. This may cause strange behaviour and errors impossible to reproduce on other systems, see thetaphi's blog post, and discussions in NUTCH-1693 and NUTCH-1554.
A search with the forbidden-apis client shows 120 calls of such methods in trunk (without test classes):
# compile Nutch before check: all tested class files # are then located in build/ (including plugins) % CLASSPATH=`find build/ -name '*.jar' | tr '\n' ':'` % java -jar forbiddenapis-1.5.1.jar -d build/ -c $CLASSPATH \ -b jdk-unsafe-1.8 -b commons-io-unsafe-2.4
It is also possible to integrate the check into the ant build (to avoid that "forbidden" calls slip into the code again).
Attachments
Issue Links
- relates to
-
NUTCH-2254 Charset issues when using -addBinaryContent and -base64 options
- Closed
-
NUTCH-2815 Add Spotbugs target to build and address detected "bugs"
- Open
- requires
-
NUTCH-2264 Check Forbidden APIs at Build
- Closed