From e2cfbeaed7be298c93251f6f9af480cdba84f68f Mon Sep 17 00:00:00 2001 From: chiba Date: Sun, 17 Jun 2012 15:01:27 +0000 Subject: implemented JASSIST-170 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@639 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- tutorial/tutorial.html | 3 ++- tutorial/tutorial3.html | 30 ++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'tutorial') diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html index 44bfd9eb..f7bb622a 100644 --- a/tutorial/tutorial.html +++ b/tutorial/tutorial.html @@ -26,7 +26,8 @@ Shigeru Chiba
6. Generics
7. Varargs
8. J2ME -
9. Debug +
9. Boxing/Unboxing +
10. Debug


diff --git a/tutorial/tutorial3.html b/tutorial/tutorial3.html index e07372bd..7c505e0b 100644 --- a/tutorial/tutorial3.html +++ b/tutorial/tutorial3.html @@ -28,7 +28,9 @@

8. J2ME -

9. Debug +

9. Boxing/Unboxing + +

10. Debug


@@ -296,6 +298,11 @@ public Object get() { return value; }

Note that no type parameters are necessary. +

However, if you need to make type parameters accessible through reflection +during runtime, you have to add generic signatures to the class file. +For more details, see the API documentation (javadoc) of the +setGenericSignature method in the CtClass. +


7. Varargs

@@ -359,7 +366,26 @@ objects, call the getDeclaredMethods method on a CtClass
-

9. Debug

+

9. Boxing/Unboxing

+ +

Boxing and unboxing in Java are syntactic sugar. There is no bytecode for +boxing or unboxing. So the compiler of Javassist does not support them. +For example, the following statement is valid in Java: + +

    +Integer i = 3;
    +
+ +

since boxing is implicitly performed. For Javassist, however, you must explicitly +convert a value type from int to Integer: + +

    +Integer i = new Integer(3);
    +
+ +


+ +

10. Debug

Set CtClass.debugDump to a directory name. Then all class files modified and generated by Javassist are saved in that -- cgit v1.2.3