sonarqube:更改此条件,使其不会始终评估为“true”

时间:2016-10-13 10:55:00

标签: java sonarqube

Sonarqube抱怨条件

if(inputMsgPath==null || outputFormat==null || swiftStdsVersion==null)

(参见下面的代码段)总是评估为true,但事实并非如此。这只是一个sonarqube bug吗?

String inputMsgPath = null;
String outputFormat = null;
String swiftStdsVersion = null;
String assertionsPath = null;
List<Assertion> assertions = null;

for( int i=0; i<args.length; i+=2){
    if("-i".equals(args[i])){
        inputMsgPath = args[++i];
    }
    else if("-o".equals(args[i])){
        outputFormat = args[++i];
    }
    else if("-s".equals(args[i])){
        swiftStdsVersion = args[++i];
    }
    else if("-a".equals(args[i])){
        assertionsPath = args[++i];
    }
}

if(inputMsgPath==null || outputFormat==null || swiftStdsVersion==null){
    printSyntax();
    return;
}

0 个答案:

没有答案