diff --git a/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties b/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties index 16ea70c56..9e0307ec5 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties @@ -13,3 +13,8 @@ convert.bad-integer.error=Error converting object ({0}) to Integer. convert.bad-long.error=Error converting object ({0}) to Long. convert.bad-short.error=Error converting object ({0}) to Short. convert.bad-url.error=Error converting object ({0}) to URL. + +getByName.error=Failed to retrieve enum by calling getByName on "{0}". (Reason: {1}). +enum.missing.getByName.error=Enum class "{0}" is missing a public static method named "getByName" that accepts a single string parameter. +enum.missing.getNames.error=Enum class "{0}" is missing a public static method named "getNames" that returns a String array of all enum names. +invalid.enum.error=Invalid value "{0}" for enum, expected one of {1}. diff --git a/proposal/myrmidon/src/java/org/apache/antlib/core/StringToEnumConverter.java b/proposal/myrmidon/src/java/org/apache/antlib/core/StringToEnumConverter.java index 59c07ec61..11b7dacb3 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/core/StringToEnumConverter.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/core/StringToEnumConverter.java @@ -33,12 +33,11 @@ public class StringToEnumConverter throws ConverterException { final Object object = getEnum( destination, original ); - if( null == object ) { final String[] names = getValidNames( destination ); final String message = - REZ.getString( "invalid.enum.error", object, Arrays.asList( names ) ); + REZ.getString( "invalid.enum.error", original, Arrays.asList( names ) ); throw new ConverterException( message ); } else