use new helper method to avoid duplicate code

This commit is contained in:
Lars Kühne 2003-02-15 16:11:28 +00:00
parent 3aa99fde8e
commit 0b9d1c616f
2 changed files with 4 additions and 8 deletions

View File

@ -43,10 +43,8 @@ public class LimitImplementationFiles
LocalizedMessage[] errors = new LocalizedMessage[1];
// get the resource bundle to use for the message
final String className = getClass().getName();
final int pkgEndIndex = className.lastIndexOf('.');
final String pkgName = className.substring(0, pkgEndIndex);
final String bundle = pkgName + ".messages";
// will return "com.mycompany.checks.messages"
final String bundle = getMessageBundle();
// create the message arguments
Object[] msgArgs = new Object[]{new Integer(max)};

View File

@ -507,10 +507,8 @@
LocalizedMessage[] errors = new LocalizedMessage[1];
// get the resource bundle to use for the message
final String className = getClass().getName();
final int pkgEndIndex = className.lastIndexOf('.');
final String pkgName = className.substring(0, pkgEndIndex);
final String bundle = pkgName + ".messages";
// will return "com.mycompany.checks.messages"
final String bundle = getMessageBundle();
// create the message arguments
Object[] msgArgs = new Object[]{new Integer(max)};