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

Incorrect inheritance of inaccessible static method

    Details

    • Subcomponent:
    • Resolved In Build:
      b09
    • Verification:
      Verified

      Backports

        Description

        This code:

        === base/BaseImpl.java ===
        package base;

        public class BaseImpl {
          static void foo(Object o) {}
        }
        ===

        === Test.java ===
        class Impl extends base.BaseImpl {
          public void foo(Object o) {}
        }

        class MyImpl extends Impl {
          public void m(Object o) {
            foo(o);
          }
        }
        ===

        after compilation:
        javac base/BaseImpl.java Test.java

        fails with:
        Test.java:7: error: no enclosing instance of type Impl is in scope
            foo(o);
            ^

        reported by Liam Miller-Cushon at compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-February/008511.html

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vromero Vicente Arturo Romero Zaldivar
                  Reporter:
                  abuckley Alex Buckley
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: