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)};