修改:修改标识符添加方式

wuhaoyang
RenFengJiang 10 months ago
parent b007bb9f3b
commit 1390585ba5
  1. 13
      sonar-keyware-plugins-java/src/main/java/com/keyware/sonar/java/rules/checkers/InputSQLVerifyChecker.java

@ -53,15 +53,12 @@ public class InputSQLVerifyChecker extends IssuableSubscriptionVisitor {
@Override
public void visitIfStatement(IfStatementTree tree) {
ExpressionTree condition = tree.condition();
if(condition instanceof MethodInvocationTree){
MethodInvocationTree methodInvocationTree = (MethodInvocationTree) condition;
ExpressionTree expressionTree = methodInvocationTree.methodSelect();
if(expressionTree instanceof MemberSelectExpressionTreeImpl){
MemberSelectExpressionTreeImpl memberSelectExpressionTree = (MemberSelectExpressionTreeImpl) expressionTree;
//将if判断中的参数存入集合中
lists.add(memberSelectExpressionTree.expression().toString());
condition.accept(new BaseTreeVisitor(){
@Override
public void visitIdentifier(IdentifierTree tree) {
lists.add(tree.name());
}
}
});
}
@Override

Loading…
Cancel
Save