- JavaVM jk_new_structure
authorvranyj1
Mon, 30 Jul 2012 23:57:25 +0000
branchjk_new_structure
changeset 1576 d2ce64ae3414
parent 1575 4ec99592e12f
child 1577 8319db430a11
- JavaVM changed: #_java_lang_Class_getConstantPool: #_java_lang_Class_getRawAnnotations: #_java_lang_Class_getSuperclass: #javaClassObjectForClass:
src/JavaVM.st
--- a/src/JavaVM.st	Mon Jul 30 22:52:01 2012 +0000
+++ b/src/JavaVM.st	Mon Jul 30 23:57:25 2012 +0000
@@ -4624,19 +4624,19 @@
     "given a real class, return the corresponding java.lang.class
      instance for it."
     
-    | class |
-
-    "find reflection of StClass in the Java World"
-    (JavaObjectDictionary new hasReflection: aClass name) ifTrue: [
-        class := JavaObjectDictionary new reflectionOf: aClass name
-    ] ifFalse: [ class := aClass. ].
-    ^ self reflection javaClassObjectForClass: class.
+"/    | class |
+"/
+"/    "find reflection of StClass in the Java World"
+"/    (JavaObjectDictionary new hasReflection: aClass name) ifTrue: [
+"/        class := JavaObjectDictionary new reflectionOf: aClass name
+"/    ] ifFalse: [ class := aClass. ].
+    ^ self reflection javaClassObjectForClass: aClass.
 
     "Created: / 23-01-1998 / 17:43:38 / cg"
     "Modified: / 05-12-1998 / 15:29:32 / cg"
     "Modified: / 17-01-2011 / 19:24:22 / kursjan <kursjan@fit.cvut.cz>"
     "Modified: / 28-01-2011 / 14:31:25 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 03-02-2011 / 21:31:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-07-2012 / 00:49:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 javaConstructorObjectForMethod:method 
@@ -6866,14 +6866,15 @@
         | class |
 
     class := self reflection classForJavaClassObject:aJavaContext receiver.
-    (class isJavaArrayClass or:[class isJavaPrimitiveType]) ifTrue:[
+    class isJavaClass ifFalse:[
         ^nil    
     ].
+
     ^ self reflection javaConstantPoolObjectFor:class constantPool.
 
     "Created: / 21-12-2010 / 20:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 28-02-2011 / 18:05:13 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 11-12-2011 / 17:28:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-07-2012 / 00:47:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_lang_Class_getDeclaredClasses0: nativeContext
@@ -7139,11 +7140,14 @@
     class isJavaPrimitiveType ifTrue:[
         ^nil
     ].
+    class isJavaClass ifFalse:[
+        ^nil.
+    ].
     ^ class runtimeVisibleAnnotationsAsBytesOrNil
 
     "Created: / 21-12-2010 / 19:35:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 28-01-2011 / 15:19:20 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 05-12-2011 / 00:50:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-07-2012 / 00:46:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_lang_Class_getSuperclass: nativeContext 
@@ -7159,15 +7163,19 @@
     cls isJavaArrayClass ifTrue: [
         ^ self javaClassObjectForClass: (Java at: 'java.lang.Object')
     ].
+    cls == Object ifTrue: [
+        ^ self javaClassObjectForClass: (Java at: 'java.lang.Object')
+    ].
     cls isInterface ifTrue: [ ^ nil ].
     superCls := cls superclass.
     superCls == JavaObject ifTrue: [ ^ nil. ].
+    superCls ==     Object ifTrue: [ ^ nil ]. "/for Java
     ^ self javaClassObjectForClass: superCls
 
     "Created: / 12-01-1998 / 12:38:36 / cg"
     "Modified: / 04-02-1998 / 14:51:22 / cg"
     "Modified: / 28-01-2011 / 14:12:47 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 15-08-2011 / 09:09:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-07-2012 / 00:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_lang_Class_isArray: nativeContext