From 77aebc2d429bda3b0025754f52e4023d86ce48b5 Mon Sep 17 00:00:00 2001 From: kkhan Date: Thu, 13 Jul 2006 19:19:36 +0000 Subject: [PATCH] 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 --- .../bytecode/annotation/MemberValue.java | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) 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); } /** -- 2.39.5