You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Sebastian Nagel (Jira)" <ji...@apache.org> on 2019/09/26 16:24:00 UTC

[jira] [Updated] (NUTCH-1807) avoid methods relying on system-specific default locale / charset

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

Sebastian Nagel updated NUTCH-1807:
-----------------------------------
    Fix Version/s:     (was: 1.16)
                   1.17

> avoid methods relying on system-specific default locale / charset
> -----------------------------------------------------------------
>
>                 Key: NUTCH-1807
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1807
>             Project: Nutch
>          Issue Type: Bug
>    Affects Versions: 1.8, 2.2.1
>            Reporter: Sebastian Nagel
>            Priority: Minor
>             Fix For: 1.17
>
>
> 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|http://blog.thetaphi.de/2012/07/default-locales-default-charsets-and.html], and discussions in NUTCH-1693 and NUTCH-1554.
> A search with the [forbidden-apis client|https://code.google.com/p/forbidden-apis/wiki/CliUsage] shows 120 calls of such methods in trunk (without test classes):
> {code}
> # 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
> {code}
> It is also possible to [integrate the check into the ant build|https://code.google.com/p/forbidden-apis/wiki/AntUsage] (to avoid that "forbidden" calls slip into the code again).



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