]> source.dussan.org Git - javassist.git/commitdiff
JASSIST-76
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Fri, 3 Apr 2009 03:37:48 +0000 (03:37 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Fri, 3 Apr 2009 03:37:48 +0000 (03:37 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@473 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

Readme.html
src/main/javassist/compiler/MemberCodeGen.java

index 28d2a1f6a66f679569d46fb257399e4654b017a4..e7d90560885ef4ff0262244955e739bee1c24855 100644 (file)
@@ -283,7 +283,7 @@ see javassist.Dump.
 
 <p>-version 3.11
 <ul>
-       <li>JIRA JASSIST-74, 75 was fixed.
+       <li>JIRA JASSIST-74, 75, 76 were fixed.
 </ul>
 
 <p>-version 3.10 on March 5, 2009
index 72848036afaf19532f67aaa5b1451de1f8bf7b3d..892fc1545e1dbb3ca98d60db05d6844e5620cfec 100644 (file)
@@ -632,13 +632,19 @@ public class MemberCodeGen extends CodeGen {
         }
         else if (isSpecial)    // if (isSpecial && notStatic(acc))
             bytecode.addInvokespecial(declClass, mname, desc);
-        else if (declClass.isInterface())
-            bytecode.addInvokeinterface(declClass, mname, desc, count);
-        else
-            if (isStatic)
-                throw new CompileError(mname + " is not static");
+        else {
+            if (!Modifier.isPublic(declClass.getModifiers())
+                || declClass.isInterface() != targetClass.isInterface())
+                declClass = targetClass;
+
+            if (declClass.isInterface())
+                bytecode.addInvokeinterface(declClass, mname, desc, count);
             else
-                bytecode.addInvokevirtual(declClass, mname, desc);
+                if (isStatic)
+                    throw new CompileError(mname + " is not static");
+                else
+                    bytecode.addInvokevirtual(declClass, mname, desc);
+        }
 
         setReturnType(desc, isStatic, popTarget);
     }