[vmkit-commits] [vmkit] r180468 - Bug fixed: Calling a method via reflection failed if the given method is not declared in an interface but it is marked abstract in its class, and it is implemented in a derived class of the given "this" object.

Peter Senna Tschudin peter.senna at gmail.com
Thu Apr 25 10:15:14 PDT 2013


Author: peter.senna
Date: Thu Apr 25 12:13:44 2013
New Revision: 180468

URL: http://llvm.org/viewvc/llvm-project?rev=180468&view=rev
Log:
Bug fixed: Calling a method via reflection failed if the given method is not declared in an interface but it is marked abstract in its class, and it is implemented in a derived class of the given "this" object.
(cherry picked from commit 6342c45053ee369b3b1b8715ff33bdc0815a71b2)

Modified:
    vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ClasspathVMMethod.inc

Modified: vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ClasspathVMMethod.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ClasspathVMMethod.inc?rev=180468&r1=180467&r2=180468&view=diff
==============================================================================
--- vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ClasspathVMMethod.inc (original)
+++ vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ClasspathVMMethod.inc Thu Apr 25 12:13:44 2013
@@ -308,7 +308,10 @@ JavaObject* proceedVMMethod(JavaObjectVM
         vm->illegalArgumentException("<this> is not a valid type");
       }
 
-      if (isInterface(cl->access)) {
+      // If the given method is not implemented in the given class (e.g. a method
+      // declared in an interface, or declared abstract) then look for an implementation
+      // of it in the class of the given "this" object.
+      if (isInterface(cl->access) || isAbstract(meth->access)) {
         cl->initialiseClass(vm);
         UserClass* methodCl = 0;
         UserClass* lookup = objCl->isArray() ? objCl->super : objCl->asClass();





More information about the vmkit-commits mailing list