diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2005-11-04 09:29:35 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2005-11-04 09:29:35 +0000 |
commit | 7696279d0e1cbf5021ad38fb7328f223b94c1031 (patch) | |
tree | 3c432f56c58ec4ee1fc9aaeb8318edc80d47254f /src/main/javassist/CtClass.java | |
parent | eb12cc5d6bcbc25ea70f678321693971a0bd921c (diff) | |
download | javassist-7696279d0e1cbf5021ad38fb7328f223b94c1031.tar.gz javassist-7696279d0e1cbf5021ad38fb7328f223b94c1031.zip |
changed the behavior of CtClass#getMethods(), getFields(), and getConstructors().
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@217 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/CtClass.java')
-rw-r--r-- | src/main/javassist/CtClass.java | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/main/javassist/CtClass.java b/src/main/javassist/CtClass.java index c0962808..55f81b81 100644 --- a/src/main/javassist/CtClass.java +++ b/src/main/javassist/CtClass.java @@ -582,8 +582,8 @@ public abstract class CtClass { /** * Returns an array containing <code>CtField</code> objects - * representing all the public fields of the class. - * That array includes public fields inherited from the + * representing all the non-private fields of the class. + * That array includes non-private fields inherited from the * superclasses. */ public CtField[] getFields() { return new CtField[0]; } @@ -628,7 +628,7 @@ public abstract class CtClass { /** * Returns an array containing <code>CtConstructor</code> objects - * representing all the public constructors of the class. + * representing all the non-private constructors of the class. */ public CtConstructor[] getConstructors() { return new CtConstructor[0]; @@ -686,8 +686,8 @@ public abstract class CtClass { /** * Returns an array containing <code>CtMethod</code> objects - * representing all the public methods of the class. - * That array includes public methods inherited from the + * representing all the non-private methods of the class. + * That array includes pon-private methods inherited from the * superclasses. */ public CtMethod[] getMethods() { @@ -1043,12 +1043,13 @@ public abstract class CtClass { * is on by default. Otherwise, it is off. * * @param stop disallow pruning if true. Otherwise, allow. + * @return the previous status of pruning. true if pruning is already stopped. * * @see #detach() * @see #prune() * @see ClassPool#doPruning */ - public void stopPruning(boolean stop) {} + public boolean stopPruning(boolean stop) { return true; } /** * Discards unnecessary attributes, in particuar, @@ -1144,6 +1145,25 @@ public abstract class CtClass { } } + /** + * Writes a class file as <code>writeFile()</code> does although this + * method does not prune or freeze the class after writing the class + * file. Note that, once <code>writeFile()</code> or <code>toBytecode()</code> + * is called, it cannot be called again since the class is pruned and frozen. + * This method would be useful for debugging. + */ + public void debugWriteFile() { + try { + boolean p = stopPruning(true); + writeFile(); + defrost(); + stopPruning(p); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + static class DelayedFileOutputStream extends OutputStream { private FileOutputStream file; private String filename; |