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

Package private members not found for intersection types

    Details

    • Subcomponent:
    • Introduced In Version:
      5.0
    • Resolved In Build:
      b73
    • CPU:
      x86
    • OS:
      windows_nt, windows_xp
    • Verification:
      Verified

      Description

      Failing tests : javac/regression/tigerbugs/5079756

      Name: rmT116609 Date: 07/12/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b56)
      Java HotSpot(TM) Client VM (build 1.5.0-beta3-b56, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      The invocation of generic method m1() has return type C1&I1&I2. The compiler allows methods on I1 & I2 to be invoked, but it complains about methods on C1.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      javac Test.java

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
        Program compiles without errors.

      ACTUAL -
      Test.java:9: cannot find symbol
      symbol: method c1m1()
              m1(c2, c3).c1m1();
                ^
      1 error

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Test {
          static String foo;
          public static void main(String[] args) {
              C2 c2 = null;
              C3 c3 = null;

              m1(c2, c3).c1m1();
              m1(c2, c3).i1m1();
              m1(c2, c3).i2m1();
          }

          public static <T> T m1(T t1, T t2) {
              return null;
          }

          class C1 { void c1m1() {} }
          interface I1 { void i1m1(); }
          interface I2 { void i2m1(); }

          class C2 extends C1 implements I1, I2 {
              public void i1m1() { }
              public void i2m1() { }
          }

          class C3 extends C1 implements I1, I2 {
              public void i1m1() { }
              public void i2m1() { }
          }

      }
      ---------- END SOURCE ----------
      (Incident Review ID: 285400)
      ======================================================================
      ###@###.### 2005-03-03 00:15:59 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ahe Peter Ahe
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: