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:
parent
cfebe5c731
commit
6df7f9318f
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in New Issue