You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ol...@apache.org on 2013/09/02 08:08:45 UTC

svn commit: r1519348 - in /tomcat/maven-plugin/trunk: common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/ tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/

Author: olamy
Date: Mon Sep  2 06:08:44 2013
New Revision: 1519348

URL: http://svn.apache.org/r1519348
Log:
simplify the wrapper on the top of MessageFormat

Modified:
    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java
    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java

Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java?rev=1519348&r1=1519347&r2=1519348&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java (original)
+++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java Mon Sep  2 06:08:44 2013
@@ -83,36 +83,12 @@ public class DefaultMessagesProvider
      * Gets the message for the given key from this packages resource bundle and formats it with the given parameter.
      *
      * @param key   the key for the required message
-     * @param param the parameter to be used to format the message with
-     * @return the formatted message
-     */
-    public String getMessage( String key, Object param )
-    {
-        return MessageFormat.format( getMessage( key ), new Object[]{ param } );
-    }
-
-    /**
-     * Gets the message for the given key from this packages resource bundle and formats it with the given parameters.
-     *
-     * @param key    the key for the required message
-     * @param param1 the first parameter to be used to format the message with
-     * @param param2 the second parameter to be used to format the message with
-     * @return the formatted message
-     */
-    public String getMessage( String key, Object param1, Object param2 )
-    {
-        return MessageFormat.format( getMessage( key ), new Object[]{ param1, param2 } );
-    }
-
-    /**
-     * Gets the message for the given key from this packages resource bundle and formats it with the given parameters.
-     *
-     * @param key    the key for the required message
      * @param params the parameters to be used to format the message with
      * @return the formatted message
      */
-    public String getMessage( String key, Object[] params )
+    public String getMessage( String key, Object... params )
     {
         return MessageFormat.format( getMessage( key ), params );
     }
+
 }

Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java?rev=1519348&r1=1519347&r2=1519348&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java (original)
+++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java Mon Sep  2 06:08:44 2013
@@ -29,9 +29,6 @@ public interface MessagesProvider
 {
     String getMessage( String key );
 
-    String getMessage( String key, Object param );
+    String getMessage( String key, Object... param1 );
 
-    String getMessage( String key, Object param1, Object param2 );
-
-    String getMessage( String key, Object[] params );
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java?rev=1519348&r1=1519347&r2=1519348&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java (original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java Mon Sep  2 06:08:44 2013
@@ -70,7 +70,7 @@ public abstract class AbstractI18NTomcat
     	if (statusCode >= 400) {
     		getLog().error(tomcatResponse.getHttpResponseBody()) ;
     		
-    		throw new MojoExecutionException( messagesProvider.getMessage("AbstractI18NTomcat6Mojo.tomcatHttStatusError")) ;
+    		throw new MojoExecutionException( messagesProvider.getMessage("AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode)) ;
     	}
     }       
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org