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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@apache.org

     [ 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.15)
                   1.16

> 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.16
>
>
> 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
(v7.6.3#76005)