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

incorrect "duplicate class" error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • tools
    • None
    • generic
    • solaris_8

      from jacks

      ==== 6.5.5.1-nested-3 A simple type name favors a visible local
              class declaration over member types FAILED
      ==== Contents of test case:

          empty_main T6551n3 {
              class C { // local
                  static final int i = 1;
              }
              new Object() {
                  class C { // member
                      static final int i = 2;
                  }
                  void foo(int j) {
                      switch (j) {
                          case 0:
                          case 1:
                          // C refers to the member class, since the local is
                          // shadowed, hence C.i is 2
                          case C.i:
                      }
                  }
              };
          }

      ---- Result was:
      FAIL
      ---- Result should have been:
      PASS
      ==== 6.5.5.1-nested-3 FAILED


           1 class T {
           2 void f() {
           3 class C { // local
           4 static final int i = 1;
           5 }
           6 new Object() {
           7 class C { // member
           8 static final int i = 2;
           9 }
          10 void foo(int j) {
          11 switch (j) {
          12 case 0:
          13 case 1:
          14 // C refers to the member class, since the local is
          15 // shadowed, hence C.i is 2
          16 case C.i:
          17 }
          18 }
          19 };
          20 }
          21 }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: