com.sun.tools.javac.code.Symbol $ ClassSymbol.isSubClass中的Javac失败

时间:2014-03-02 16:02:41

标签: java maven javac

当我用maven编译我的类时,我遇到了问题。 stacktrace看起来像这样:

[ERROR] Failure executing javac, but could not parse the error:
[ERROR] An exception has occurred in the compiler (1.7.0_51). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
[ERROR] java.lang.NullPointerException
[ERROR] at com.sun.tools.javac.code.Symbol$ClassSymbol.isSubClass(Symbol.java:804)
[ERROR] at com.sun.tools.javac.comp.Lower.accessClass(Lower.java:1023)

oracle (JDK-6956758)的官方错误页面中的堆栈跟踪相同,但1.6.0_20遇到此错误,并在2011-03-08解决,您可以看到我的版本是1.7.0_51。我该怎么做才能摆脱这个问题。

1 个答案:

答案 0 :(得分:1)

问题如下。我有类似这样的代码:

public class Class extends AbstractClass {
    public void increaseSomething(){
        super.something++;
    }

    public void addSomethingElse(int value){
        super.somethingElse += value;
    }
}

删除两个super后,编译器成功运行。我知道这是我的失败,但如果编译器可以打印出这样的失败或IDE可能会很好。