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

apt -print mishandles unknown type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Labels:
    • Subcomponent:
      apt
    • Resolved In Build:
      b57
    • CPU:
      sparc
    • OS:
      solaris_9

      Description


      Running "apt -print" on a file containing the following causes apt to crash:

          class A extends Unknown {
          }

      The error message and stack trace:

          T12.java:1: cannot find symbol
          symbol: class Unknown
          ...
          class AAn exception has occurred in the compiler (1.5.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
          java.lang.NullPointerException
      at com.sun.tools.apt.comp.PrintAP$PrintingVisitors$PrePrinting.visitClassDeclaration(PrintAP.java:82)


      The method PrePrinting.visitClassDeclaration() assumes that the
      ClassType.getDeclaration() method cannot return null. It can.
      The PrintingVisitors.printInterfaces() method has the same problem.

      This is an easy error to make. Thought should be given to the API
      design issues around this for a future release.

      Incidentally, the error message should ideally not have indicated an
      error "in the compiler". And there seems to be a newline missing before
      "An exception has occurred".

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

        Attachments

          Activity

            People

            Assignee:
            darcy Joe Darcy
            Reporter:
            sseligmasunw Scott Seligman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: