JavaMirror.st
branchcvs_MAIN
changeset 3360 1a8899091305
parent 3324 a58245c0e83a
child 3412 df11bb428463
--- a/JavaMirror.st	Fri Feb 14 14:27:26 2014 +0100
+++ b/JavaMirror.st	Wed Jan 28 03:12:08 2015 +0100
@@ -1,9 +1,9 @@
 "
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
 
  New code and modifications done at SWING Research Group [1]:
 
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
  This software is furnished under a license and may be used
@@ -23,47 +23,19 @@
 Object subclass:#JavaMirror
 	instanceVariableNames:'klass reflection'
 	classVariableNames:''
-	poolDictionaries:''
+	poolDictionaries:'JavaVMData'
 	category:'Languages-Java-Classes'
 !
 
-JavaMirror subclass:#AlienClassMirror
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:JavaMirror
-!
-
-JavaMirror subclass:#JavaArrayMirror
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:JavaMirror
-!
-
-JavaMirror subclass:#JavaClassMirror
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:JavaMirror
-!
-
-JavaMirror subclass:#JavaPrimitiveMirror
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:JavaMirror
-!
-
 !JavaMirror class methodsFor:'documentation'!
 
 copyright
 "
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
 
  New code and modifications done at SWING Research Group [1]:
 
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
  This software is furnished under a license and may be used
@@ -89,7 +61,7 @@
 
     Different classes may use different mirrors - for example,
     Smalltalk classes use a special mirror so non-Smalltalk classes
-    and instances could be introspected and manipulated by standard 
+    and instances could be introspected and manipulated by standard
     Java code.
 
     [author:]
@@ -117,9 +89,10 @@
 !JavaMirror class methodsFor:'accessing'!
 
 mirrorClassForAlienClass
-    ^ AlienClassMirror
+    ^ JavaAlienMirror
 
     "Created: / 31-07-2012 / 17:36:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-05-2013 / 10:54:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 mirrorClassForJavaArray
@@ -150,7 +123,7 @@
 !
 
 getDeclaredConstructors: publicOnly
-    "Returns an java.lang.reflect.Constructor[] with all constructors 
+    "Returns an java.lang.reflect.Constructor[] with all constructors
      declared by this class. "
 
     ^self subclassResponsibility
@@ -159,7 +132,7 @@
 !
 
 getDeclaredFields: publicOnly
-    "Returns an java.lang.reflect.Field[] with all constructors 
+    "Returns an java.lang.reflect.Field[] with all constructors
      declared by this class."
 
     ^self subclassResponsibility
@@ -167,10 +140,10 @@
     "Created: / 22-08-2012 / 12:03:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-getDeclaredMethods:publicOnly 
-    "Returns an java.lang.reflect.Method[] with all methods 
+getDeclaredMethods:publicOnly
+    "Returns an java.lang.reflect.Method[] with all methods
      declared by this class."
-    
+
     ^ self subclassResponsibility
 
     "Created: / 01-08-2012 / 11:07:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -224,7 +197,7 @@
 
 !JavaMirror methodsFor:'instance creation-java.lang.reflect.*'!
 
-create: ctorOrMethodClass for: class method: method signature: signature modifiers: modifiers parameterTyoes: parameterClasses exceptionTypes: exceptionClasses annotations: annotations 
+create: ctorOrMethodClass for: class method: method signature: signature modifiers: modifiers parameterTyoes: parameterClasses exceptionTypes: exceptionClasses annotations: annotations
     "Creates a new java.lang.Constructor. Arguments:
 
         ctorOrMethodClass <java.lang.reflect.Constructor|java.lang.reflect.Method>
@@ -235,7 +208,7 @@
         parameterClasses <Collection of Class>
         exceptionClasses <Collection of Class>
         annotations <JavaAnnotationContainer>"
-    
+
     | ctorOrMethod |
     ctorOrMethod := ctorOrMethodClass new.
     ctorOrMethod
@@ -246,10 +219,13 @@
         instVarNamed: #parameterTypes
             put: (reflection javaClassObjectArrayForClasses: parameterClasses);
         instVarNamed: #exceptionTypes
-            put: (reflection javaClassObjectArrayForClasses: exceptionClasses);
+            put: (reflection javaClassObjectArrayForClasses: exceptionClasses).
+
+    annotations notNil ifTrue:[ 
+    ctorOrMethod
         instVarNamed: #annotations put: annotations runtimeVisible bytes;
-        instVarNamed: #parameterAnnotations
-            put: annotations rawParamAnnotations.
+        instVarNamed: #parameterAnnotations put: annotations rawParamAnnotations.
+    ].
     (method isJavaMethod and: [ method signature notNil ]) ifTrue: [
         ctorOrMethod instVarNamed: #signature
             put: (reflection javaStringObjectForString: method signature interned: true)
@@ -258,6 +234,7 @@
 
     "Created: / 01-08-2012 / 10:24:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 01-12-2012 / 22:55:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 04-08-2014 / 15:58:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 createConstructorFor: class method: method signature: signature modifiers: modifiers parameterTyoes: parameterClasses exceptionTypes: exceptionClasses annotations: annotations
@@ -273,51 +250,61 @@
     "
 
     | ctor |
-    ctor := self create: (JavaVM classForName:'java.lang.reflect.Constructor')
+    ctor := self create: _java_lang_reflect_Constructor_CLASS
                     for: class
                  method: method
-              signature: signature 
-              modifiers: modifiers 
-         parameterTyoes: parameterClasses 
-         exceptionTypes: exceptionClasses 
+              signature: signature
+              modifiers: modifiers
+         parameterTyoes: parameterClasses
+         exceptionTypes: exceptionClasses
             annotations: annotations.
     ^ctor
 
     "Created: / 01-08-2012 / 10:20:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2013 / 10:55:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-createFieldFor: javaField 
+createFieldFor:javaField 
     "given a java field, return the corresponding java.lang.Field
      instance for it."
     "
         See OpenJDK7 source:
         jdk7/hotspot/src/share/vm/runtime/reflection.cpp,
         oop Reflection::new_field"
-
+    
     | field  clazz  name  slot  type  modifiers |
 
-    clazz := reflection javaClassObjectForClass: klass.
-    name := JavaVM reflection javaStringObjectForString: javaField name
-                interned: true.
+    clazz := reflection javaClassObjectForClass:klass.
+    name := JavaVM reflection javaStringObjectForString:javaField name
+            interned:true.
     slot := javaField index.
-    type := JavaVM javaClassObjectForClass: javaField typeClass.
+    
+    "/ Following could be coded like (and actually it was):
+    "/
+    "/type := JavaVM javaClassObjectForClass: javaField typeClass.
+    "/
+    "/ however, for performance reasons its better to avoid ClassLoader query, so:
+    
+    type := JavaVM 
+            javaClassObjectForClass:((JavaDescriptor fromString:javaField descriptor) 
+                    javaClassUsingClassLoader:javaField javaClass classLoader).
     modifiers := javaField accessFlags.
-    field := (JavaVM classForName: 'java.lang.reflect.Field') new.
+    field := _java_lang_reflect_Field_CLASS new.
     field
-        instVarNamed: #clazz put: clazz;
-        instVarNamed: #name put: name;
-        instVarNamed: #slot put: slot;
-        instVarNamed: #type put: type;
-        instVarNamed: #modifiers put: modifiers;
+        instVarNamed:#clazz put:clazz;
+        instVarNamed:#name put:name;
+        instVarNamed:#slot put:slot;
+        instVarNamed:#type put:type;
+        instVarNamed:#modifiers put:modifiers;
         yourself.
-    javaField annotations 
-        ifNotNil: [
-            field instVarNamed: #annotations
-                put: javaField annotations runtimeVisible rawAnnotations
-        ].
+    javaField annotations notNil ifTrue:[
+        field instVarNamed:#annotations
+            put:javaField annotations runtimeVisible rawAnnotations
+    ].
     ^ field.
 
     "Created: / 22-08-2012 / 12:09:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-08-2014 / 15:52:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 createMethodFor: class method: method name: name signature: signature modifiers: modifiers parameterTyoes: parameterClasses returnType: returnClass exceptionTypes: exceptionClasses annotations: annotations
@@ -335,13 +322,13 @@
     "
 
     | mthd |
-    mthd := self create: (JavaVM classForName:'java.lang.reflect.Method')
+    mthd := self create: _java_lang_reflect_Method_CLASS
                     for: class
                  method: method
-              signature: signature 
-              modifiers: modifiers 
-         parameterTyoes: parameterClasses 
-         exceptionTypes: exceptionClasses 
+              signature: signature
+              modifiers: modifiers
+         parameterTyoes: parameterClasses
+         exceptionTypes: exceptionClasses
             annotations: annotations.
 
     mthd
@@ -352,490 +339,13 @@
     ^mthd
 
     "Created: / 01-08-2012 / 10:46:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::AlienClassMirror class methodsFor:'documentation'!
-
-documentation
-"
-    Specialized mirror for Smalltalk (and all other 
-    non-Java classes)
-
-    [author:]
-        Jan Vrany <jan.vrany@fit.cvut.cz>
-
-    [instance variables:]
-
-    [class variables:]
-
-    [see also:]
-
-"
-! !
-
-!JavaMirror::AlienClassMirror methodsFor:'accessing'!
-
-getClassLoader
-    "Returns a class loader that loaded this class"
-
-    ^ (JavaVM classForName:'stx.libjava.ClassLoader') instVarNamed: #scl.
-
-    "Modified: / 07-05-2013 / 11:19:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredConstructors:publicOnly
-    "Returns an java.lang.reflect.Constructor[] with all constructors 
-     declared by this class"
-
-    "Here, return onlu default constructor. Later, all methods annotated
-     with <jsignature: #'<init>(...)V'> wil be returned as well"
-
-    | ctors |
-
-    ctors := OrderedCollection new.
-    klass selectorsAndMethodsDo:[:sel :mthd|
-        (self isJavaConstructor: mthd selector: sel) ifTrue:[
-            ctors add: (self getDeclaredConstructorFor: mthd).
-        ].
-    ].
-
-    ctors isEmpty ifTrue:[
-        "/If no constructor is found, fake default one...    
-        ctors add: (self getDeclaredConstructorFor: (klass lookupMethodFor: #initialize)).
-    ].
-
-    ^(JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass withAll: ctors
-
-    "Modified: / 22-08-2012 / 11:37:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredFields:publicOnly
-    "Returns an java.lang.reflect.Field[] with all constructors 
-     declared by this class."
-
-    | fields |    
-
-    fields := OrderedCollection new.
-
-    klass instVarNames withIndexDo:[:nm :index|
-        | field |
-
-        field := JavaField new.
-        field 
-            setAccessFlags: JavaConstants ACC_PROTECTED;
-            setClass: klass;
-            setIndex: klass superclass instSize + index;
-            setDescriptor: #'Ljava/lang/Object;';
-            setName: nm.
-
-        fields add: (self createFieldFor: field)
-    ].
-
-    ^ (JavaVM classForName:'java.lang.reflect.Field') javaArrayClass 
-        withAll:fields
-
-    "Modified: / 22-08-2012 / 12:19:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredMethods:publicOnly 
-    "Returns an java.lang.reflect.Method[] with all methods 
-     declared by this class"
-
-    | methods |
-
-    methods := OrderedCollection new.
-    klass selectorsAndMethodsDo:[:sel :mthd|
-        (self isJavaMethod: mthd selector: sel) ifTrue:[
-            methods add: (self getDeclaredMethodFor: mthd).
-        ].
-    ].
-    ^(JavaVM classForName:'java.lang.reflect.Method') javaArrayClass withAll: methods
-
-    "Modified: / 22-08-2012 / 11:36:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getInterfaces
-    "Return a list if interfaces"
-
-    ^ Array with: (JavaVM classForName: 'java.lang.Cloneable')
-
-    "Modified: / 22-08-2012 / 11:06:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getModifiers
-    "Return class modifiers (public/abstract/final...)"
-
-    ^ JavaConstants ACC_PUBLIC
-
-    "Modified: / 22-08-2012 / 11:01:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getName
-    "Returns name of the class"
-    ^'SMALLTALK.' , klass name
-
-    "Created: / 22-08-2012 / 10:47:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::AlienClassMirror methodsFor:'accessing-private'!
-
-getDeclaredConstructorFor: method
-    ^ self 
-        createConstructorFor: klass 
-                      method: method 
-                   signature: (self getSignatureForConstructor: method)
-                   modifiers: JavaConstants ACC_PUBLIC 
-              parameterTyoes: #() 
-              exceptionTypes: #() 
-                 annotations: JavaMethodAnnotationContainer new
-
-    "Created: / 22-08-2012 / 11:36:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredMethodFor:method
-    | signature name java_lang_Object |
-
-    signature := self getSignatureForMethod: method short: false.
-    name := signature upTo: $(.
-    java_lang_Object := JavaVM classNamed: 'java.lang.Object'.
-    ^ self 
-        createMethodFor: klass 
-                      method: method 
-                        name: name
-                   signature: signature
-                   modifiers: JavaConstants ACC_PUBLIC 
-              parameterTyoes: ((1 to: method selector numArgs) collect:[:i|java_lang_Object])
-                  returnType: java_lang_Object
-              exceptionTypes: #() 
-                 annotations: JavaMethodAnnotationContainer new
-
-    "Created: / 22-08-2012 / 11:36:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getSignatureForConstructor: method
-    | signature |
-
-    signature :=
-        (String streamContents:[:s|
-            s nextPutAll: '<init>('.
-            method selector numArgs timesRepeat:[
-                s nextPutAll:'Ljava/lang/Object;'.
-            ].
-            s nextPutAll: ')V'.
-        ]) asSymbol.
-    ^signature
-
-    "Created: / 22-08-2012 / 11:40:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getSignatureForMethod: method short: short
-    | selector signature |
-
-    selector := method selector.
-    signature :=
-        (String streamContents:[:s|
-            short ifTrue:[
-                s nextPutAll: (selector upTo: $:)
-            ] ifFalse:[
-                selector numArgs == 1 ifTrue:[
-                    s nextPutAll: (selector copyTo: selector size - 1)
-                ] ifFalse:[
-                    s nextPutAll: (selector copyReplaceAll: $: with: $_)
-                ]
-            ].
-            s nextPut: $(.
-            method selector numArgs timesRepeat:[
-                s nextPutAll:'Ljava/lang/Object;'.
-            ].
-            s nextPutAll: ')'.
-            s nextPutAll:'Ljava/lang/Object;'.
-        ]) asSymbol.
-    ^signature
-
-    "Created: / 22-08-2012 / 11:46:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::AlienClassMirror methodsFor:'testing-private'!
-
-isJavaConstructor: mthd selector: sel
-
-    ^sel startsWith: #initialize
-
-    "Created: / 22-08-2012 / 11:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-isJavaMethod: mthd selector: sel
-
-    ^sel isBinarySelector not 
-        and:[(self isJavaConstructor: mthd selector: sel) not]
-
-    "Created: / 22-08-2012 / 11:47:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::JavaArrayMirror methodsFor:'accessing'!
-
-getClassLoader
-    "Returns a class loader that loaded this class"
-
-    ^ klass javaComponentClass javaMirror getClassLoader
-
-    "Modified: / 31-07-2012 / 18:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredConstructors:publicOnly
-    "Returns an java.lang.reflect.Constructor[] with all constructors 
-     declared by this class"
-
-    ^ (JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass new:0.
-
-    "Modified: / 31-07-2012 / 18:41:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredFields:publicOnly
-    "Returns an java.lang.reflect.Field[] with all constructors 
-     declared by this class."
-
-    ^(JavaVM classForName:'java.lang.reflect.Field') javaArrayClass new:0.
-
-    "Modified: / 22-08-2012 / 12:03:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredMethods:publicOnly 
-    "Returns an java.lang.reflect.Method[] with all methods 
-     declared by this class"
-    
-    ^ (JavaVM classForName:'java.lang.reflect.Method') javaArrayClass new:0.
-
-    "Modified: / 01-08-2012 / 11:08:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getInterfaces
-    "Return a list if interfaces"
-
-    ^ Array 
-        with: (JavaVM classForName: 'java.lang.Cloneable')
-        with: (JavaVM classForName: 'java.io.Serializable')
-
-    "Modified: / 22-08-2012 / 11:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getModifiers
-    "Return class modifiers (public/abstract/final...)"
-
-    ^ JavaConstants ACC_ABSTRACT | JavaConstants ACC_FINAL | JavaConstants ACC_PUBLIC
-
-    "Modified: / 22-08-2012 / 11:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::JavaClassMirror class methodsFor:'documentation'!
-
-documentation
-"
-    A specialized mirror for all Java classes
-
-    [author:]
-        Jan Vrany <jan.vrany@fit.cvut.cz>
-
-    [instance variables:]
-
-    [class variables:]
-
-    [see also:]
-
-"
-! !
-
-!JavaMirror::JavaClassMirror methodsFor:'accessing'!
-
-getClassLoader
-    "Returns a class loader that loaded this class"
-
-    ^ klass classLoader
-
-    "Modified: / 31-07-2012 / 18:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredConstructors:publicOnly
-    "Returns an java.lang.reflect.Constructor[] with all constructors 
-     declared by this class"
-
-    | ctors |
-
-    ctors := OrderedCollection new.
-    klass selectorsAndMethodsDo:[:sel :mthd|
-        (mthd isJavaConstructor and:[publicOnly not or:[mthd isPublic]]) ifTrue:[
-            ctors add: (self getDeclaredConstructorFor: mthd).
-        ].
-    ].
-    ^(JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass withAll: ctors
-
-    "Modified: / 01-08-2012 / 11:04:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredFields:publicOnly
-    "Returns an java.lang.reflect.Field[] with all constructors 
-     declared by this class."
-
-    | fields |    
-
-    fields := klass fields , klass staticFields.
-    publicOnly ifTrue:[ fields := fields select:[:f | f isPublic ] ].
-    JavaClassReader classLoaderQuerySignal answer: klass classLoader do:[
-        fields := fields collect:[:f | self createFieldFor:f ].
-    ].
-    ^ (JavaVM classForName:'java.lang.reflect.Field') javaArrayClass 
-        withAll:fields
-
-    "Modified: / 22-08-2012 / 12:10:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredMethods:publicOnly
-    "Returns an java.lang.reflect.Constructor[] with all constructors 
-     declared by this class"
-
-    | methods |
-
-    methods := OrderedCollection new.
-    klass selectorsAndMethodsDo:[:sel :mthd|
-        mthd isJavaMethod and:[
-            (mthd isJavaConstructor not 
-                and:[mthd isJavaStaticInitializer not
-                and:[publicOnly not or:[mthd isPublic]]]) ifTrue:[
-                methods add: (self getDeclaredMethodFor: mthd).
-            ]
-        ].
-    ].
-    ^(JavaVM classForName:'java.lang.reflect.Method') javaArrayClass withAll: methods
-
-    "Modified: / 19-09-2012 / 16:26:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getGenericSignature
-    "Returns Java generic signature (if a generic class) or nil"
-
-    ^klass signatureJ
-
-    "Created: / 22-08-2012 / 11:58:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getInterfaces
-    "Return a list if interfaces"
-
-    ^ klass interfaces
-
-    "Modified: / 22-08-2012 / 11:08:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getModifiers
-    "Return class modifiers (public/abstract/final...)"
-
-    | modifiers |    
-
-    "According to OpenJDK JVM, strip ACC_SUPER"
-    modifiers := (klass accessFlags & JavaConstants ACC_SUPER bitInvert) & 16r7FFF.
-    "JV@2011-10-30: It seems that private inner classes has no
-     private bit set, sigh"
-    (modifiers & 16r0007) == 0 ifTrue:[
-        modifiers := modifiers | JavaConstants ACC_PRIVATE.
-    ].
-    ^modifiers
-
-    "Modified: / 22-08-2012 / 11:03:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getProtectionDomain
-    ^klass protectionDomain
-
-    "Created: / 22-08-2012 / 12:56:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::JavaClassMirror methodsFor:'accessing-private'!
-
-getDeclaredConstructorFor: method
-
-    ^self createConstructorFor: method javaClass
-                        method: method
-                     signature: method signature
-                     modifiers: method accessFlags
-                parameterTyoes: (method descriptor parameterClassesUsingClassLoader: method javaClass classLoader)
-                exceptionTypes: method exceptionClasses
-                   annotations: method method annotations.
-
-    "Created: / 01-08-2012 / 00:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredMethodFor: method
-
-    ^self      createMethodFor: method javaClass
-                        method: method
-                          name: (method selector upTo: $()
-                     signature: method signature
-                     modifiers: method accessFlags
-                parameterTyoes: (method descriptor parameterClassesUsingClassLoader: method javaClass classLoader)
-                    returnType: (method descriptor returnClassUsingClassLoader: method javaClass classLoader)
-                exceptionTypes: method exceptionClasses
-                   annotations: method method annotations.
-
-    "Created: / 01-08-2012 / 11:11:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaMirror::JavaPrimitiveMirror methodsFor:'accessing'!
-
-getClassLoader
-    "Returns a class loader that loaded this class"
-
-    ^ nil
-
-    "Modified: / 31-07-2012 / 18:35:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredConstructors:publicOnly
-    "Returns an java.lang.reflect.Constructor[] with all constructors 
-     declared by this class"
-
-    ^ (JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass new:0.
-
-    "Modified: / 31-07-2012 / 18:41:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredFields:publicOnly
-    "Returns an java.lang.reflect.Field[] with all constructors 
-     declared by this class."
-
-    ^(JavaVM classForName:'java.lang.reflect.Field') javaArrayClass new:0.
-
-    "Modified: / 22-08-2012 / 12:03:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getDeclaredMethods:publicOnly 
-    "Returns an java.lang.reflect.Method[] with all methods 
-     declared by this class"
-    
-    ^ (JavaVM classForName:'java.lang.reflect.Method') javaArrayClass new:0.
-
-    "Modified: / 01-08-2012 / 11:08:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getInterfaces
-    "Return a list if interfaces"
-
-    ^ #()
-
-    "Modified: / 22-08-2012 / 11:07:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-getModifiers
-    "Return class modifiers (public/abstract/final...)"
-
-    ^ JavaConstants ACC_ABSTRACT | JavaConstants ACC_FINAL | JavaConstants ACC_PUBLIC
-
-    "Modified: / 22-08-2012 / 11:02:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2013 / 10:55:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaMirror class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libjava/JavaMirror.st,v 1.3 2013-09-06 00:41:24 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libjava/JavaMirror.st,v 1.4 2015-01-28 02:10:50 vrany Exp $'
 !
 
 version_HG
@@ -844,6 +354,6 @@
 !
 
 version_SVN
-    ^ '§Id::                                                                                                                        §'
+    ^ 'Id::                                                                                                                        '
 ! !