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

Messages provided by Exceptions thrown from jdk sources are insufficient

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: other-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      This issue applies accross entire jdk sources. The exceptions thrown from jdk sources usually don't provide enough information to fix the issue, just by reading the message and looking at the stack trace. Developer needs to usually manage to reproduce the issue, even for very simple cases, just to find out some values, which should have been provided in the exception message.
      This slows donwn her developement, and makes the java less efficient tool.

      There are typically excecptions with very poor description messages like:
      - "illegal value".. without providing expected value, and the actual value;
      - "illegal state of component".... but no information about which component instance, its name, display name,...
      etc.


      There should be created and strictly folowed rules about what a message of an exception should provide. Something like:
      1) Each exception has to provide info about the place where the exception occured.. i.e. the actual instance of an object (class), and its important values; if the class properly overrides toString() method, that usage should be OK;
      2) Provide as much as possible available information, relevant to the state which led to the exceptions. I.e. properties which have wrong values, what are expected values; other important values which could affect the state... etc.

      There should also folowed:
      - Dont use Errors instead of Exceptions, Errors are supposed to refer problems of VM. Not keeping this prevents nice advanced exception handling in larger app's.
      - Dont create and throw exceptions with no messages. This is obvious from the above, at least the 1) has to be used.

      ###@###.### 2004-06-01

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: