【问题标题】:I meet a strange compiling error when using Intellij about exceptions, is it a bug?使用 Intellij 关于异常时遇到一个奇怪的编译错误,这是一个错误吗?
【发布时间】:2019-02-13 09:45:34
【问题描述】:

当基类具有与派生类具有相同名称和参数的私有方法时,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
            }
        }
    }

【问题讨论】:

标签: intellij-idea javac


【解决方案1】:

是的,这种行为是一个错误。会修复的。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-07
    • 2022-01-25
    • 1970-01-01
    相关资源
    最近更新 更多