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

Inner class of generic class cannot extend Throwable

XMLWordPrintable

    • 5.0
    • 5.0
    • b73
    • sparc
    • solaris_9
    • Verified

      Consider the three attached java files.
      If you compile them one at a time they will all compile and the app will run.
      However if you compile them en-masse you'll get nonsensical error messages:

      damavand: rm *.class
      damavand: javac -g Stack.java
      damavand: javac -g EmbellishedStack.java
      damavand: javac -g Test.java
      damavand: javac -g *.java
      Stack.java:26: unreported exception Stack.UnderflowException; must be caught or declared to be thrown
                  throw new UnderflowException();
                  ^
      Stack.java:34: unreported exception Stack.UnderflowException; must be caught or declared to be thrown
                  throw new UnderflowException();
                  ^

      This is actually on:
      damavand: java -version
      java version "1.5.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b56)
      Java HotSpot(TM) Client VM (build 1.5.0-beta3-b56, mixed mode, sharing)

            ahe Peter Ahe
            isoleima Ivan Soleimanipour (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: