Specialized condition
This commit is contained in:
@ -57,7 +57,7 @@ public class InefficientEmptyStringCheckRule extends AbstractInefficientZeroChec
|
|||||||
|
|
||||||
Node prevCall = node.jjtGetChild(node.jjtGetNumChildren() - 4);
|
Node prevCall = node.jjtGetChild(node.jjtGetNumChildren() - 4);
|
||||||
String target = prevCall.jjtGetNumChildren() > 0 ? prevCall.jjtGetChild(0).getImage() : prevCall.getImage();
|
String target = prevCall.jjtGetNumChildren() > 0 ? prevCall.jjtGetChild(0).getImage() : prevCall.getImage();
|
||||||
if (target != null && target.indexOf("trim") != -1) {
|
if (target != null && "trim".equals(target) || target.endsWith(".trim")) {
|
||||||
addViolation(data, node);
|
addViolation(data, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user