src/JavaResolver.st
branchjk_new_structure
changeset 1033 a31de6a4cfa4
parent 1028 d30cabc12354
child 1035 712d2090e68b
--- a/src/JavaResolver.st	Thu Oct 20 17:10:04 2011 +0000
+++ b/src/JavaResolver.st	Thu Oct 20 18:20:15 2011 +0000
@@ -246,7 +246,7 @@
      JavaClassReader classLoaderQuerySignal answer: loader do:[call me]
      
     "
-    ^ Java javaRegistry classForName: nm definedBy: JavaClassReader classLoaderQuerySignal query.
+    ^ JavaVM classForName: nm.       
 
     "Created: / 11-04-2011 / 19:27:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 23-05-2011 / 21:06:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
@@ -254,8 +254,7 @@
 !
 
 lookupClassIfAlreadyResolved: javaClassName 
-
-    ^Java javaRegistry at: javaClassName
+    ^ JavaVM at: javaClassName
 
     "Modified: / 13-04-2011 / 14:05:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 06-08-2011 / 16:44:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -571,16 +570,14 @@
     result ifNotNil: [ ^ result ].
     class := aJavaMethodRef classRef resolve.
     class ifNil: [ self error: 'should not happen - tell mh' ].
-    "Array types responds to all method of class java.lang.Object"
-    class isJavaArrayClass ifTrue:[
-        class := Java classForName:'java.lang.Object'.
+     "Array types responds to all method of class java.lang.Object"
+    class isJavaArrayClass ifTrue: [
+        class := JavaVM classForName: 'java.lang.Object'.
     ].
-
-
      "
      To resolve an unresolved symbolic reference from D to a method in
      a class C, the symbolic reference to C given by the method reference
-     is first resolved (§5.4.3.1). Therefore, any exceptions that can be
+     is first resolved (§5.4.3.1). Therefore, any exceptions that can be
      thrown due to resolution of a class reference can be thrown as a result
      of method resolution. If the reference to C can be successfully resolved,
      exceptions relating to the resolution of the method reference itself
@@ -605,11 +602,12 @@
      If method lookup fails, method resolution throws a NoSuchMethodError. If method
      lookup succeeds and the method is abstract, but C is not abstract, method resolution
      throws an AbstractMethodError. Otherwise, if the referenced method is not accessible
-     (§5.4.4) to D, method resolution throws an IllegalAccessError."
+     (§5.4.4) to D, method resolution throws an IllegalAccessError."
     result := class lookupMethodByNameAndType: aJavaMethodRef nameAndType.
     result ifNil: [ self throwNoSuchMethodError ].
-    (result isAbstract and:[result javaClass isInterface not and:[ class isAbstract not ]]) 
-        ifTrue: [ self throwAbstractMethodError ].
+    (result isAbstract 
+        and: [ result javaClass isInterface not and: [ class isAbstract not ] ]) 
+            ifTrue: [ self throwAbstractMethodError ].
     (self 
         checkPermissionsForMethod: result
         from: aJavaMethodRef classRef owner
@@ -620,8 +618,7 @@
      actually declared and let L2 be the defining loader of D. Let T0 be the name of
      the type returned by the referenced method, and let T1, ..., Tn be the names of
      the argument types of the referenced method. The Java virtual machine must impose
-     the loading constraints TiL1=TiL2 for i = 0 to n (§5.3.4)."
-
+     the loading constraints TiL1=TiL2 for i = 0 to n (§5.3.4)."
     "Created: / 11-04-2011 / 19:45:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 14-04-2011 / 00:01:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 10-08-2011 / 22:44:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"