Bug#478886: libgcj9-0: incomplete implementation of printf()/format()
Package: libgcj9-0
Version: 4.3.0-1
Severity: important
the gnu classpath libraries cannot handle %f in format strings:
$ cat test.java
public class test {
public static void main (String[] args) {
System.out.printf("%09.3f%n",3.1415926535);
}
}
$ cat test2.java
public class test2 {
public static void main (String[] args) {
System.out.printf("%9.3f%n",3.1415926535);
}
}
$ gcj -C -g -O test.java
$ gcj -C -g -O test2.java
$ gij --version
java version "1.5.0"
gij (GNU libgcj) version 4.3.1 20080309 (prerelease)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gij test
Exception in thread "main" java.lang.NumberFormatException: invalid character at position 2 in 09
at java.lang.Integer.parseInt(libgcj.so.90)
at java.lang.Integer.decode(libgcj.so.90)
at java.util.Formatter.parseInt(libgcj.so.90)
at java.util.Formatter.parseArgumentIndex(libgcj.so.90)
at java.util.Formatter.format(libgcj.so.90)
at java.util.Formatter.format(libgcj.so.90)
at java.io.PrintStream.format(libgcj.so.90)
at java.io.PrintStream.format(libgcj.so.90)
at java.io.PrintStream.printf(libgcj.so.90)
at test.main(test.java:4)
$ gij test2
$ scp test.class [host]:
Enter passphrase for key '[x]':
test.class 100% 639 0.6KB/s 00:00
$ scp test2.class [host]:
Enter passphrase for key '[x]':
test2.class 100% 639 0.6KB/s 00:00
$ ssh [host]
Enter passphrase for key '[x]':
$ java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)
$ java test
00003.142
$ java test2
3.142
$ exit
logout
Connection to [host] closed.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libgcj9-0 depends on:
ii gcj-4.3-base 4.3.0-1 The GNU Compiler Collection (gcj b
ii libasound2 1.0.16-2 ALSA library
ii libc6 2.7-10 GNU C Library: Shared libraries
ii libgcc1 1:4.3.0-3 GCC support library
ii libgcj-common 1:4.3-1 Java runtime library (common files
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
Versions of packages libgcj9-0 recommends:
ii libgcj9-0-awt 4.3.0-1 AWT peer runtime libraries for use
ii libgcj9-jar 4.3.0-1 Java runtime library for use with
-- no debconf information
Reply to: