JavaNativeMethodImpl_OpenJDK6.st
branchrefactoring-vmdata
changeset 1972 130185d6e2ae
parent 1971 e75c1790521c
parent 1970 a78cd5a84c77
child 1974 9dc799a359ac
--- a/JavaNativeMethodImpl_OpenJDK6.st	Wed Jan 16 21:06:25 2013 +0000
+++ b/JavaNativeMethodImpl_OpenJDK6.st	Wed Jan 16 21:30:59 2013 +0000
@@ -880,11 +880,11 @@
 
     | method parameterTypes bargs bargss retval retcls bi executionEx |
 
-    method := self reflection methodForJavaConstructorObject: jmethod.
+    method := Reflection methodForJavaConstructorObject: jmethod.
     parameterTypes := jmethod instVarNamed: #parameterTypes.
 
     (obj isNil and:[method isStatic not]) ifTrue:[
-        self throwNullPointerException.
+        JavaVM throwNullPointerException.
         ^nil.
     ].
 
@@ -896,20 +896,20 @@
             | cls |
             bi > bargss ifTrue:[
 "/                self breakPoint: #jv.
-                self throwIllegalArgumentException: 'passed more arguments than expected'.
+                JavaVM throwIllegalArgumentException: 'passed more arguments than expected'.
             ].
 
             cls := self classForJavaClassObject: (parameterTypes at: i).
             cls isJavaPrimitiveType ifTrue:[
                 bargs at: bi put: (cls javaUnbox: (args at:i) onError:[
 "/                    self breakPoint: #jv.
-                    self throwIllegalArgumentException:'illegal unbox'. ^nil
+                    JavaVM throwIllegalArgumentException:'illegal unbox'. ^nil
                 ]).
                 (cls == LargeInteger or:[cls == Float]) ifTrue:[bi := bi + 1].
             ] ifFalse:[
                 ((args at:i) isNil or:[(self canCast: (args at:i) class to: cls)]) ifFalse:[
                     self breakPoint: #jv.
-                    self throwIllegalArgumentException:'incomplatible argument types'. ^nil.
+                    JavaVM throwIllegalArgumentException:'incomplatible argument types'. ^nil.
                 ].
                 bargs at: bi put: (args at:i).
             ].
@@ -917,7 +917,7 @@
        ].
         bi <= bargss ifTrue:[
 "/             self breakPoint: #jv.
-             self throwExceptionClassName: 'java.lang.reflect.InvocationTargetException'
+             JavaVM throwExceptionClassName: 'java.lang.reflect.InvocationTargetException'
                               withMessage: 'not enough arguments'
         ].
     ] ifFalse:[
@@ -926,7 +926,7 @@
 
     "Check number of arguments"
     method numArgs ~= bargs size ifTrue:[
-        self throwIllegalArgumentException:'Invalid number of arguments'.
+        JavaVM throwIllegalArgumentException:'Invalid number of arguments'.
         ^nil.
     ].
 
@@ -940,7 +940,7 @@
                                        from: context
                                         ilc: nil.
         method isNil ifTrue:[
-            self throwIllegalArgumentException:'Message not understood - invalid class for ''this'''.
+            JavaVM throwIllegalArgumentException:'Message not understood - invalid class for ''this'''.
             ^nil.
         ].
     ].
@@ -952,18 +952,18 @@
         ] ifFalse:[
             retval := method valueWithReceiver: obj arguments: bargs.
         ].
-    ] on: (self classForName:'java.lang.Throwable') do:[:ex |
+    ] on: (JavaVM classForName:'java.lang.Throwable') do:[:ex |
         executionEx := ex.
     ].
     executionEx notNil ifTrue:[
-        self throwInvocationTargetException: 'An exception occured during invocation' target: executionEx.
+        JavaVM throwInvocationTargetException: 'An exception occured during invocation' target: executionEx.
         ^nil.
     ].
 
     isConstructor ifFalse:[
         retcls := jmethod instVarNamed: #returnType.
         retcls notNil ifTrue:[
-            retcls := self classForJavaClassObject: retcls.
+            retcls := JavaVM classForJavaClassObject: retcls.
             retcls ~~ UndefinedObject ifTrue:[
                 retval := retcls javaBox: retval.
             ]