Pārlūkot izejas kodu

Merge -r 607324:607325 from trunk to branch-0.15. Fixes HADOOP-2456

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/branches/branch-0.15@607326 13f79535-47bb-0310-9956-ffa450edef68
Nigel Daley 17 gadi atpakaļ
vecāks
revīzija
5762a11d20
2 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 4 0
      CHANGES.txt
  2. 7 1
      src/java/org/apache/hadoop/fs/FsShell.java

+ 4 - 0
CHANGES.txt

@@ -43,6 +43,10 @@ Branch 0.15 (unreleased)
     for merging, this patch will ensure that only those files whose checksums
     have also got created (renamed) are returned. (ddas)
 
+    HADOOP-2456. Hardcode English locale to prevent NumberFormatException
+    from occurring when starting the NameNode with certain locales.
+    (Matthias Friedrich via nigel)
+
   IMPROVEMENTS
 
     HADOOP-2160.  Remove project-level, non-user documentation from

+ 7 - 1
src/java/org/apache/hadoop/fs/FsShell.java

@@ -20,6 +20,7 @@ package org.apache.hadoop.fs;
 import java.io.File;
 import java.io.IOException;
 import java.text.DecimalFormat;
+import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -45,7 +46,12 @@ public class FsShell extends Configured implements Tool {
   }
   static final String SETREP_SHORT_USAGE="-setrep [-R] [-w] <rep> <path/file>";
   static final String TAIL_USAGE="-tail [-f] <file>";
-  private static final DecimalFormat decimalFormat = new DecimalFormat("#.##");
+  private static final DecimalFormat decimalFormat;
+  static {
+	  NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.ENGLISH);
+	  decimalFormat = (DecimalFormat) numberFormat;
+	  decimalFormat.applyPattern("#.##");
+  }
 
   /**
    */