Specialized condition

This commit is contained in:
Clément Fournier
2017-03-22 18:50:30 +01:00
parent 22139c14b4
commit ddf49c4f17

View File

@ -57,7 +57,7 @@ public class InefficientEmptyStringCheckRule extends AbstractInefficientZeroChec
Node prevCall = node.jjtGetChild(node.jjtGetNumChildren() - 4);
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);
}
}