geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r721357 - in /geronimo/gshell/trunk: gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/ gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/ gshell-support/gshell-clp/src/main/java/org/...
Date Fri, 28 Nov 2008 06:49:10 GMT
Author: jdillon
Date: Thu Nov 27 22:49:09 2008
New Revision: 721357

URL: http://svn.apache.org/viewvc?rev=721357&view=rev
Log:
Using String.format() aka sprintf instead the uber-evil-craptastic MessageFormat.format()

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshServerAction.properties
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Messages.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Messages.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/Messages.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/handler/Messages.properties
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/setter/Messages.properties
    geronimo/gshell/trunk/gshell-support/gshell-i18n/src/main/java/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSource.java
    geronimo/gshell/trunk/gshell-support/gshell-i18n/src/test/resources/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSourceTest.properties
    geronimo/gshell/trunk/gshell-support/gshell-plexus/src/main/java/org/apache/geronimo/gshell/plexus/Slf4jLoggingManager.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/AliasCommand.properties
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/GroupCommand.properties

Modified: geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshAction.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshAction.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshAction.properties
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshAction.properties
Thu Nov 27 22:49:09 2008
@@ -37,7 +37,7 @@
 command.manual=\
   TODO: ssh manual
 
-info.connecting=Connecting to: {0}:{1,number,######}
+info.connecting=Connecting to: %s:%d
 info.connected=Connected
 
 prompt.username=Username

Modified: geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshServerAction.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshServerAction.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshServerAction.properties
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/resources/org/apache/geronimo/gshell/commands/ssh/SshServerAction.properties
Thu Nov 27 22:49:09 2008
@@ -31,4 +31,4 @@
 command.manual=\
   TODO: ssh-server manual
 
-info.listening=Listening on: {0,number,######}
\ No newline at end of file
+info.listening=Listening on: %d
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Messages.java?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Messages.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Messages.java
Thu Nov 27 22:49:09 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.clp;
 
-import java.text.MessageFormat;
 import java.util.ResourceBundle;
 
 /**
@@ -39,7 +38,7 @@
 
     private static ResourceBundle bundle;
 
-    String format(Object... args) {
+    String format(final Object... args) {
         assert args != null;
 
         synchronized (Messages.class) {
@@ -47,11 +46,7 @@
                 bundle = ResourceBundle.getBundle(Messages.class.getName());
             }
 
-            //
-            // FIXME: Replace with String.format()
-            //
-
-            return MessageFormat.format(bundle.getString(name()), args);
+            return String.format(bundle.getString(name()), args);
         }
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Messages.java?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Messages.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Messages.java
Thu Nov 27 22:49:09 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.clp.handler;
 
-import java.text.MessageFormat;
 import java.util.ResourceBundle;
 
 /**
@@ -35,7 +34,7 @@
 
     private static ResourceBundle bundle;
 
-    String format(Object... args) {
+    String format(final Object... args) {
         assert args != null;
         
         synchronized (Messages.class) {
@@ -43,11 +42,7 @@
                 bundle = ResourceBundle.getBundle(Messages.class.getName());
             }
 
-            //
-            // FIXME: Replace with String.format()
-            //
-
-            return MessageFormat.format(bundle.getString(name()), args);
+            return String.format(bundle.getString(name()), args);
         }
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/Messages.java?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/Messages.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/setter/Messages.java
Thu Nov 27 22:49:09 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.clp.setter;
 
-import java.text.MessageFormat;
 import java.util.ResourceBundle;
 
 /**
@@ -37,7 +36,7 @@
 
     private static ResourceBundle bundle;
 
-    String format(Object... args) {
+    String format(final Object... args) {
         assert args != null;
 
         synchronized (Messages.class) {
@@ -45,7 +44,7 @@
                 bundle = ResourceBundle.getBundle(Messages.class.getName());
             }
 
-            return MessageFormat.format(bundle.getString(name()), args);
+            return String.format(bundle.getString(name()), args);
         }
     }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties
Thu Nov 27 22:49:09 2008
@@ -21,14 +21,14 @@
 ## $Rev$ $Date$
 ##
 
-MISSING_OPERAND=Option "{0}" takes an operand
+MISSING_OPERAND=Option "%s" takes an operand
 
-UNDEFINED_OPTION="{0}" is not a valid option
+UNDEFINED_OPTION="%s" is not a valid option
 
-NO_ARGUMENT_ALLOWED=No argument is allowed: {0}
+NO_ARGUMENT_ALLOWED=No argument is allowed: %s
 
-REQUIRED_OPTION_MISSING=Option "{0}" is required
+REQUIRED_OPTION_MISSING=Option "%s" is required
 
-REQUIRED_ARGUMENT_MISSING=Argument "{0}" is required
+REQUIRED_ARGUMENT_MISSING=Argument "%s" is required
 
-TOO_MANY_ARGUMENTS=Too many arguments: {0}
+TOO_MANY_ARGUMENTS=Too many arguments: %s

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
Thu Nov 27 22:49:09 2008
@@ -21,8 +21,8 @@
 ## $Rev$ $Date$
 ##
 
-syntax=syntax: {0}
-syntax.hasOptions={0} [options]
-syntax.hasArguments={0} [arguments]
+syntax=syntax: %s
+syntax.hasOptions=%s [options]
+syntax.hasArguments=%s [arguments]
 arguments.header=arguments:
 options.header=options:
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/handler/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/handler/Messages.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/handler/Messages.properties
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/handler/Messages.properties
Thu Nov 27 22:49:09 2008
@@ -21,6 +21,6 @@
 ## $Rev$ $Date$
 ##
 
-ILLEGAL_OPERAND="{1}" is not a valid value for "{0}"
+ILLEGAL_OPERAND="%2$s" is not a valid value for "%1$s"
 
-ILLEGAL_BOOLEAN="{0}" is not a legal boolean value
\ No newline at end of file
+ILLEGAL_BOOLEAN="%s" is not a legal boolean value
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/setter/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/setter/Messages.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/setter/Messages.properties
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/setter/Messages.properties
Thu Nov 27 22:49:09 2008
@@ -21,6 +21,6 @@
 ## $Rev$ $Date$
 ##
 
-ILLEGAL_METHOD_SIGNATURE=Method {0} takes more than one parameter
+ILLEGAL_METHOD_SIGNATURE=Method %s takes more than one parameter
 
-ILLEGAL_FIELD_SIGNATURE=Field of type {0} is not supported
\ No newline at end of file
+ILLEGAL_FIELD_SIGNATURE=Field of type %s is not supported
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-i18n/src/main/java/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSource.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-i18n/src/main/java/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSource.java?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-i18n/src/main/java/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSource.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-i18n/src/main/java/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSource.java
Thu Nov 27 22:49:09 2008
@@ -85,10 +85,6 @@
 
         String pattern = getMessage(code);
 
-        //
-        // FIXME: Replace with String.format()
-        //
-
-        return MessageFormat.format(pattern, args);
+        return String.format(pattern, args);
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-i18n/src/test/resources/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSourceTest.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-i18n/src/test/resources/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSourceTest.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-i18n/src/test/resources/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSourceTest.properties
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-i18n/src/test/resources/org/apache/geronimo/gshell/i18n/ResourceBundleMessageSourceTest.properties
Thu Nov 27 22:49:09 2008
@@ -27,4 +27,4 @@
 
 c=3
 
-f={0} {1} {2}
\ No newline at end of file
+f=%s %s %s
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-plexus/src/main/java/org/apache/geronimo/gshell/plexus/Slf4jLoggingManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-plexus/src/main/java/org/apache/geronimo/gshell/plexus/Slf4jLoggingManager.java?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-plexus/src/main/java/org/apache/geronimo/gshell/plexus/Slf4jLoggingManager.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-plexus/src/main/java/org/apache/geronimo/gshell/plexus/Slf4jLoggingManager.java
Thu Nov 27 22:49:09 2008
@@ -32,10 +32,6 @@
 public class Slf4jLoggingManager
     extends BaseLoggerManager
 {
-    //
-    // FIXME: Probably need to change this to avoid picking up the BaseLoggerManager, just
implement everything ourselves
-    //        Might be able to use AbstractLoggerManager
-
     protected org.codehaus.plexus.logging.Logger createLogger(final String key) {
         return new LoggerImpl(getThreshold(), LoggerFactory.getLogger(key));
     }

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/AliasCommand.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/AliasCommand.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/AliasCommand.properties
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/AliasCommand.properties
Thu Nov 27 22:49:09 2008
@@ -21,7 +21,7 @@
 ## $Rev$ $Date$
 ##
 
-command.description=Alias to: {0}
+command.description=Alias to: %s
 
 command.argument.appendArgs=Supply additional ARGS to the alias execution.
 command.argument.appendArgs.token=ARGS

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/GroupCommand.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/GroupCommand.properties?rev=721357&r1=721356&r2=721357&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/GroupCommand.properties
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/org/apache/geronimo/gshell/wisdom/command/GroupCommand.properties
Thu Nov 27 22:49:09 2008
@@ -21,7 +21,7 @@
 ## $Rev$ $Date$
 ##
 
-command.description=Command group: {0}
+command.description=Command group: %s
 
 command.manual=\
   TODO: general group manual



Mime
View raw message