private boolean containsSingleInterpolatoinLiteral(Expression exp, int recursionDepth) { if (exp == null) return false; // Just in case a loop ever gets into the AST somehow, try not fill the stack and such: if (recursionDepth > 20) return false; if (exp instanceof StringLiteral && ((StringLiteral) exp).isSingleInterpolationLiteral()) return true; int paramCnt = exp.getParameterCount(); for (int i = 0; i < paramCnt; i++) { Object paramValue = exp.getParameterValue(i); if (paramValue instanceof Expression) { boolean result = containsSingleInterpolatoinLiteral((Expression) paramValue, recursionDepth + 1); if (result) return true; } } return false; }
if (containsSingleInterpolatoinLiteral(blamed, 0)) { extraTip = "It has been noticed that you are using ${...} as the sole content of a quoted string. That " + "does nothing but forcably converts the value inside ${...} to string (as it inserts it into "
private boolean containsSingleInterpolatoinLiteral(Expression exp, int recursionDepth) { if (exp == null) return false; // Just in case a loop ever gets into the AST somehow, try not fill the stack and such: if (recursionDepth > 20) return false; if (exp instanceof StringLiteral && ((StringLiteral) exp).isSingleInterpolationLiteral()) return true; int paramCnt = exp.getParameterCount(); for (int i = 0; i < paramCnt; i++) { Object paramValue = exp.getParameterValue(i); if (paramValue instanceof Expression) { boolean result = containsSingleInterpolatoinLiteral((Expression) paramValue, recursionDepth + 1); if (result) return true; } } return false; }
private boolean containsSingleInterpolatoinLiteral(Expression exp, int recursionDepth) { if (exp == null) return false; // Just in case a loop ever gets into the AST somehow, try not fill the stack and such: if (recursionDepth > 20) return false; if (exp instanceof StringLiteral && ((StringLiteral) exp).isSingleInterpolationLiteral()) return true; int paramCnt = exp.getParameterCount(); for (int i = 0; i < paramCnt; i++) { Object paramValue = exp.getParameterValue(i); if (paramValue instanceof Expression) { boolean result = containsSingleInterpolatoinLiteral((Expression) paramValue, recursionDepth + 1); if (result) return true; } } return false; }
if (containsSingleInterpolatoinLiteral(blamed, 0)) { extraTip = "It has been noticed that you are using ${...} as the sole content of a quoted string. That " + "does nothing but forcably converts the value inside ${...} to string (as it inserts it into "
if (containsSingleInterpolatoinLiteral(blamed, 0)) { extraTip = "It has been noticed that you are using ${...} as the sole content of a quoted string. That " + "does nothing but forcably converts the value inside ${...} to string (as it inserts it into "