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

Inaccessible nested classes can be incorrectly imported

XMLWordPrintable

    • b53
    • Verified

        Type-import-on-demand (import pack.*; ) makes private nested types (classes, enums...) visible.
        It is true for JDK9 b42 with new import behavior.

        For example, the following test will compile without errors:

        package pack;
        import pack.A.Outer.*;

        class A {
            static class Outer<X extends Inner> {
                private static class Inner{}
             }
        }

        The failed JCK tests are:
        lang/PKGS/pkgs087/pkgs08701m1e03/pkgs08701m1e03.html

              jlahoda Jan Lahoda
              kbarzilovich Konstantin Barzilovich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: