Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4025738

NumberFormatException displays garbage characters

XMLWordPrintable

    • 1.1fcs
    • generic
    • generic
    • Not verified

       
      masayoshi.okutsu@Eng 1997-01-14
      java.lang.NumberFormatException displays garbage characters.

      When valueOf() method's parameter is given in Japanese (2 byted code),
      NumberFormatException outputs an unreadable message or "??.??" (on
      Solaris).

      To reproduce the problem, execute the following test program.

      public class lang_17{
         public static void main(String aa[]){
            String s = "1.2" ;
            String s2 = "ú.ú‚" ;
            double d1 = 1.2d ;
            try{
               Double d = new Double(s).valueOf(s) ;
               if(d.doubleValue() != d1)
                  System.out.println("*** NG ***") ;
               Double d2 = new Double(s2).valueOf(s2) ;
               if(d2.doubleValue() == d1)
                  System.out.println("*** NG ***") ;
            }catch(Exception e){
               System.out.println(e) ;
            }
            System.out.println("*** OK ***") ;
         }
      }

            sliangsunw Sheng Liang (Inactive)
            okutsu Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: