在旧的Apache Axis 1.2.1生成的代码上进行AST扫描时,Sonarqube跳动 [英] Sonarqube thrashing when doing AST scan on old Apache Axis 1.2.1 generated code

查看:83
本文介绍了在旧的Apache Axis 1.2.1生成的代码上进行AST扫描时,Sonarqube跳动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apache Axis 1.2.1生成的某些代码上,sonarqube开始扫描它时出现问题.它卡在文件上,然后似乎耗尽了内存并继续运行GC,直到最终停止.

On some code that was generated by Apache Axis 1.2.1, sonarqube started to have issues scanning it. It gets stuck on the file and then seems to eat up memory and keep running GC until it eventually stops.

它将记录如下错误

    Java Main Files AST scan...
    11 source files to be analyzed
    9/11 files analyzed, current is /bamboo-path/TestProjectWAR/src/main/java/com/example/sonar/bug/Contact.java
    9/11 files analyzed, current is /bamboo-path/TestProjectWAR/src/main/java/com/example/sonar/bug/Contact.java    
    [JOURNAL_FLUSHER] WARNING Journal flush operation took 13,241ms last 8 cycles average is 2,192ms
...
Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project TestProject: GC overhead limit exceeded -> [Help 1]

我相信这是在我们更新到Java插件3.3之后开始的,但是我对此不是100%.

I believe this started after we updated to java plugin 3.3, but I'm not 100% on that.

这是该代码的配对版本

public class Contact implements java.io.Serializable {
private java.lang.String cccCntctSeqNo;
private java.lang.Object __equalsCalc = null;

@Override
public synchronized boolean equals(java.lang.Object obj) {
    if (!(obj instanceof Contact)) {
        return false;
    }
    Contact other = (Contact) obj;
    if (obj == null) {
        return false;
    }
    if (this == obj) {
        return true;
    }
    if (__equalsCalc != null) {
        return (__equalsCalc == obj);
    }
    __equalsCalc = obj;
    boolean _equals;
    _equals = true
        && ((this.cccCntctSeqNo == null && other.getCccCntctSeqNo() == null) || (this.cccCntctSeqNo != null && this.cccCntctSeqNo
            .equals(other.getCccCntctSeqNo())))
    __equalsCalc = null;
    return _equals;
}

private boolean __hashCodeCalc = false;

@Override
public synchronized int hashCode() {
    if (__hashCodeCalc) {
        return 0;
    }
    __hashCodeCalc = true;
    int _hashCode = 1;
    if (getCccCntctSeqNo() != null) {
        _hashCode += getCccCntctSeqNo().hashCode();
    }
    __hashCodeCalc = false;
    return _hashCode;
}

}

还有其他人遇到这个问题或发现任何解决方法吗?

Has anyone else come across this or found any work arounds?

推荐答案

似乎您遇到了这个已知问题:

Seems like you are hitting this known issue : http://jira.sonarsource.com/browse/SONARJAVA-1063

包含该修补程序的发布将要发生.

Release containing the fix is about to happen.

这篇关于在旧的Apache Axis 1.2.1生成的代码上进行AST扫描时,Sonarqube跳动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆