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

compiler exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 1.4.0
    • tools
    • sparc
    • solaris_2.6



      Name: dsR10051 Date: 02/19/2002


      The next corrupted source can not be compiled
      without internal compiler exception:

      ------- getAccessibleContextTests.java -------

      /*
       *
       * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
       * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
       *
       * Applet getAccessibleContext() method tests
       * Testing getAccessibleContext() method
       */

      package javasoft.sqe.tests.api.java.applet.Applet;

      import java.io.PrintWriter;
      import javasoft.sqe.javatest.Status;
      import javasoft.sqe.jck.lib.ReadTest;
      import java.applet.*;
      import javax.accessibility.*;

      public class getAccessibleContextTests extends ReadTest {

          /* standalone interface */
          public static void main(String argv[]) {
              getAccessibleContextTests test = new getAccessibleContextTests();
              test.run(argv, System.err, System.out).exit();
          }

          /**
           * Assertion testing
           * for public AccessibleContext getAccessibleContext(),
           * Should return AccessibleContext object associated with this AWT Component.
           */
          public Status Applet2022() {
            
              Applet c = new Applet(); // Create Applet object
              
              if (!(c.getAccessibleContext() != null
                      && c.getAccessibleContext().getAccessibleRole().equals(
                      AccessibleRole.FRAME))) {
                  return Status.failed("public AccessibleContext getAccessibleContext() Test Failed");
              }
          
              return Status.passed("OKAY");
          }

          /**
           * Assertion testing
           * for public AccessibleContext getAccessibleContext(),
           * Should return form of an AccessibleApplet.
           */
          public Status Applet2023() {
            
              Applet c = new Applet(); // Create Applet object
              class StubApplet extends Applet {
                  public boolean isAccessibleApplet(
                          AccessibleContext ac) {
                      return ac instanceof java.applet.Applet.AccessibleApplet;
                  }
              };
              
              if (!(new StubApplet()).isAccessibleApplet(
                      Applet.getAccessibleContext())) {
                  return Status.failed("public AccessibleContext getAccessibleContext() Test Failed");
              }
              return Status.passed("OKAY");
          }
      }
      ------- END getAccessibleContextTests.java -------

      Here is output:
      %echo $CLASSPATH

      %/set/java/jdk1.4.1/solaris/bin/java -version
      java version "1.4.1-ea"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-ea-b01)
      Java HotSpot(TM) Client VM (build 1.4.1-ea-b01, mixed mode)

      %/set/java/jdk1.4.1/solaris/bin/javac getAccessibleContextTests.java
      getAccessibleContextTests.java:13: package javasoft.sqe.javatest does not exist
      import javasoft.sqe.javatest.Status;
                                   ^
      getAccessibleContextTests.java:14: package javasoft.sqe.jck.lib does not exist
      import javasoft.sqe.jck.lib.ReadTest;
                                  ^
      getAccessibleContextTests.java:18: cannot resolve symbol
      symbol : class ReadTest
      location: class javasoft.sqe.tests.api.java.applet.Applet.getAccessibleContextTests
      public class getAccessibleContextTests extends ReadTest {
                                                     ^
      getAccessibleContextTests.java:31: cannot resolve symbol
      symbol : class Status
      location: class javasoft.sqe.tests.api.java.applet.Applet.getAccessibleContextTests
          public Status Applet2022() {
                 ^
      getAccessibleContextTests.java:49: cannot resolve symbol
      symbol : class Status
      location: class javasoft.sqe.tests.api.java.applet.Applet.getAccessibleContextTests
          public Status Applet2023() {
                 ^
      getAccessibleContextTests.java:23: cannot resolve symbol
      symbol : method run (java.lang.String[],java.io.PrintStream,java.io.PrintStream)
      location: class javasoft.sqe.tests.api.java.applet.Applet.getAccessibleContextTests
              test.run(argv, System.err, System.out).exit();
                  ^
      getAccessibleContextTests.java:38: cannot resolve symbol
      symbol : variable Status
      location: class javasoft.sqe.tests.api.java.applet.Applet.getAccessibleContextTests
                  return Status.failed("public AccessibleContext getAccessibleContext() Test Failed");
                         ^
      getAccessibleContextTests.java:41: cannot resolve symbol
      symbol : variable Status
      location: class javasoft.sqe.tests.api.java.applet.Applet.getAccessibleContextTests
              return Status.passed("OKAY");
                     ^
      getAccessibleContextTests.java:60: non-static method getAccessibleContext() cannot be referenced from a static context
                      Applet.getAccessibleContext())) {
                            ^
      An exception has occurred in the compiler (1.4.1-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.ClassCastException: com.sun.tools.javac.v8.code.Type$ErrorType
      at com.sun.tools.javac.v8.comp.Resolve.instantiate(Resolve.java:203)
      at com.sun.tools.javac.v8.comp.Attr.checkId(Attr.java:1330)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:1226)
      at com.sun.tools.javac.v8.tree.Tree$Select.visit(Tree.java:1063)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribExpr(Attr.java:274)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:833)
      at com.sun.tools.javac.v8.tree.Tree$Apply.visit(Tree.java:869)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribArgs(Attr.java:323)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:830)
      at com.sun.tools.javac.v8.tree.Tree$Apply.visit(Tree.java:869)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribArgs(Attr.java:323)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:1051)
      at com.sun.tools.javac.v8.tree.Tree$Operation.visit(Tree.java:986)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribExpr(Attr.java:274)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:650)
      at com.sun.tools.javac.v8.tree.Tree$If.visit(Tree.java:748)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:296)
      at com.sun.tools.javac.v8.comp.Attr.attribStats(Attr.java:314)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:462)
      at com.sun.tools.javac.v8.tree.Tree$Block.visit(Tree.java:539)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:296)
      at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:415)
      at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java:474)
      at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
      at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:296)
      at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:1489)
      at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:1456)
      at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:396)
      at com.sun.tools.javac.v8.Main.compile(Main.java:526)
      at com.sun.tools.javac.Main.compile(Main.java:32)
      at com.sun.tools.javac.Main.main(Main.java:23)
      ======================================================================

            gafter Neal Gafter (Inactive)
            sdasunw Sda Sda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: