You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by do...@apache.org on 2001/12/29 22:35:44 UTC

cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core StringToEnumConverter.java Resources.properties

donaldp     01/12/29 13:35:44

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/core
                        StringToEnumConverter.java Resources.properties
  Log:
  Make sure the error messages are all in resources bundle and are passed appropriate parameters.
  
  Revision  Changes    Path
  1.2       +1 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/StringToEnumConverter.java
  
  Index: StringToEnumConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/StringToEnumConverter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StringToEnumConverter.java	29 Dec 2001 21:18:33 -0000	1.1
  +++ StringToEnumConverter.java	29 Dec 2001 21:35:44 -0000	1.2
  @@ -33,12 +33,11 @@
           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
  
  
  
  1.2       +5 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Resources.properties	16 Dec 2001 11:56:21 -0000	1.1
  +++ Resources.properties	29 Dec 2001 21:35:44 -0000	1.2
  @@ -13,3 +13,8 @@
   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}.
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>