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

javac fails to compile inner class when secondary inner class is involved

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u31
    • tools
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      jdk1.6.0_33, jdk1.5.0_22

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      see bug id 6707323 :

      Javac fails to compile inner class, when a secondary inner class (inner class of the inner class)
      is imported first. It appears that importing a secondary inner class hides symbols in inner class.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Javac fails to compile inner class, when a secondary inner class (inner class of the inner class)
      is imported first. It appears that importing a secondary inner class hides symbols in inner class.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      BUILD SUCCESSFUL
      ACTUAL -
      BUILD FAILED

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      pack1\Test.java:8: cannot find symbol
      symbol : class Test2
      location: class pack1.Test
      public class Test3 extends Test2 {
      ^
      1 error


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      pack2.Test2 class :
      --------------------------

      package pack2;

      public class Test2
      {

      }

      pack1.Test class :
      -------------------------
      package pack1;

      import pack1.Test.Test3.Test4;
      import pack2.Test2;

      public class Test extends Test2 {

      public class Test3 extends Test2 {
      public class Test4 {

      }
      }

      public void test() {
      Test4 test4;
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      change sequence of import statements

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: