From 0b9d1c616f5cbb03e4bbad644c17d2ae892759fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20K=C3=BChne?= Date: Sat, 15 Feb 2003 16:11:28 +0000 Subject: [PATCH] use new helper method to avoid duplicate code --- .../com/mycompany/checks/LimitImplementationFiles.java | 6 ++---- docs/writingchecks.html | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/contrib/examples/checks/com/mycompany/checks/LimitImplementationFiles.java b/contrib/examples/checks/com/mycompany/checks/LimitImplementationFiles.java index 29ef6a314..8f8c4c17d 100644 --- a/contrib/examples/checks/com/mycompany/checks/LimitImplementationFiles.java +++ b/contrib/examples/checks/com/mycompany/checks/LimitImplementationFiles.java @@ -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)}; diff --git a/docs/writingchecks.html b/docs/writingchecks.html index c7c0dd50a..d531eb80d 100644 --- a/docs/writingchecks.html +++ b/docs/writingchecks.html @@ -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)};