aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2007-06-18 23:51:07 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2007-06-18 23:51:07 +0000
commit42a85cc5b90cd0909b7f429f002d702f5ab2a688 (patch)
tree8629f9be2b7f35679125143cdf1a9f513cbb4062 /src/main/javassist
parenteba5bad02a901809650a8d6471b2657423191749 (diff)
downloadjavassist-42a85cc5b90cd0909b7f429f002d702f5ab2a688.tar.gz
javassist-42a85cc5b90cd0909b7f429f002d702f5ab2a688.zip
fixed a bug of CtClassType#removeMehtod() etc.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@390 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist')
-rw-r--r--src/main/javassist/CtClass.java3
-rw-r--r--src/main/javassist/CtMember.java6
-rw-r--r--src/main/javassist/CtMethod.java18
3 files changed, 25 insertions, 2 deletions
diff --git a/src/main/javassist/CtClass.java b/src/main/javassist/CtClass.java
index a757ef0e..48a8ca21 100644
--- a/src/main/javassist/CtClass.java
+++ b/src/main/javassist/CtClass.java
@@ -560,6 +560,9 @@ public abstract class CtClass {
* to <code>addInterface()</code>; it appends <code>clazz</code> to
* the list of the super interfaces extended by that interface.
* Note that an interface can extend multiple super interfaces.
+ *
+ * @see #replaceClassName(String, String)
+ * @see #replaceClassName(ClassMap)
*/
public void setSuperclass(CtClass clazz) throws CannotCompileException {
checkModify();
diff --git a/src/main/javassist/CtMember.java b/src/main/javassist/CtMember.java
index 2fde6cee..16ccc536 100644
--- a/src/main/javassist/CtMember.java
+++ b/src/main/javassist/CtMember.java
@@ -106,9 +106,11 @@ public abstract class CtMember {
m.next = node.next;
if (node == methodTail)
methodTail = m;
- else if (node == consTail)
+
+ if (node == consTail)
consTail = m;
- else if (node == fieldTail)
+
+ if (node == fieldTail)
fieldTail = m;
break;
diff --git a/src/main/javassist/CtMethod.java b/src/main/javassist/CtMethod.java
index 158f21af..3ed6aa77 100644
--- a/src/main/javassist/CtMethod.java
+++ b/src/main/javassist/CtMethod.java
@@ -126,6 +126,24 @@ public final class CtMethod extends CtBehavior {
}
/**
+ * Creates a method from a <code>MethodInfo</code> object.
+ *
+ * @param declaring the class declaring the method.
+ * @throws CannotCompileException if the the <code>MethodInfo</code>
+ * object and the declaring class have different
+ * <code>ConstPool</code> objects
+ * @since 3.6
+ */
+ public static CtMethod make(MethodInfo minfo, CtClass declaring)
+ throws CannotCompileException
+ {
+ if (declaring.getClassFile2().getConstPool() != minfo.getConstPool())
+ throw new CannotCompileException("bad declaring class");
+
+ return new CtMethod(minfo, declaring);
+ }
+
+ /**
* Returns a hash code value for the method.
* If two methods have the same name and signature, then
* the hash codes for the two methods are equal.