This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
possible runtime class intialization error
- From: Martin Aliger <martin_aliger at email dot cz>
- To: <java at gcc dot gnu dot org>
- Date: Tue, 12 Nov 2002 07:57:53 +0100 (CET)
- Subject: possible runtime class intialization error
- Reply-to: <martin_aliger at email dot cz>
Hi folks,
I maybe found bug in gcj runtime (or compile output) but I'm not sure about it due it's mystical behaviour.
I'm douing this:
----
[alik@explorer gg]$ gcj --main=org.apache.poi.poifs.dev.POIFSViewer `cat list`
[alik@explorer gg]$ ./a.out abc.doc
.-------.
|abc.doc|
.-------.
POIFS const 0
POIFS const 1 0
POIFS const 2 109
getBatArray: cnt=109
[I@80c2e00
------
when using Sun HotSpot Java 1.4 instead:
------
[alik@explorer gg]$ javac `cat list`
[alik@explorer gg]$ java org/apache/poi/poifs/dev/POIFSViewer abc.doc
.-------.
|abc.doc|
.-------.
POIFS const 0
POIFS const 1 109
POIFS const 2 109
getBatArray: cnt=109
[I@5224ee
------
Note the deference in "const 1" line...
I think it must be problem in class init, becouse of that 109 is static final int constant... But when I try to isolate this, it automagically correct and function properlly!?!
Code is using very strange (for me as language purist) constuct of interface consisting only of static constants and classes implementing such interface. I'll write POI team about this constuct, but there is no reason to omit this in gcj
Sorry again for little longer sources but I was unable to isolate it further ;-(
Thanks in forward,
Martin
______________________________________________________________________________
Email.cz -----> Vaše emailová schránka zdarma.
http://www.Email.cz <------------Pošta zdarma!