Re: MessageBundle ???

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
>> at position 1 g$ò< ...
>>
>>
>> 2)
>> This other test is not working with both the versions.
>>
>> class Test {
>>
>>    public static void main(String argv[]) {
>>
>>        System.out.printf("%09.3f%n",3.1415926535);
>>    }
>> }
>>
>> -------------> gives a: Exception in thread "main"
>> java.lang.NumberFormatException: invalid character at position 2 in 09
> 
> That's just a bug: leading zeroes in format fields aren't being handled
> correctly.  The "09" is being parsed as an octal number because it begins
> with a zero.

The fix for the exception is

Index: Formatter.java
===================================================================
--- Formatter.java	(revision 171834)
+++ Formatter.java	(working copy)
@@ -1188,7 +1188,7 @@
       advance();
     if (start == index)
       return -1;
-    return Integer.decode(format.substring(start, index));
+    return Integer.parseInt(format.substring(start, index));
   }

   /**

BUT:

I just had a look, and as far as I can tell floating-point formatted
conversion has never been implemented in gcj.  Sorry.

Andrew.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.