使用有关例外的Intellij时遇到一个奇怪的编译错误,这是一个错误吗?

时间:2019-02-13 09:45:35

标签: intellij-idea javac

当基类具有与派生类具有相同名称和参数的私有方法时,IntelliJ似乎会感到困惑。

    static class A {
        private void a() {
        }
    }

    static class B extends A {
        void a() throws InterruptedException {
        }

        void b() {
            try {
                a();
            } catch (InterruptedException e) {
                // can't catch here
                // IntelliJ is not happy
            }
        }
    }

1 个答案:

答案 0 :(得分:1)

是的,此行为是一个错误。它将得到解决。

披露:我是负责相应子系统的IntelliJ IDEA开发人员。