JavaVM.st
changeset 3515 84f25ecd7385
parent 3514 b3cbf3ca5dcf
child 3539 e546e1df7a01
--- a/JavaVM.st	Tue Jan 12 14:50:22 2016 +0100
+++ b/JavaVM.st	Tue Jan 12 14:52:00 2016 +0100
@@ -51,8 +51,7 @@
 !
 
 Object subclass:#ReflectionRegistry
-	instanceVariableNames:'vm constantPoolMapping javaClasses javaArrayClasses
-		javaMethodsPerMethod realMethods'
+	instanceVariableNames:'vm constantPoolMapping javaClasses javaArrayClasses'
 	classVariableNames:''
 	poolDictionaries:'JavaVMData'
 	privateIn:JavaVM
@@ -4050,15 +4049,6 @@
     "Modified: / 31-07-2012 / 00:49:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-javaConstructorObjectForMethod:method
-    "given a real method, return the corresponding java.lang.reflect.Constructor
-     instance for it."
-    self breakPoint:#mh info:'refactor my sender to call reflection directly'.
-    ^ self reflection javaConstructorObjectForMethod: method.
-
-    "Modified: / 09-02-2011 / 00:58:09 / Marcel Hlopko <hlopik@gmail.com>"
-!
-
 javaFieldObjectForField:aJavaField in:aJavaLangClass 
     "given a java field, return the corresponding java.lang.Field
      instance for it."
@@ -4096,15 +4086,6 @@
     "Modified: / 25-04-2011 / 20:23:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-javaMethodObjectForMethod:method
-    "given a real method, return the corresponding java.lang.reflect.Constructor
-     instance for it."
-
-    ^ self reflection javaMethodObjectForMethod:method.
-
-    "Modified: / 28-02-2011 / 17:08:36 / Marcel Hlopko <hlopik@gmail.com>"
-!
-
 methodForJavaConstructorObject:constructor
     "given a java.lang.reflect.Constructor, return the corresponding method
      it."
@@ -7860,11 +7841,10 @@
     constantPoolMapping := IdentityDictionary new.
     javaClasses := IdentityDictionary new.
     javaArrayClasses := IdentityDictionary new.
-    javaMethodsPerMethod := IdentityDictionary new
 
     "Created: / 21-12-2010 / 19:46:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 09-02-2011 / 00:24:28 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 11-01-2016 / 22:28:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 11-01-2016 / 23:13:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 setVM: aJavaVM
@@ -8051,48 +8031,6 @@
     "Created: / 22-08-2012 / 12:23:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-javaConstructorObjectForMethod:method
-     "given a real method, return the corresponding java.lang.reflect.Constructor
-      instance for it."
-
-    | jCtor |
-
-    javaMethodsPerMethod at:method ifPresent:[:existingCtor|^existingCtor].
-
-    jCtor := (Java classForName:'java.lang.reflect.Constructor') new.
-    self javaMethodObjectLikeSlotsInto: jCtor forMethod: method.
-    self rememberJavaMethodObject: jCtor for: method.
-
-    ^ jCtor
-
-    "Created: / 09-02-2011 / 10:28:12 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 05-12-2011 / 10:02:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-javaMethodObjectForMethod:method
-     "given a real method, return the corresponding java.lang.reflect.Constructor
-      instance for it."
-     | jMethod |
-
-    javaMethodsPerMethod at:method ifPresent:[:existingCtor|^existingCtor].
-
-    jMethod := (Java classForName:'java.lang.reflect.Method') new.
-    self javaMethodObjectLikeSlotsInto: jMethod forMethod: method.
-    self rememberJavaMethodObject: jMethod for: method.
-
-    jMethod
-        instVarNamed: #name       put: (self javaStringObjectForString: (method selector upTo:$() interned: true);
-        instVarNamed: #returnType put: (method descriptor returnClassObject);
-        instVarNamed: #annotationDefault put: (method annotations default bytes);
-
-        yourself.
-
-    ^jMethod
-
-    "Created: / 09-02-2011 / 10:29:46 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 05-12-2011 / 10:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 javaMethodObjectLikeSlotsInto: jMethod forMethod: method
     "
        Fill in slots of given instance of java.lang.Method or
@@ -8172,16 +8110,7 @@
 "/    ^nil.
 
     "Created: / 09-02-2011 / 10:32:14 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 01-08-2012 / 11:19:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-rememberJavaMethodObject: jmethod for: method
-
-    javaMethodsPerMethod at: method put: jmethod.
-    realMethods add: method.
-    jmethod instVarNamed: #slot put: realMethods size.
-
-    "Created: / 05-12-2011 / 10:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 11-01-2016 / 23:08:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaVM::ReflectionRegistry methodsFor:'reflection - other'!