--- a/JavaClass.st Thu Jun 27 16:30:06 1996 +0000
+++ b/JavaClass.st Thu Jun 27 16:31:19 1996 +0000
@@ -215,9 +215,31 @@
initializeStaticFields
staticFields do:[:f |
- f constantValue notNil ifTrue:[
- self instVarNamed:(f name) put:f constantValue.
- ]
+ |val type|
+
+ (val := f constantValue) isNil ifTrue:[
+ "/ careful: int/long etc. constants must be initialized
+ "/ with correct type.
+ type := f type.
+ type == #long ifTrue:[
+ val := 0.
+ ] ifFalse:[type == #int ifTrue:[
+ val := 0.
+ ] ifFalse:[type == #float ifTrue:[
+ val := 0.0 asShortFloat
+ ] ifFalse:[type == #double ifTrue:[
+ val := 0.0
+ ] ifFalse:[type == #byte ifTrue:[
+ val := 0.
+ ] ifFalse:[type == #char ifTrue:[
+ val := 0.
+ ] ifFalse:[type == #'unsigned short' ifTrue:[
+ val := 0.
+ ] ifFalse:[type == #boolean ifTrue:[
+ val := 0.
+ ]]]]]]]].
+ ].
+ self instVarNamed:(f name) put:val.
].
! !
@@ -679,6 +701,6 @@
!JavaClass class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClass.st,v 1.31 1996/06/27 14:23:57 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClass.st,v 1.32 1996/06/27 16:30:57 cg Exp $'
! !
JavaClass initialize!
--- a/JavaClassReader.st Thu Jun 27 16:30:06 1996 +0000
+++ b/JavaClassReader.st Thu Jun 27 16:31:19 1996 +0000
@@ -1116,9 +1116,9 @@
start_pc := self nextU2.
length := self nextU2.
name_index := self nextU2.
- name := nil.
+ name := constants at:name_index.
sig_index := self nextU2.
- signature := nil.
+ signature := constants at:sig_index.
slot := self nextU2.
local_variable_table at:i put:(JavaLocalVariableTableEntry new
@@ -1230,6 +1230,6 @@
!JavaClassReader class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassReader.st,v 1.27 1996/06/27 14:24:39 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassReader.st,v 1.28 1996/06/27 16:31:19 cg Exp $'
! !
JavaClassReader initialize!