For enums generate the full path to the Enum type to avoid collisions such as enum Model and enum Model used in the same class.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4376 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kshakir 2010-09-29 05:28:59 +00:00
parent cfebe5c731
commit 6df7f9318f
1 changed files with 9 additions and 1 deletions

View File

@ -131,7 +131,8 @@ public abstract class ArgumentField {
importClasses.add(this.getAnnotationIOClass());
Class<?> innerType = this.getInnerType();
if (innerType != null)
importClasses.add(innerType);
if (!innerType.isEnum()) // see getType()
importClasses.add(innerType);
return importClasses;
}
@ -182,6 +183,13 @@ public abstract class ArgumentField {
* @return the simple name of the class.
*/
protected static String getType(Class<?> argType) {
// Special case for enums.
// Return the full path as sometimes two enums
// used in the same class have the same name
// ex: Model and Model
if (argType.isEnum())
return argType.getName().replace("$", ".");
String type = argType.getSimpleName();
if (argType.isPrimitive())