Opened 52 years ago

Last modified 11 years ago

#916 new enhancement

IZ639: Enhanced error message in case of a MissingResourceException in I18NManager

Reported by: afisch Owned by:
Priority: high Milestone:
Component: hedeby Version: 1.0u3_Alpha-2
Severity: Keywords: Sun util


[Imported from gridengine issuezilla]

        Issue #:      639          Platform:     Sun             Reporter: afisch (afisch)
       Component:     hedeby          OS:        All
     Subcomponent:    util         Version:      1.0u3_Alpha-2      CC:    None defined
        Status:       NEW          Priority:     P2
      Resolution:                 Issue type:    ENHANCEMENT
                               Target milestone: 1.0u5next
      Assigned to:    rhierlmeier (rhierlmeier)
      QA Contact:     rhierlmeier
       * Summary:     Enhanced error message in case of a MissingResourceException in I18NManager
   Status whiteboard:

     Issue 639 blocks:
   Votes for issue 639:     Vote for this issue

   Opened: Tue Apr 14 06:46:00 -0700 2009 

   In the current system a missing message key in a resource bundle will result in
   the following error message:

     java.lang.IllegalArgumentException: Resource bundle file(s) is(are) missing or

   It correctly states the problem. However The message does not give a hint which
   message key / resource bundle is involved.
   Additionally the original message information is lost.

   The issue is rated as a P3 enhancement as it is simple to implement and might be
   very convenient in case of corresponding I18N issues.

   Suggested Fix / Work Around:
   Suggested Fix:
   The error message should name resource bundle, message key and parameters for
   two reasons:
   1) To help identifying the missing message resource
   2) To allow an analysis of the logged message.
   Work Around:
   Try to identify the corresponding key by searching the code with the help of
   stack trace /error context information.

   In com.sun.grid.grm.util.I18NManager.formatMessage(73-76) there is only a
   uniform error message in case that the message key is not
   resolvable. The error message should be enhanced to contain the msg String,the
   bundleName String and the params vararg array.

   This will help to identify missing message keys and allows to to analyze a
   problem in an error cases where a message resource is missing.

   The second method com.sun.grid.grm.util.I18NManager.printfMessage should be
   removed as it is apparently not used in the current code.

   How to test:
   A jUnit test should be written that directly calls the
   I18NManager.formatMessage() with an invalid message key to test the resulting
   error message.

   0.5 PD
               ------- Additional comments from afisch Tue May 19 07:30:29 -0700 2009 -------
   Currently the missing resource causes an exception. This exception can lead to
   failing functionality and to severe issues (and it already has). It would be
   better to just return the error message suggested above instead of the resolved
   message. Additionally the missing bundle should be logged on level severe.
               ------- Additional comments from rhierlmeier Wed Nov 25 07:21:11 -0700 2009 -------
   Milestone changed
               ------- Additional comments from torsten Fri Nov 27 01:54:26 -0700 2009 -------
   Very easy to fix and helpful to spot resource bundle problems

   => raised priority to 2

Change History (0)

Note: See TracTickets for help on using tickets.