From 6df7f9318fd15be7222aafd9296e0b519f2e3451 Mon Sep 17 00:00:00 2001 From: kshakir Date: Wed, 29 Sep 2010 05:28:59 +0000 Subject: [PATCH] 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 --- .../sting/queue/extensions/gatk/ArgumentField.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/queue/extensions/gatk/ArgumentField.java b/java/src/org/broadinstitute/sting/queue/extensions/gatk/ArgumentField.java index 44dded793..88ad2a02b 100644 --- a/java/src/org/broadinstitute/sting/queue/extensions/gatk/ArgumentField.java +++ b/java/src/org/broadinstitute/sting/queue/extensions/gatk/ArgumentField.java @@ -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())