From bead430f64ef930897dc4d25c36b854fec2d3092 Mon Sep 17 00:00:00 2001 From: chiba Date: Fri, 3 Apr 2009 03:37:48 +0000 Subject: [PATCH] JASSIST-76 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@473 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- Readme.html | 2 +- src/main/javassist/compiler/MemberCodeGen.java | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Readme.html b/Readme.html index 28d2a1f6..e7d90560 100644 --- a/Readme.html +++ b/Readme.html @@ -283,7 +283,7 @@ see javassist.Dump.

-version 3.11

-version 3.10 on March 5, 2009 diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java index 72848036..892fc154 100644 --- a/src/main/javassist/compiler/MemberCodeGen.java +++ b/src/main/javassist/compiler/MemberCodeGen.java @@ -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); } -- 2.39.5