commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/message MessageResources.java
Date Fri, 03 May 2002 16:53:51 GMT
dlr         02/05/03 09:53:51

  Modified:    resources/src/java/org/apache/commons/resources/message
                        MessageResources.java
  Log:
  Reduced amount of code necessary to assemble the formatting argument
  Object[] array in the getMessage(Locale, String, Object, ...)
  overload methods.
  
  Revision  Changes    Path
  1.5       +8 -22     jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/message/MessageResources.java
  
  Index: MessageResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/message/MessageResources.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- MessageResources.java	24 Oct 2001 20:46:03 -0000	1.4
  +++ MessageResources.java	3 May 2002 16:53:51 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/message/MessageResources.java,v
1.4 2001/10/24 20:46:03 mschachter Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/10/24 20:46:03 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/message/MessageResources.java,v
1.5 2002/05/03 16:53:51 dlr Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/05/03 16:53:51 $
    *
    * ====================================================================
    *
  @@ -91,7 +91,7 @@
    * application server environments.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2001/10/24 20:46:03 $
  + * @version $Revision: 1.5 $ $Date: 2002/05/03 16:53:51 $
    */
   
   public abstract class MessageResources extends ResourcesBase {
  @@ -359,9 +359,7 @@
        */
       public String getMessage(Locale locale, String key, Object arg0) {
   
  -	Object args[] = new Object[1];
  -	args[0] = arg0;
  -	return (getMessage(locale, key, args));
  +	return (getMessage(locale, key, new Object[] { arg0 }));
   
       }
   
  @@ -380,10 +378,7 @@
       public String getMessage(Locale locale,
   			     String key, Object arg0, Object arg1) {
   
  -	Object args[] = new Object[2];
  -	args[0] = arg0;
  -	args[1] = arg1;
  -	return (getMessage(locale, key, args));
  +	return (getMessage(locale, key, new Object[] { arg0, arg1 }));
   
       }
   
  @@ -404,11 +399,7 @@
   			     String key, Object arg0, Object arg1,
   			     Object arg2) {
   
  -	Object args[] = new Object[3];
  -	args[0] = arg0;
  -	args[1] = arg1;
  -	args[2] = arg2;
  -	return (getMessage(locale, key, args));
  +	return (getMessage(locale, key, new Object[] { arg0, arg1, arg2 }));
   
       }
   
  @@ -430,12 +421,7 @@
   			     String key, Object arg0, Object arg1,
   			     Object arg2, Object arg3) {
   
  -	Object args[] = new Object[4];
  -	args[0] = arg0;
  -	args[1] = arg1;
  -	args[2] = arg2;
  -	args[3] = arg3;
  -	return (getMessage(locale, key, args));
  +	return (getMessage(locale, key, new Object[] { arg0, arg1, arg2, arg3 }));
   
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message