From: kkhan Date: Thu, 13 Jul 2006 19:19:36 +0000 (+0000) Subject: Be able to handle Class annotation attributes like void.class, int.class etc. X-Git-Tag: rel_3_17_1_ga~341 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=77aebc2d429bda3b0025754f52e4023d86ce48b5;p=javassist.git Be able to handle Class annotation attributes like void.class, int.class etc. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@291 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/bytecode/annotation/MemberValue.java b/src/main/javassist/bytecode/annotation/MemberValue.java index c976ddd3..cd2f3cc8 100644 --- a/src/main/javassist/bytecode/annotation/MemberValue.java +++ b/src/main/javassist/bytecode/annotation/MemberValue.java @@ -48,7 +48,43 @@ public abstract class MemberValue { static Class loadClass(ClassLoader cl, String classname) throws ClassNotFoundException { - return Class.forName(classname, true, cl); + if (classname.equals("void")) + { + return void.class; + } + if (classname.equals("int")) + { + return int.class; + } + if (classname.equals("byte")) + { + return byte.class; + } + if (classname.equals("long")) + { + return long.class; + } + if (classname.equals("double")) + { + return double.class; + } + if (classname.equals("float")) + { + return float.class; + } + if (classname.equals("char")) + { + return char.class; + } + if (classname.equals("short")) + { + return short.class; + } + if (classname.equals("boolean")) + { + return boolean.class; + } + return Class.forName(classname, true, cl); } /**