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

compiler generates error calling static method of static inner class

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: rmT116609 Date: 11/09/2001


      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)



      public class v {

          public static void main(String argv []) {

              v.x.print(); // works fine

              (new v()).x.print1();

          }



          static class x {

              public static void print() {

                  System.out.println("Doe something");

              }



              public static void print1() {

                  System.out.println("Doe something");

              }

          }

      }



      With JDK1.4.0-beta3:

      $% javac v.java
      v.java:7: unexpected type
      required: class, package
      found : value
              (new v()).x.print1();
              ^
      1 error



      The test case worked fine with 1.4.0-beta, 1.4.0-beta2.

      $ % javac v.java
      $% java v
      Doe something
      Doe something


      With JDK1.3.1_01:

      java.lang.NullPointerException

              at com.sun.tools.javac.v8.comp.TransInner.access(TransInner.java:743)

              at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1578)

              at com.sun.tools.javac.v8.tree.Tree$Select.visit(Tree.java:963)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1572)

              at com.sun.tools.javac.v8.tree.Tree$Select.visit(Tree.java:963)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1503)

              at com.sun.tools.javac.v8.tree.Tree$Apply.visit(Tree.java:785)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.tree.TreeTranslator._case(TreeTranslator.java:179)

              at com.sun.tools.javac.v8.tree.Tree$Exec.visit(Tree.java:699)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:47)

              at com.sun.tools.javac.v8.tree.TreeTranslator._case(TreeTranslator.java:111)

              at com.sun.tools.javac.v8.tree.Tree$Block.visit(Tree.java:492)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.tree.TreeTranslator._case(TreeTranslator.java:100)

              at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1436)

              at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java:441)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.comp.TransInner._case(TransInner.java:1373)

              at com.sun.tools.javac.v8.tree.Tree$ClassDef.visit(Tree.java:402)

              at com.sun.tools.javac.v8.tree.TreeTranslator.translate(TreeTranslator.java:35)

              at com.sun.tools.javac.v8.comp.TransInner.translate(TransInner.java:1335)

              at com.sun.tools.javac.v8.comp.TransInner.translateTopLevelClass(TransInner.java:1603)

              at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:397)

              at com.sun.tools.javac.v8.Main.compile(Main.java:247)

              at com.sun.tools.javac.Main.main(Main.java:16)
      (Review ID: 135339)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gafter Neal Gafter
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: