From 4a1ef53c0d35d29afa8f46607f22d908b12cea91 Mon Sep 17 00:00:00 2001 From: chiba Date: Fri, 16 May 2003 17:31:38 +0000 Subject: [PATCH] added isSuper() in MethodCall. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@17 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- Readme.html | 1 + src/main/javassist/expr/MethodCall.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Readme.html b/Readme.html index be433252..0a267f2a 100644 --- a/Readme.html +++ b/Readme.html @@ -245,6 +245,7 @@ see javassist.Dump.
  • CtClass.makeClassInitializer() has been added.
  • javassist.expr.Expr has been changed to a public class.
  • javassist.expr.Handler has been added. +
  • javassist.expr.MethodCall.isSuper() has been added.
  • CtMethod.isEmpty() and CtConstructor.isEmpty() have been added.
  • LoaderClassPath has been implemented. diff --git a/src/main/javassist/expr/MethodCall.java b/src/main/javassist/expr/MethodCall.java index 265677f5..06ea6418 100644 --- a/src/main/javassist/expr/MethodCall.java +++ b/src/main/javassist/expr/MethodCall.java @@ -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. -- 2.39.5