]> source.dussan.org Git - javassist.git/commitdiff
Be able to handle Class annotation attributes like void.class, int.class etc.
authorkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Thu, 13 Jul 2006 19:19:36 +0000 (19:19 +0000)
committerkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Thu, 13 Jul 2006 19:19:36 +0000 (19:19 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@291 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/bytecode/annotation/MemberValue.java

index c976ddd386f9a8979fed906d85cef4598e3b6da3..cd2f3cc83dd6bafd8aee677469efb497242f980e 100644 (file)
@@ -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);
     }
 
     /**