Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-1807

avoid methods relying on system-specific default locale / charset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.8, 2.2.1
    • 1.21
    • 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

          Activity

            People

              Unassigned Unassigned
              snagel Sebastian Nagel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: