From 5a6662f29d49404965a9138d323d09aafc12128e Mon Sep 17 00:00:00 2001 From: chibash Date: Tue, 6 Jan 2015 02:54:09 +0900 Subject: preparation for 3.19 release. fixed bugs in javadoc comments --- src/main/javassist/ByteArrayClassPath.java | 4 +- src/main/javassist/ClassClassPath.java | 4 +- src/main/javassist/ClassMap.java | 4 +- src/main/javassist/ClassPool.java | 8 +-- src/main/javassist/CodeConverter.java | 69 +++++++++++----------- src/main/javassist/CtClass.java | 24 ++++---- src/main/javassist/CtField.java | 28 ++++----- src/main/javassist/CtMethod.java | 10 ++-- src/main/javassist/CtNewConstructor.java | 26 ++++---- src/main/javassist/CtNewMethod.java | 32 +++++----- src/main/javassist/Loader.java | 28 ++++----- src/main/javassist/Translator.java | 4 +- src/main/javassist/URLClassPath.java | 4 +- .../bytecode/AnnotationDefaultAttribute.java | 12 ++-- .../javassist/bytecode/AnnotationsAttribute.java | 18 +++--- src/main/javassist/bytecode/Bytecode.java | 10 ++-- src/main/javassist/bytecode/ClassFile.java | 2 +- src/main/javassist/bytecode/MethodInfo.java | 4 +- .../javassist/bytecode/SignatureAttribute.java | 4 +- src/main/javassist/bytecode/StackMapTable.java | 12 ++-- .../bytecode/TypeAnnotationsAttribute.java | 2 + src/main/javassist/bytecode/analysis/Analyzer.java | 2 +- .../bytecode/annotation/AnnotationsWriter.java | 8 +-- .../bytecode/annotation/TypeAnnotationsWriter.java | 2 + src/main/javassist/expr/ExprEditor.java | 4 +- src/main/javassist/runtime/Desc.java | 2 +- src/main/javassist/tools/Dump.java | 2 +- src/main/javassist/tools/framedump.java | 2 +- .../javassist/tools/reflect/ClassMetaobject.java | 8 +-- src/main/javassist/tools/reflect/Compiler.java | 4 +- src/main/javassist/tools/reflect/Loader.java | 16 ++--- src/main/javassist/tools/reflect/Metaobject.java | 10 ++-- src/main/javassist/tools/reflect/Reflection.java | 8 +-- src/main/javassist/tools/rmi/ObjectImporter.java | 4 +- src/main/javassist/tools/rmi/StubGenerator.java | 4 +- src/main/javassist/tools/web/Viewer.java | 6 +- src/main/javassist/util/HotSwapper.java | 8 +-- src/main/javassist/util/proxy/ProxyFactory.java | 24 ++++---- 38 files changed, 214 insertions(+), 209 deletions(-) (limited to 'src/main/javassist') diff --git a/src/main/javassist/ByteArrayClassPath.java b/src/main/javassist/ByteArrayClassPath.java index c5a300dc..d385eddc 100644 --- a/src/main/javassist/ByteArrayClassPath.java +++ b/src/main/javassist/ByteArrayClassPath.java @@ -29,11 +29,11 @@ import java.net.MalformedURLException; * into a CtClass object representing the class with a name * classname, then do as following: * - * + * * *

The ClassPool object cp uses the created * ByteArrayClassPath object as the source of the class file. diff --git a/src/main/javassist/ClassClassPath.java b/src/main/javassist/ClassClassPath.java index c5c7eff5..3cb8790c 100644 --- a/src/main/javassist/ClassClassPath.java +++ b/src/main/javassist/ClassClassPath.java @@ -27,10 +27,10 @@ import java.net.URL; * with a user-defined class loader and any class files are not found with * the default ClassPool. For example, * - *

+ * * * This code snippet permanently adds a ClassClassPath * to the default ClassPool. Note that the default diff --git a/src/main/javassist/ClassMap.java b/src/main/javassist/ClassMap.java index f4e6a31d..a0bb9499 100644 --- a/src/main/javassist/ClassMap.java +++ b/src/main/javassist/ClassMap.java @@ -25,7 +25,7 @@ import javassist.bytecode.Descriptor; * definition or a method body. Define a subclass of this class * if a more complex mapping algorithm is needed. For example, * - * + * } * *

This subclass maps java.lang.String to * java2.lang.String. Note that get() diff --git a/src/main/javassist/ClassPool.java b/src/main/javassist/ClassPool.java index 5e006b81..f0bba3c5 100644 --- a/src/main/javassist/ClassPool.java +++ b/src/main/javassist/ClassPool.java @@ -213,9 +213,9 @@ public class ClassPool { *

When this method is called for the first time, the default * class pool is created with the following code snippet: * - *

+ * * *

If the default class pool cannot find any class files, * try ClassClassPath and LoaderClassPath. @@ -381,9 +381,9 @@ public class ClassPool { * This method is useful if you want to generate a new class as a copy * of another class (except the class name). For example, * - *

+ * * * returns a CtClass object representing Pair * class. The definition of Pair is the same as that of diff --git a/src/main/javassist/CodeConverter.java b/src/main/javassist/CodeConverter.java index 399454ec..bbc5c77d 100644 --- a/src/main/javassist/CodeConverter.java +++ b/src/main/javassist/CodeConverter.java @@ -29,7 +29,7 @@ import javassist.convert.*; * CtMethod.instrument() as a parameter. * *

Example: - *

+ * * *

This program substitutes "Singleton.makePoint()" * for all occurrences of "new Point()" @@ -59,22 +59,22 @@ public class CodeConverter { * Singleton, respectively) * replaces all occurrences of: * - *

+ *
new Point(x, y)
* * in the method body with: * - * + *
Singleton.createPoint(x, y)
* *

This enables to intercept instantiation of Point * and change the samentics. For example, the following * createPoint() implements the singleton pattern: * - *

+ * * *

The static method call substituted for the original new * expression must be @@ -109,11 +109,11 @@ public class CodeConverter { * Point2, respectively) * replaces all occurrences of: * - *

+ *
new Point(x, y)
* * in the method body with: * - * + *
new Point2(x, y)
* *

Note that Point2 must be type-compatible with Point. * It must have the same set of methods, fields, and constructors as the @@ -157,19 +157,19 @@ public class CodeConverter { * *

For example, the program below * - *

+ *
Point p = new Point();
+     * int newX = p.x + 3;
* *

can be translated into: * - *

+ *
Point p = new Point();
+     * int newX = Accessor.readX(p) + 3;
* *

where * - *

+ * } * *

The type of the parameter of readX() must * be java.lang.Object independently of the actual @@ -198,19 +198,19 @@ public class CodeConverter { * *

For example, the program below * - *

+ *
Point p = new Point();
+     * p.x = 3;
* *

can be translated into: * - *

+ *
Point p = new Point();
+     * Accessor.writeX(3);
* *

where * - *

+ * } * *

The type of the first parameter of writeX() must * be java.lang.Object independently of the actual @@ -401,27 +401,27 @@ public class CodeConverter { * method. For example, if the originally invoked method is * move(): * - *

+ * } * *

Then the before method must be something like this: * - *

+ * } * *

The CodeConverter would translate bytecode * equivalent to: * - *

+ *
Point p2 = p.move(x + y, 0);
* *

into the bytecode equivalent to: * - *

+ * Point p2 = p.move(tmp1, tmp2); * * @param origMethod the method originally invoked. * @param beforeMethod the method invoked before @@ -448,27 +448,28 @@ public class CodeConverter { * method. For example, if the originally invoked method is * move(): * - * + * } * *

Then the after method must be something like this: * - *

+ * } * *

The CodeConverter would translate bytecode * equivalent to: * - *

+ *
Point p2 = p.move(x + y, 0);
* *

into the bytecode equivalent to: * - *

+ * Verbose.print(p, tmp1, tmp2); * * @param origMethod the method originally invoked. * @param afterMethod the method invoked after diff --git a/src/main/javassist/CtClass.java b/src/main/javassist/CtClass.java index 79d7efcb..251cd10f 100644 --- a/src/main/javassist/CtClass.java +++ b/src/main/javassist/CtClass.java @@ -69,18 +69,18 @@ public abstract class CtClass { /** * The version number of this release. */ - public static final String version = "3.18.0-GA"; + public static final String version = "3.19.0-GA"; /** * Prints the version number and the copyright notice. * *

The following command invokes this method: * - *

+ *
java -jar javassist.jar
*/ public static void main(String[] args) { System.out.println("Javassist version " + CtClass.version); - System.out.println("Copyright (C) 1999-2013 Shigeru Chiba." + System.out.println("Copyright (C) 1999-2015 Shigeru Chiba." + " All Rights Reserved."); } @@ -415,7 +415,7 @@ public abstract class CtClass { * *

For example, * - *

class List {
+     * 
class List<T> {
      *     T value;
      *     T get() { return value; }
      *     void set(T v) { value = v; }
@@ -1095,11 +1095,11 @@ public abstract class CtClass {
      * Any regular Java expression can be used for specifying the initial
      * value.  The followings are examples.
      *
-     * 
    +     * 
          * cc.addField(f, "0")               // the initial value is 0.
          * cc.addField(f, "i + 1")           // i + 1.
          * cc.addField(f, "new Point()");    // a Point object.
    -     * 
+ *
* *

Here, the type of variable cc is CtClass. * The type of f is CtField. @@ -1129,11 +1129,11 @@ public abstract class CtClass { * *

For example, * - *

    +     * 
          * CtClass cc = ...;
          * addField(new CtField(CtClass.intType, "i", cc),
          *          CtField.Initializer.constant(1));
    -     * 
+ *
* *

This code adds an int field named "i". The * initial value of this field is 1. @@ -1168,9 +1168,9 @@ public abstract class CtClass { * javassist.bytecode package. For example, the following * expression returns all the attributes of a class file. * - *

+ * * * @param name attribute name * @see javassist.bytecode.AttributeInfo @@ -1193,9 +1193,9 @@ public abstract class CtClass { * javassist.bytecode package. For example, the following * expression adds an attribute info to a class file. * - * + * * * @param name attribute name * @param data attribute value diff --git a/src/main/javassist/CtField.java b/src/main/javassist/CtField.java index 16e450bf..dff540a0 100644 --- a/src/main/javassist/CtField.java +++ b/src/main/javassist/CtField.java @@ -144,9 +144,9 @@ public class CtField extends CtMember { * Compiles the given source code and creates a field. * Examples of the source code are: * - * + * "public int k = 3;" * *

Note that the source code ends with ';' * (semicolon). @@ -551,8 +551,7 @@ public class CtField extends CtMember { * value of the field. The constructor of the created object receives * the parameter: * - *

+ *

Object obj - the object including the field. * *

If the initialized field is static, then the constructor does * not receive any parameters. @@ -574,10 +573,9 @@ public class CtField extends CtMember { * value of the field. The constructor of the created object receives * the parameters: * - *

* *

If the initialized field is static, then the constructor * receives only strs. @@ -602,11 +600,10 @@ public class CtField extends CtMember { * value of the field. The constructor of the created object receives * the parameters: * - *

* *

If the initialized field is static, then the constructor does * not receive any parameters. @@ -631,13 +628,12 @@ public class CtField extends CtMember { * value of the field. The constructor of the created object receives * the parameters: * - *

* *

If the initialized field is static, then the constructor receives * only strs. @@ -662,8 +658,7 @@ public class CtField extends CtMember { * value as the initial value of the field. * The called method receives the parameters: * - *

+ *

Object obj - the object including the field. * *

If the initialized field is static, then the method does * not receive any parameters. @@ -692,10 +687,9 @@ public class CtField extends CtMember { * value as the initial value of the field. The called method * receives the parameters: * - *

* *

If the initialized field is static, then the method * receive only strs. @@ -727,11 +721,10 @@ public class CtField extends CtMember { * value as the initial value of the field. The called method * receives the parameters: * - *

* *

If the initialized field is static, then the method does * not receive any parameters. @@ -760,13 +753,12 @@ public class CtField extends CtMember { * value as the initial value of the field. The called method * receives the parameters: * - *

* *

If the initialized field is static, then the method * receive only strs. diff --git a/src/main/javassist/CtMethod.java b/src/main/javassist/CtMethod.java index 6291a0ea..2f657dfa 100644 --- a/src/main/javassist/CtMethod.java +++ b/src/main/javassist/CtMethod.java @@ -71,16 +71,18 @@ public final class CtMethod extends CtBehavior { *

For example, suppose that a method at() is as * follows: * - *

+ * } * *

(X is a class name.) If map substitutes * String for X, then the created method is: * - *

+ * } * *

By default, all the occurrences of the names of the class * declaring at() and the superclass are replaced diff --git a/src/main/javassist/CtNewConstructor.java b/src/main/javassist/CtNewConstructor.java index 606e1a3c..ecec642f 100644 --- a/src/main/javassist/CtNewConstructor.java +++ b/src/main/javassist/CtNewConstructor.java @@ -219,8 +219,8 @@ public class CtNewConstructor { * Object. The signature of the super's constructor * must be: * - *

+ *
constructor(Object[] params, <type> cvalue)
+     * 
* *

Here, cvalue is the constant value specified * by cparam. @@ -228,7 +228,7 @@ public class CtNewConstructor { *

If cparam is null, the signature * must be: * - *

+ *
constructor(Object[] params)
* *

If body is not null, a copy of that method is * embedded in the body of the created constructor. @@ -245,20 +245,20 @@ public class CtNewConstructor { * The method specified by body must have the * signature shown below: * - *

+ *
Object method(Object[] params, <type> cvalue)
* *

If cparam is null, the signature * must be: * - *

+ *
Object method(Object[] params)
* *

Although the type of the returned value is Object, * the value must be always null. * *

Example: * - *

+ * xclass.addConstructor(c); * *

where the class Sample is as follows: * - *

+ * } * *

This program produces the following class: * - *

+ * } * * @param parameters a list of the parameter types * @param exceptions a list of the exceptions diff --git a/src/main/javassist/CtNewMethod.java b/src/main/javassist/CtNewMethod.java index f134dcdd..48d8629a 100644 --- a/src/main/javassist/CtNewMethod.java +++ b/src/main/javassist/CtNewMethod.java @@ -34,7 +34,7 @@ public class CtNewMethod { * The source code must include not only the method body * but the whole declaration, for example, * - * + *
"public Object id(Object obj) { return obj; }"
* * @param src the source text. * @param declaring the class to which the created method is added. @@ -50,7 +50,7 @@ public class CtNewMethod { * The source code must include not only the method body * but the whole declaration, for example, * - * + *
"public Object id(Object obj) { return obj; }"
* *

If the source code includes $proceed(), then * it is compiled into a method call on the specified object. @@ -307,9 +307,10 @@ public class CtNewMethod { * *

The following method is an example of the created method. * - *

+ * } * *

The name of the created method can be changed by * setName(). @@ -377,15 +378,14 @@ public class CtNewMethod { * *

The method specified by body must have this singature: * - *

+ *
Object method(Object[] params, <type> cvalue)
* *

The type of the cvalue depends on * constParam. * If constParam is null, the signature * must be: * - *

+ *
Object method(Object[] params)
* *

The method body copied from body is wrapped in * parameter-conversion code, which converts parameters specified by @@ -394,12 +394,13 @@ public class CtNewMethod { * type to the type specified by returnType. Thus, * the resulting method body is as follows: * - *

+ * * *

The variables p0, p2, ... represent * formal parameters of the created method. @@ -413,7 +414,8 @@ public class CtNewMethod { * *

Example: * - *

+ * vec.addMethod(m); * *

where the class Sample is as follows: * - *

+ * } * *

This program produces a class intVector: * - *

+ * } * *

Note that the type of the parameter to add() depends * only on the value of argTypes passed to diff --git a/src/main/javassist/Loader.java b/src/main/javassist/Loader.java index efbcf732..bda1432d 100644 --- a/src/main/javassist/Loader.java +++ b/src/main/javassist/Loader.java @@ -40,7 +40,7 @@ import java.security.ProtectionDomain; * The startup program of an application using MyTranslator * should be something like this: * - *

+ * * *

Class MyApp is the main program of the application. * *

This program should be executed as follows: * - *

+ * * *

It modifies the class MyApp with a MyTranslator * object before the JVM loads it. @@ -69,9 +69,9 @@ import java.security.ProtectionDomain; * *

This program execution is equivalent to: * - *

+ * * *

except that classes are translated by MyTranslator * at load time. @@ -81,12 +81,12 @@ import java.security.ProtectionDomain; * unnecessary. For example, if only a class test.Rectangle * is modified, the main() method above will be the following: * - *

+ * cl.run("MyApp", args); * *

This program changes the super class of the test.Rectangle * class. @@ -246,9 +246,9 @@ public class Loader extends ClassLoader { * * @param args command line parameters. *

* * @see javassist.Loader#run(String[]) @@ -263,9 +263,9 @@ public class Loader extends ClassLoader { * * @param args command line parameters. * */ public void run(String[] args) throws Throwable { diff --git a/src/main/javassist/Translator.java b/src/main/javassist/Translator.java index 78e97e88..c1695944 100644 --- a/src/main/javassist/Translator.java +++ b/src/main/javassist/Translator.java @@ -47,8 +47,8 @@ public interface Translator { * Is invoked by a Loader for notifying that * a class is loaded. The Loader calls * - * + *
+     * pool.get(classname).toBytecode()
* * to read the class file after onLoad() returns. * diff --git a/src/main/javassist/URLClassPath.java b/src/main/javassist/URLClassPath.java index c0019449..bea0b3c2 100644 --- a/src/main/javassist/URLClassPath.java +++ b/src/main/javassist/URLClassPath.java @@ -41,8 +41,8 @@ public class URLClassPath implements ClassPath { * "org.javassist.test.Main", then the given URL is used for loading that class. * The URLClassPath obtains a class file from: * - * + *
http://www.javassist.org:80/java/classes/org/javassist/test/Main.class
+     * 
* *

Here, we assume that host is "www.javassist.org", * port is 80, and directory is "/java/classes/". diff --git a/src/main/javassist/bytecode/AnnotationDefaultAttribute.java b/src/main/javassist/bytecode/AnnotationDefaultAttribute.java index 17a3cd46..7379b412 100644 --- a/src/main/javassist/bytecode/AnnotationDefaultAttribute.java +++ b/src/main/javassist/bytecode/AnnotationDefaultAttribute.java @@ -30,18 +30,18 @@ import java.util.Map; * *

For example, if you declare the following annotation type: * - *

+ * * *

The defautl values of name and age * are stored as annotation default attributes in Author.class. * The following code snippet obtains the default value of name: * - *

+ * * *

If the following statement is executed after the code above, * the default value of age is set to 80: * - *

+ * * * @see AnnotationsAttribute * @see javassist.bytecode.annotation.MemberValue diff --git a/src/main/javassist/bytecode/AnnotationsAttribute.java b/src/main/javassist/bytecode/AnnotationsAttribute.java index 38b88eaa..d1d5b988 100644 --- a/src/main/javassist/bytecode/AnnotationsAttribute.java +++ b/src/main/javassist/bytecode/AnnotationsAttribute.java @@ -39,7 +39,7 @@ import javassist.bytecode.annotation.*; * *

For example, * - *

+ * * *

This code snippet retrieves an annotation of the type Author * from the MethodInfo object specified by minfo. @@ -57,17 +57,17 @@ import javassist.bytecode.annotation.*; * *

If the annotation type Author is annotated by a meta annotation: * - *

+ * * *

Then Author is visible at runtime. Therefore, the third * statement of the code snippet above must be changed into: * - *

+ * * *

The attribute tag must be visibleTag instead of * invisibleTag. @@ -83,7 +83,7 @@ import javassist.bytecode.annotation.*; *

If you want to record a new AnnotationAttribute object, execute the * following snippet: * - *

+ * * *

The last statement is necessary if the class file was produced by * javac of JDK 1.4 or earlier. Otherwise, it is not necessary. @@ -258,7 +258,7 @@ public class AnnotationsAttribute extends AttributeInfo { /** * Changes the annotations. A call to this method is equivalent to: - *

+ *
setAnnotations(new Annotation[] { annotation })
* * @param annotation the data structure representing * the new annotation. diff --git a/src/main/javassist/bytecode/Bytecode.java b/src/main/javassist/bytecode/Bytecode.java index 051619d1..282a01a3 100644 --- a/src/main/javassist/bytecode/Bytecode.java +++ b/src/main/javassist/bytecode/Bytecode.java @@ -96,17 +96,19 @@ class ByteVector implements Cloneable { *

A Bytecode object is an unbounded array * containing bytecode. For example, * - *

+ * CodeAttribute ca = b.toCodeAttribute(); * *

This program produces a Code attribute including a bytecode * sequence: * - *

+ *
+ * iconst_3
+ * ireturn
* * @see ConstPool * @see CodeAttribute diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java index 7a308adb..cc7cae59 100644 --- a/src/main/javassist/bytecode/ClassFile.java +++ b/src/main/javassist/bytecode/ClassFile.java @@ -319,7 +319,7 @@ public final class ClassFile { * *

The returned value is obtained from inner_class_access_flags * of the entry representing this nested class itself - * in InnerClasses_attribute>. + * in InnerClasses_attribute. */ public int getInnerAccessFlags() { InnerClassesAttribute ica diff --git a/src/main/javassist/bytecode/MethodInfo.java b/src/main/javassist/bytecode/MethodInfo.java index 1db524ce..df436dda 100644 --- a/src/main/javassist/bytecode/MethodInfo.java +++ b/src/main/javassist/bytecode/MethodInfo.java @@ -52,13 +52,13 @@ public class MethodInfo { public static boolean doPreverify = false; /** - * The name of constructors: <init>. + * The name of constructors: <init>. */ public static final String nameInit = ""; /** * The name of class initializer (static initializer): - * <clinit>. + * <clinit>. */ public static final String nameClinit = ""; diff --git a/src/main/javassist/bytecode/SignatureAttribute.java b/src/main/javassist/bytecode/SignatureAttribute.java index 1e148085..92064ee4 100644 --- a/src/main/javassist/bytecode/SignatureAttribute.java +++ b/src/main/javassist/bytecode/SignatureAttribute.java @@ -377,7 +377,7 @@ public class SignatureAttribute extends AttributeInfo { /** * Constructs a TypeParameter representing a type parametre - * like <T extends ... >. + * like <T extends ... >. * * @param name parameter name. * @param superClass an upper bound class-type (or null). @@ -394,7 +394,7 @@ public class SignatureAttribute extends AttributeInfo { /** * Constructs a TypeParameter representing a type parameter - * like <T>. + * like <T>. * * @param name parameter name. */ diff --git a/src/main/javassist/bytecode/StackMapTable.java b/src/main/javassist/bytecode/StackMapTable.java index 08770afc..a02d5e72 100644 --- a/src/main/javassist/bytecode/StackMapTable.java +++ b/src/main/javassist/bytecode/StackMapTable.java @@ -272,7 +272,7 @@ public class StackMapTable extends AttributeInfo { * * @param pos the position. * @param offsetDelta - * @param k the k last locals are absent. + * @param k the k last locals are absent. */ public void chopFrame(int pos, int offsetDelta, int k) throws BadBytecode {} @@ -307,7 +307,7 @@ public class StackMapTable extends AttributeInfo { * @param offsetDelta * @param tags locals[i].tag. * @param data locals[i].cpool_index - * or locals[i].offset. + * or locals[i].offset. */ public void appendFrame(int pos, int offsetDelta, int[] tags, int[] data) throws BadBytecode {} @@ -594,7 +594,7 @@ public class StackMapTable extends AttributeInfo { * @param tag stack[0].tag. * @param data stack[0].cpool_index * if the tag is OBJECT, - * or stack[0].offset + * or stack[0].offset * if the tag is UNINIT. * Otherwise, this parameter is not used. */ @@ -630,7 +630,7 @@ public class StackMapTable extends AttributeInfo { * either 1, 2, or 3. * @param data locals[].cpool_index * if the tag is OBJECT, - * or locals[].offset + * or locals[].offset * if the tag is UNINIT. * Otherwise, this parameter is not used. */ @@ -652,13 +652,13 @@ public class StackMapTable extends AttributeInfo { * @param localTags locals[].tag. * @param localData locals[].cpool_index * if the tag is OBJECT, - * or locals[].offset + * or locals[].offset * if the tag is UNINIT. * Otherwise, this parameter is not used. * @param stackTags stack[].tag. * @param stackData stack[].cpool_index * if the tag is OBJECT, - * or stack[].offset + * or stack[].offset * if the tag is UNINIT. * Otherwise, this parameter is not used. */ diff --git a/src/main/javassist/bytecode/TypeAnnotationsAttribute.java b/src/main/javassist/bytecode/TypeAnnotationsAttribute.java index 67706208..454401a9 100644 --- a/src/main/javassist/bytecode/TypeAnnotationsAttribute.java +++ b/src/main/javassist/bytecode/TypeAnnotationsAttribute.java @@ -10,6 +10,8 @@ import javassist.bytecode.annotation.TypeAnnotationsWriter; * A class representing * {@code RuntimeVisibleTypeAnnotations} attribute and * {@code RuntimeInvisibleTypeAnnotations} attribute. + * + * @since 3.19 */ public class TypeAnnotationsAttribute extends AttributeInfo { /** diff --git a/src/main/javassist/bytecode/analysis/Analyzer.java b/src/main/javassist/bytecode/analysis/Analyzer.java index 9a0b991a..23a7cc02 100644 --- a/src/main/javassist/bytecode/analysis/Analyzer.java +++ b/src/main/javassist/bytecode/analysis/Analyzer.java @@ -43,7 +43,7 @@ import javassist.bytecode.Opcode; * // Method to analyze * public Object doSomething(int x) { * Number n; - * if (x < 5) { + * if (x < 5) { * n = new Double(0); * } else { * n = new Long(0); diff --git a/src/main/javassist/bytecode/annotation/AnnotationsWriter.java b/src/main/javassist/bytecode/annotation/AnnotationsWriter.java index b366acb8..e2203d4e 100644 --- a/src/main/javassist/bytecode/annotation/AnnotationsWriter.java +++ b/src/main/javassist/bytecode/annotation/AnnotationsWriter.java @@ -28,7 +28,7 @@ import javassist.bytecode.ConstPool; * *

The following code snippet is an example of use of this class: * - *

+ * * *

The code snippet above generates the annotation attribute * corresponding to this annotation: * - *

+ * * * @see javassist.bytecode.AnnotationsAttribute * @see javassist.bytecode.ParameterAnnotationsAttribute diff --git a/src/main/javassist/bytecode/annotation/TypeAnnotationsWriter.java b/src/main/javassist/bytecode/annotation/TypeAnnotationsWriter.java index a1932e05..d9a61692 100644 --- a/src/main/javassist/bytecode/annotation/TypeAnnotationsWriter.java +++ b/src/main/javassist/bytecode/annotation/TypeAnnotationsWriter.java @@ -9,6 +9,8 @@ import javassist.bytecode.ConstPool; * A convenience class for constructing a * {@code ..TypeAnnotations_attribute}. * See the source code of the {@link javassist.bytecode.TypeAnnotationsAttribute} class. + * + * @since 3.19 */ public class TypeAnnotationsWriter extends AnnotationsWriter { /** diff --git a/src/main/javassist/expr/ExprEditor.java b/src/main/javassist/expr/ExprEditor.java index 6e7f8705..107b62a1 100644 --- a/src/main/javassist/expr/ExprEditor.java +++ b/src/main/javassist/expr/ExprEditor.java @@ -40,7 +40,7 @@ import javassist.CannotCompileException; * *

The following code is an example: * - *

+ * * *

This code inspects all method calls appearing in the method represented * by cm and it prints the names and the line numbers of the diff --git a/src/main/javassist/runtime/Desc.java b/src/main/javassist/runtime/Desc.java index 0b1cef51..342bab12 100644 --- a/src/main/javassist/runtime/Desc.java +++ b/src/main/javassist/runtime/Desc.java @@ -28,7 +28,7 @@ public class Desc { * Specifies how a java.lang.Class object is loaded. * *

If true, it is loaded by: - *

+ *
Thread.currentThread().getContextClassLoader().loadClass()
*

If false, it is loaded by Class.forName(). * The default value is false. */ diff --git a/src/main/javassist/tools/Dump.java b/src/main/javassist/tools/Dump.java index 672d1d09..b22825e0 100644 --- a/src/main/javassist/tools/Dump.java +++ b/src/main/javassist/tools/Dump.java @@ -26,7 +26,7 @@ import javassist.bytecode.ClassFilePrinter; * the class file is broken. * *

For example, - *

+ *
% java javassist.tools.Dump foo.class
* *

prints the contents of the constant pool and the list of methods * and fields. diff --git a/src/main/javassist/tools/framedump.java b/src/main/javassist/tools/framedump.java index 43a2beb6..57c21c8b 100644 --- a/src/main/javassist/tools/framedump.java +++ b/src/main/javassist/tools/framedump.java @@ -24,7 +24,7 @@ import javassist.bytecode.analysis.FramePrinter; * of all methods in a class. * *

For example, - *

+ *
% java javassist.tools.framedump foo.class
*/ public class framedump { private framedump() {} diff --git a/src/main/javassist/tools/reflect/ClassMetaobject.java b/src/main/javassist/tools/reflect/ClassMetaobject.java index e6a933cd..6b6e3cae 100644 --- a/src/main/javassist/tools/reflect/ClassMetaobject.java +++ b/src/main/javassist/tools/reflect/ClassMetaobject.java @@ -33,8 +33,8 @@ import java.io.ObjectOutputStream; *

To obtain a class metaobject, calls _getClass() * on a reflective object. For example, * - *

+ *
ClassMetaobject cm = ((Metalevel)reflectiveObject)._getClass();
+ * 
* * @see javassist.tools.reflect.Metaobject * @see javassist.tools.reflect.Metalevel @@ -56,7 +56,7 @@ public class ClassMetaobject implements Serializable { * Specifies how a java.lang.Class object is loaded. * *

If true, it is loaded by: - *

+ *
Thread.currentThread().getContextClassLoader().loadClass()
*

If false, it is loaded by Class.forName(). * The default value is false. */ @@ -337,7 +337,7 @@ public class ClassMetaobject implements Serializable { * original name. * *

This method is useful, in conjuction with - * ClassMetaobject#getMethod(), to obtain a quick reference + * {@link ClassMetaobject#getMethod()}, to obtain a quick reference * to the original method in the reflected class (i.e. not the proxy * method), using the original name of the method. * diff --git a/src/main/javassist/tools/reflect/Compiler.java b/src/main/javassist/tools/reflect/Compiler.java index ce925ea7..3114fd89 100644 --- a/src/main/javassist/tools/reflect/Compiler.java +++ b/src/main/javassist/tools/reflect/Compiler.java @@ -50,8 +50,8 @@ class CompiledClass { * by that class name is not reflective. * *

For example, - *

+ *
% java Compiler Dog -m MetaDog -c CMetaDog Cat -m MetaCat Cow
+ * 
* *

modifies class files Dog.class, Cat.class, * and Cow.class. diff --git a/src/main/javassist/tools/reflect/Loader.java b/src/main/javassist/tools/reflect/Loader.java index 3a4a3f62..36de3d6e 100644 --- a/src/main/javassist/tools/reflect/Loader.java +++ b/src/main/javassist/tools/reflect/Loader.java @@ -27,7 +27,7 @@ import javassist.ClassPool; * including a reflective class, * you must write a start-up program as follows: * - *

+ * * *

Then run this program as follows: * - *

+ *
% java javassist.tools.reflect.Loader Main arg1, ...
* *

This command runs Main.main() with arg1, ... * and Main.main() runs MyApp.main() with @@ -52,7 +52,7 @@ import javassist.ClassPool; * *

Also, you can run MyApp in a slightly different way: * - *

+ * * *

This program is run as follows: * - *

+ *
% java Main2 arg1, ...
* *

The difference from the former one is that the class Main * is loaded by javassist.tools.reflect.Loader whereas the class @@ -78,7 +78,7 @@ import javassist.ClassPool; * *

The class Main2 is equivalent to this class: * - *

+ * * *

Note: * diff --git a/src/main/javassist/tools/reflect/Metaobject.java b/src/main/javassist/tools/reflect/Metaobject.java index 181517a6..91a6126e 100644 --- a/src/main/javassist/tools/reflect/Metaobject.java +++ b/src/main/javassist/tools/reflect/Metaobject.java @@ -37,8 +37,9 @@ import java.io.ObjectOutputStream; *

To obtain a metaobject, calls _getMetaobject() * on a reflective object. For example, * - *

+ *
+ * Metaobject m = ((Metalevel)reflectiveObject)._getMetaobject();
+ * 
* * @see javassist.tools.reflect.ClassMetaobject * @see javassist.tools.reflect.Metalevel @@ -199,7 +200,8 @@ public class Metaobject implements Serializable { *

Note: this method is not invoked if the base-level method * is invoked by a constructor in the super class. For example, * - *

+ * } * *

if an instance of B is created, * the invocation of initialize() in B is intercepted only once. diff --git a/src/main/javassist/tools/reflect/Reflection.java b/src/main/javassist/tools/reflect/Reflection.java index 30f8bb79..406ce3d5 100644 --- a/src/main/javassist/tools/reflect/Reflection.java +++ b/src/main/javassist/tools/reflect/Reflection.java @@ -35,16 +35,16 @@ import javassist.bytecode.MethodInfo; * *

To do this, the original class file representing a reflective class: * - *

+ * * *

is modified so that it represents a class: * - *

+ * * * @see javassist.tools.reflect.ClassMetaobject * @see javassist.tools.reflect.Metaobject diff --git a/src/main/javassist/tools/rmi/ObjectImporter.java b/src/main/javassist/tools/rmi/ObjectImporter.java index d909dae5..476ec3c8 100644 --- a/src/main/javassist/tools/rmi/ObjectImporter.java +++ b/src/main/javassist/tools/rmi/ObjectImporter.java @@ -100,10 +100,10 @@ public class ObjectImporter implements java.io.Serializable { *

If you run a program with javassist.tools.web.Viewer, * you can construct an object importer as follows: * - *

+ * * * @see javassist.tools.web.Viewer */ diff --git a/src/main/javassist/tools/rmi/StubGenerator.java b/src/main/javassist/tools/rmi/StubGenerator.java index e42e6d65..6fc8dbcf 100644 --- a/src/main/javassist/tools/rmi/StubGenerator.java +++ b/src/main/javassist/tools/rmi/StubGenerator.java @@ -26,7 +26,7 @@ import javassist.CtMethod.ConstParameter; * *

The proxy class for class A is as follows: * - *

+ * } * *

Instances of the proxy class is created by an * ObjectImporter object. diff --git a/src/main/javassist/tools/web/Viewer.java b/src/main/javassist/tools/web/Viewer.java index ec7addd3..69fe3536 100644 --- a/src/main/javassist/tools/web/Viewer.java +++ b/src/main/javassist/tools/web/Viewer.java @@ -28,7 +28,7 @@ import java.net.*; * *

To run, you should type: * - *

+ *
% java javassist.tools.web.Viewer host port Main arg1, ...
* *

This command calls Main.main() with arg1,... * All classes including Main are fetched from @@ -42,10 +42,10 @@ import java.net.*; * a program loaded by this object can call a method in Viewer. * For example, you can write something like this: * - *

+ * * */ public class Viewer extends ClassLoader { diff --git a/src/main/javassist/util/HotSwapper.java b/src/main/javassist/util/HotSwapper.java index 75ab1b86..9028f2aa 100644 --- a/src/main/javassist/util/HotSwapper.java +++ b/src/main/javassist/util/HotSwapper.java @@ -29,7 +29,7 @@ class Trigger { /** * A utility class for dynamically reloading a class by - * the Java Platform Debugger Architecture (JPDA), or HotSwap. + * the Java Platform Debugger Architecture (JPDA), or HotSwap. * It works only with JDK 1.4 and later. * *

Note: The new definition of the reloaded class must declare @@ -40,12 +40,10 @@ class Trigger { *

To use this class, the JVM must be launched with the following * command line options: * - *

* *

Note that 8000 is the port number used by HotSwapper. * Any port number can be specified. Since HotSwapper does not @@ -57,12 +55,12 @@ class Trigger { * *

Using HotSwapper is easy. See the following example: * - *

+ * * *

reload() * first unload the Test class and load a new version of diff --git a/src/main/javassist/util/proxy/ProxyFactory.java b/src/main/javassist/util/proxy/ProxyFactory.java index 34d67179..8c43fa65 100644 --- a/src/main/javassist/util/proxy/ProxyFactory.java +++ b/src/main/javassist/util/proxy/ProxyFactory.java @@ -46,7 +46,7 @@ import javassist.bytecode.*; * *

For example, if the following code is executed, * - *

+ * * *

Here, Method is java.lang.reflect.Method.

* @@ -73,40 +73,40 @@ import javassist.bytecode.*; * mi and prints a message before executing the originally called method * bar() in Foo. * - * + * * *

The last three lines of the code shown above can be replaced with a call to * the helper method create, which generates a proxy class, instantiates * it, and sets the method handler of the instance: * - *

+ * * *

To change the method handler during runtime, * execute the following code: * - *

+ * * *

If setHandler is never called for a proxy instance then it will * employ the default handler which proceeds by invoking the original method. * The behaviour of the default handler is identical to the following * handler: * - *

+ * * *

A proxy factory caches and reuses proxy classes by default. It is possible to reset * this default globally by setting static field {@link ProxyFactory#useCache} to false. @@ -592,13 +592,13 @@ public class ProxyFactory { * implementation. * *

Example: - *

+ * * * @since 3.4 */ -- cgit v1.2.3