src/JavaResolver.st
branchjk_new_structure
changeset 816 4e3072021201
parent 814 68df82c46fb0
child 817 3f2405c6ef88
--- a/src/JavaResolver.st	Mon May 23 15:27:40 2011 +0000
+++ b/src/JavaResolver.st	Mon May 23 16:05:45 2011 +0000
@@ -415,11 +415,16 @@
     result ifNotNil: [ ^ result ].
     class := aJavaInterfaceMethodRef classRef resolve.
     class ifNil: [ self halt: 'should not happen - tell mh' ].
-    class isInterface ifFalse:[self throwIncompatibleClassChangeError].
-    result := class lookupMethodByNameAndType: aJavaInterfaceMethodRef nameAndType.
-    result ifNil:[self throwNoSuchMethodError].
-    ^ result.
-    "
+    class isInterface ifFalse: [ self throwIncompatibleClassChangeError ].
+    result := class 
+                lookupMethodByNameAndType: aJavaInterfaceMethodRef nameAndType.
+    result ifNil: [ self throwNoSuchMethodError ].
+    (self 
+        checkPermissionsForMethod: result
+        from: aJavaInterfaceMethodRef classRef owner
+        to: class) ifFalse: [ self throwIllegalAccessError ].
+^ result.
+     "
      To resolve an unresolved symbolic reference from D to an interface method in an
      interface C, the symbolic reference to C given by the interface method reference is
      first resolved (§5.4.3.1). Therefore, any exceptions that can be thrown as a result
@@ -428,9 +433,8 @@
      resolved, exceptions relating to the resolution of the interface method reference
      itself can be thrown.
      When resolving an interface method reference:
-
-     If C is not an interface, interface method resolution throws an IncompatibleClassChangeError.
-     Otherwise, if the referenced method does not have the same name and descriptor as
+     
+     If C is not an interface, interface method resolution throws an IncompatibleClassChangeError.""Otherwise, if the referenced method does not have the same name and descriptor as
      a method in C or in one of the superinterfaces of C, or in class Object, interface
      method resolution throws a NoSuchMethodError.
      Otherwise, let <E, L1> be the interface in which the referenced interface method is
@@ -439,7 +443,7 @@
      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)."
 
-    "Modified: / 13-04-2011 / 12:16:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 23-05-2011 / 17:56:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
 !JavaResolver methodsFor:'interface method resolving helpers'!