Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
Description
As reported by Takeshi Kondo in http://www.qos.ch/pipermail/cal10n-dev/2009-September/000280.html
Quoting Takeshi:
I found a trivial bug.
>> MessageConveyor #68
> String resouceBundleName =
AnnotationExtractor.getResourceBundleName(key
> .getClass());
Enum#getClass() is specific as follows.
public enum MSG{
A,
B
}
public static void main(String[] args){
System.out.println(MSG.A.getClass()); // -> $MSG
System.out.println(MSG.B.getClass()); // -> $MSG$1
System.out.println(MSG.B.getDeclaringClass()); // $MSG
}
If we need to get enum class form instance, we have to call
Enum#getDeclaringClass().