OSDN Git Service

Use Class#getSimpleName instead of Class#getName and String#replace at Command#getUsage
authorargius <argius.net@gmail.com>
Tue, 7 Jan 2014 13:49:34 +0000 (22:49 +0900)
committerargius <argius.net@gmail.com>
Tue, 7 Jan 2014 13:49:34 +0000 (22:49 +0900)
src/net/argius/stew/Command.java

index 93678c4..0dd434f 100644 (file)
@@ -169,8 +169,7 @@ public abstract class Command {
      * @return
      */
     protected String getUsage() {
-        final String name = getClass().getName().replaceFirst(".*\\.([^\\.]+)", "$1");
-        return getMessage("usage." + name);
+        return getMessage("usage." + getClass().getSimpleName());
     }
 
     /**