src/JavaFieldRef2.st
branchjk_new_structure
changeset 792 14aa43c34268
parent 791 46666ff1f9b6
child 793 bf00d8585c8e
--- a/src/JavaFieldRef2.st	Sun May 15 20:25:38 2011 +0000
+++ b/src/JavaFieldRef2.st	Sun May 15 20:33:45 2011 +0000
@@ -1,13 +1,22 @@
 "{ Package: 'stx:libjava' }"
 
 JavaClassContentRef2 subclass:#JavaFieldRef2
-	instanceVariableNames:'offset'
-	classVariableNames:''
+	instanceVariableNames:'offset type'
+	classVariableNames:'T_LONG T_DOUBLE'
 	poolDictionaries:''
 	category:'Languages-Java-Reader-Support-new'
 !
 
 
+!JavaFieldRef2 class methodsFor:'initialization'!
+
+initialize
+    T_LONG := 1.
+    T_DOUBLE := 2.
+
+    "Created: / 15-05-2011 / 22:31:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
 !JavaFieldRef2 methodsFor:'accessing'!
 
 isJavaFieldRef
@@ -20,6 +29,14 @@
     ^ offset.
 
     "Created: / 15-05-2011 / 22:26:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+type
+    type == T_LONG ifTrue: [ ^ #long. ].
+    type == T_DOUBLE ifTrue: [ ^ #double ].
+    ^ type.
+
+    "Created: / 15-05-2011 / 22:29:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
 !JavaFieldRef2 methodsFor:'private - resolving'!
@@ -29,11 +46,11 @@
 
     valueCache := JavaResolver uniqueInstance 
                 resolveStaticFieldIndentifiedByRef: self.
-    class := classRefIndex resolve.
+    class := (constantPool at: classRefIndex) resolve.
     class ifNotNil: [ offset := class class instVarOffsetOf: self name ].
 
     "Created: / 28-04-2011 / 22:05:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 15-05-2011 / 22:25:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 15-05-2011 / 22:33:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
 findResolvedValue
@@ -41,10 +58,23 @@
 
     valueCache := JavaResolver uniqueInstance 
                 resolveFieldIndentifiedByRef: self.
-    class := classRefIndex resolve.
+    class := (constantPool at: classRefIndex) resolve.
     class ifNotNil: [ offset := class instVarOffsetOf: self name ].
 
-    "Modified: / 15-05-2011 / 22:25:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 15-05-2011 / 22:32:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+resolveType
+    type := JavaMethod typeFromSignature:((constantPool at: nameAndTypeIndex) descriptor) in:nil.
+    type == #long ifTrue:[
+        type := T_LONG.
+    ] ifFalse:[
+        type == #double ifTrue:[
+            type := T_DOUBLE
+        ]
+    ].
+
+    "Created: / 15-05-2011 / 22:29:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
 !JavaFieldRef2 class methodsFor:'documentation'!
@@ -52,3 +82,5 @@
 version_SVN
     ^ '$Id$'
 ! !
+
+JavaFieldRef2 initialize!