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

Problem with java.lang.InternalError description / usage

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE REQUEST :
      The Javadoc description for java.lang.InternalError says that it is used for signalling errors in the Java Virtual Machine. However, it is clear that the exception is also widely used within the Java 1.4.2 class libraries to signal errors in the class libraries.

      JUSTIFICATION :
      There has been considerable debate on the Classpath mailing list as to whether or not it is "correct" for Classpath methods to throw InternalError, or RuntimeException.
      [Classpath is the open source re-implementation of Sun's core Java class libraries
      used by a number of open source Java implementations.]

      On the one hand, some people quote the Sun javadoc and say that since Classpath is
      not part of the VM (correct), it shouldn't throw InternalError. RuntimeException is
      proposed as the alternative.

      On the other hand, some people say that RuntimeException (or indeed, and subclass)
      is inappropriate, since the conditions being signalled are not the kind of thing that
      an application should ever attempt to handle. Indeed, this seems to be the thinking
      behind the use of InternalError in the Java 1.4.2 class libraries.

      The Java specification needs to be clarified to resolve this debate.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Three possibilities. (First one simplest ... and preferred.)

        1) Change the javadoc for InternalError to make it clear that this exception also
      can thrown to indicate internal errors in the Java core libraries and elsewhere.
      If appropriate, include best-practice recommendations for application code.

        2) Define a new Error for signalling internal errors in core library code, and
      similar. (I'll leave it to experts to decide where the boundary should be drawn.)
      Then change all relevant occurrences of "throw new InternalError(...)" in the Java
      core code base to throw the new Error.

        3) Change the Java core libraries to throw an appropriate subclass of
      RuntimeException instead of InternalError.

      ACTUAL -
      The Javadoc and Sun practice are inconsistent, as indicated by numerous bug reports.
      ###@###.### 2004-11-12 00:20:48 GMT

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: