--- a/JavaClassPointerRef.st Mon Jun 07 17:23:52 1999 +0000
+++ b/JavaClassPointerRef.st Mon Jun 07 17:24:08 1999 +0000
@@ -56,6 +56,15 @@
^ class
"Created: 25.6.1996 / 09:36:09 / cg"
+!
+
+javaClassForNew
+ class isUnresolved ifTrue:[
+ self halt.
+ ].
+ ^ self
+
+ "Created: 25.6.1996 / 09:36:09 / cg"
! !
!JavaClassPointerRef methodsFor:'converting'!
@@ -87,5 +96,5 @@
!JavaClassPointerRef class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassPointerRef.st,v 1.7 1998/11/16 15:16:49 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassPointerRef.st,v 1.8 1999/06/07 17:23:59 cg Exp $'
! !
--- a/JavaUnresolvedClassConstant.st Mon Jun 07 17:23:52 1999 +0000
+++ b/JavaUnresolvedClassConstant.st Mon Jun 07 17:24:08 1999 +0000
@@ -256,21 +256,7 @@
^ cls
].
- (fullName startsWith:$[) ifTrue:[
- "/ a ref for newarray or new
-
- nm := JavaMethod retvalSpecFromStream:(ReadStream on:fullName) in:nil.
- [nm endsWith:'[]'] whileTrue:[
- nm := nm copyWithoutLast:2
- ].
-
- cls := Java classNamed:nm.
- cls notNil ifTrue:[
- ref := JavaClassPointerRef class:cls nameandType:fullName.
- constantPool at:constantPoolIndex put:ref.
- ^ ref
- ].
-
+ fullName size == 2 ifTrue:[
"/ look for specials like byte[], int[] etc.
"/ there are only a few of them - forgive me nameing them here ...
fullName = '[B' ifTrue:[ "/ byte[]
@@ -314,6 +300,83 @@
constantPool at:constantPoolIndex put:ref.
^ ref
].
+ ].
+
+ (fullName startsWith:$[) ifTrue:[
+ "/ a ref for newarray or new
+
+ s := fullName readStream.
+ [s peek == $[ ] whileTrue:[
+ s next
+ ].
+ nm := s upToEnd.
+
+ (nm startsWith:$L) ifFalse:[
+ nm = 'F' ifTrue:[ "/ float[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ nm = 'D' ifTrue:[ "/ double[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ nm = 'I' ifTrue:[ "/ int[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ nm = 'C' ifTrue:[ "/ char[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ nm = 'B' ifTrue:[ "/ byte[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ nm = 'Z' ifTrue:[ "/ bool[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ nm = 'S' ifTrue:[ "/ short[][]
+ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+ self halt.
+ ].
+ nm := nm copyFrom:2.
+ (nm endsWith:$;) ifFalse:[
+ self halt.
+ ].
+ nm := nm copyWithoutLast:1.
+
+ cls := Java classNamed:nm.
+ cls notNil ifTrue:[
+ ref := JavaClassPointerRef class:cls nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+self halt.
+ self rememberForResolveWith:nm.
+ ^ self.
+
+ nm := JavaMethod retvalSpecFromStream:(ReadStream on:fullName) in:nil.
+ [nm endsWith:'[]'] whileTrue:[
+ nm := nm copyWithoutLast:2
+ ].
+
+ cls := Java classNamed:nm.
+ cls notNil ifTrue:[
+ ref := JavaClassPointerRef class:cls nameandType:fullName.
+ constantPool at:constantPoolIndex put:ref.
+ ^ ref
+ ].
+
(fullName startsWith:'[[') ifTrue:[
fullName = '[[F' ifTrue:[ "/ float[][]
ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
@@ -371,5 +434,5 @@
!JavaUnresolvedClassConstant class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedClassConstant.st,v 1.39 1999/06/07 09:51:21 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedClassConstant.st,v 1.40 1999/06/07 17:24:08 cg Exp $'
! !