public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/58414] New: String.format("%9d",(Long)null) returns null-pointer exception
@ 2013-09-13 15:45 slatfatf at gmx dot de
0 siblings, 0 replies; only message in thread
From: slatfatf at gmx dot de @ 2013-09-13 15:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58414
Bug ID: 58414
Summary: String.format("%9d",(Long)null) returns null-pointer
exception
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
Assignee: unassigned at gcc dot gnu.org
Reporter: slatfatf at gmx dot de
Created attachment 30817
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30817&action=edit
minimal example
String.format("%9d",(Long)null) returns null pointer exception but it should
return the text " null".
GCJ Returns the following:
$ gcj --version
gcj (Ubuntu/Linaro 4.6.3-1ubuntu2) 4.6.3
$ gcj -c src/BugReport.javajmueller@calculon:~/workspace/gcjTest$ gcj
--main=BugReport -o BugReport BugReport.o
$ ./BugReport
The programm should return:
null 10
but unfortunately it crashes:
Exception in thread "main" java.lang.NullPointerException
at java.util.Formatter.basicIntegralConversion(libgcj.so.12)
at java.util.Formatter.decimalConversion(libgcj.so.12)
at java.util.Formatter.format(libgcj.so.12)
at java.util.Formatter.format(libgcj.so.12)
at java.lang.String.format(libgcj.so.12)
at java.lang.String.format(libgcj.so.12)
at BugReport.main(BugReport)
Whereas OpenJDK returns:
$ /usr/lib/jvm/java-7-openjdk-amd64/bin/java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
$ /usr/lib/jvm/java-7-openjdk-amd64/bin/javac BugReport.java
$ /usr/lib/jvm/java-7-openjdk-amd64/bin/java BugReport
The programm should return:
null 10
but unfortunately it crashes:
null 10
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-13 15:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13 15:45 [Bug libgcj/58414] New: String.format("%9d",(Long)null) returns null-pointer exception slatfatf at gmx dot de
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).