]> source.dussan.org Git - javassist.git/commitdiff
added isSuper() in MethodCall.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Fri, 16 May 2003 17:31:38 +0000 (17:31 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Fri, 16 May 2003 17:31:38 +0000 (17:31 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@17 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

Readme.html
src/main/javassist/expr/MethodCall.java

index be433252e1f19c04751c821ee3d77fc3be04fde3..0a267f2a73ee51ad7e5bd8f23efe1f4e9e1ccfdb 100644 (file)
@@ -245,6 +245,7 @@ see javassist.Dump.
   <li>CtClass.makeClassInitializer() has been added.
   <li>javassist.expr.Expr has been changed to a public class.
   <li>javassist.expr.Handler has been added.
+  <li>javassist.expr.MethodCall.isSuper() has been added.
   <li>CtMethod.isEmpty() and CtConstructor.isEmpty() have been added.
   <li>LoaderClassPath has been implemented.
 </ul>
index 265677f599773346b1a35794fa1a9797b1378b00..06ea641828aa9eeece6148fdd473b72e543d1fca 100644 (file)
@@ -127,6 +127,15 @@ public class MethodCall extends Expr {
         return super.mayThrow();
     }
 
+    /**
+     * Returns true if the called method is of a superclass of the current
+     * class.
+     */
+    boolean isSuper() {
+        return iterator.byteAt(currentPos) == INVOKESPECIAL
+            && !where().getDeclaringClass().getName().equals(getClassName());
+    }
+
     /*
      * Returns the parameter types of the called method.