]> source.dussan.org Git - javassist.git/commitdiff
If a newly created method does not have a throws clause, an empty
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sun, 15 Feb 2004 12:40:52 +0000 (12:40 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sun, 15 Feb 2004 12:40:52 +0000 (12:40 +0000)
Exceptions attribute had been added.  This problem has been fixed.

git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@69 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/ByteArrayClassPath.java
src/main/javassist/ClassPool.java
src/main/javassist/CtBehavior.java
src/main/javassist/CtClass.java
src/main/javassist/package.html

index d001ce87dfc2696ecfb1f1b42ea6da19d23c633f..5e30249d6fa55357471958cd3b5728cfde93f357 100644 (file)
@@ -43,6 +43,7 @@ import java.net.MalformedURLException;
  * @see javassist.ClassPath
  * @see ClassPool#insertClassPath(ClassPath)
  * @see ClassPool#appendClassPath(ClassPath)
+ * @see ClassPool#makeClass(InputStream)
  */
 public class ByteArrayClassPath implements ClassPath {
     protected String classname;
index 68796a4029db87e0eaf2d237fd135f9e8a6ccf43..4e00b3352c0fcb35fd015573a543f0638e5210ae 100644 (file)
@@ -662,6 +662,7 @@ public class ClassPool {
      * @param classfile         class file.
      * @exception RuntimeException      if there is a frozen class with the
      *                                  the same name.
+     * @see javassist.ByteArrayClassPath
      */
     public CtClass makeClass(InputStream classfile)
         throws IOException, RuntimeException
index ea2564824478ff0faba52d1bae6b999753f44a5b..01f907cf47dd82fd65a48b9b94281b79f6bdbb4f 100644 (file)
@@ -109,6 +109,8 @@ public abstract class CtBehavior extends CtMember {
 
     /**
      * Obtains exceptions that this method/constructor may throw.
+     *
+     * @return a zero-length array if there is no throws clause.
      */
     public CtClass[] getExceptionTypes() throws NotFoundException {
         String[] exceptions;
@@ -126,7 +128,7 @@ public abstract class CtBehavior extends CtMember {
      */
     public void setExceptionTypes(CtClass[] types) throws NotFoundException {
         declaringClass.checkModify();
-        if (types == null) {
+        if (types == null || types.length == 0) {
             methodInfo.removeExceptionsAttribute();
             return;
         }
index 268c40f108e9fb197797b064ca167a517ab0bdd0..4c6f7bd77d1903aa782e79577e5ca51d153eadb7 100644 (file)
@@ -40,6 +40,10 @@ public abstract class CtClass {
 
     /**
      * Prints the version number and the copyright notice.
+     *
+     * <p>The following command invokes this method:
+     *
+     * <ul><pre>java -jar javassist.jar</pre></ul>
      */
     public static void main(String[] args) {
         System.out.println("Javassist version " + CtClass.version);
index 1b6e4b943a34791d2ef01d1a07f6890479da3630..f5b66b98f6fc187c5dbc23c2545816b865347782 100644 (file)
@@ -2,13 +2,21 @@
 <body>
 The Javassist Core API.
 
-<p>Javassist (<i>Java</i> programming <i>assist</i>ant) is yet another
-reflective system for Java.  It is a class library for editing
+<p>Javassist (<i>Java</i> programming <i>assist</i>ant) makes bytecode
+engineering simple.  It is a class library for editing
 bytecode in Java; it enables Java programs to define a new class at
 runtime and to modify a given class file when the JVM loads it.
 
 <p>The most significant class of this package is <code>CtClass</code>.
 See the description of this class first.
 
+<p>To know the version number of this package, type the following command:
+
+<ul><pre>
+java -jar javassist.jar
+</pre></ul>
+
+<p>It prints the version number on the console.
+
 </body>
 </html>