Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4647134

Logger.logrb does not throw MissingResourceException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • sparc
    • solaris_7



      Name: sdR10048 Date: 03/05/2002



      Methods

       "logrb(Level, String, String, String bindleName, String)"
       "logrb(Level, String, String, String bindleName, String, Object)"
       "logrb(Level, String, String, String bindleName, String, Object[])"
       "logrb(Level, String, String, String bindleName, String, Throwable)"

      of class java.util.logging.Logger don't throw MissingResourceException
      in case if 'bundleName' is the name of not existent ResourceBundle.

      Javadoc says (JDK1.4.1-b03):

      public void logrb(Level level,
                        String sourceClass,
                        String sourceMethod,
                        String bundleName,
                        String msg)

      Log a message, specifying source class, method, and resource bundle
      name with no arguments.

      If the logger is currently enabled for the given message level then
      the given message is forwarded to all the registered output Handler
      objects.

      The msg string is localized using the named resource bundle. If the
      resource bundle name is null, then the msg string is not localized.

      Parameters:
      level - One of the message level identifiers, e.g. SEVERE
      sourceClass - name of class that issued the logging request
      sourceMethod - name of method that issued the logging request
      bundleName - name of resource bundle to localize msg
      msg - The string message (or a key in the message catalog)

      Throws:
      MissingResourceException - if no suitable ResourceBundle can be found.
      ^^^^^^^^^^^^^^^^^^^^^^^^

      Tiny test:
      ----------
      import java.util.logging.*;

      public class Test {

          public static void main(String args[]) {
              Logger.global.logrb(Level.FINE,
                                  "className",
                                  "methodName",
                                  "java.util.NExRBundle",
                                  "msg");
          }
      }


      Test output:
      ------------
      [archer] ~/tmp
      % java Test


      ======================================================================

            ghamiltosunw Graham Hamilton (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: