More succinct return statements

This commit is contained in:
Owen Stephens 2017-11-14 17:40:07 +00:00
parent 25dd347123
commit 7ba110e31a

View File

@ -76,16 +76,16 @@ abstract public class ExpressionStringComparisonRowFilter implements RowFilter {
Object[] a = (Object[]) value;
for (Object v : a) {
if (checkValue(v instanceof String ? ((String) v) : v.toString())) {
return (invert) ? false : true;
return !invert;
}
}
} else if (value instanceof Collection<?>) {
for (Object v : ExpressionUtils.toObjectCollection(value)) {
if (checkValue(v.toString())) {
return (invert) ? false : true;
return !invert;
}
}
return (invert) ? true : false;
return invert;
} else if (value instanceof JSONArray) {
JSONArray a = (JSONArray) value;
int l = a.length();
@ -93,20 +93,20 @@ abstract public class ExpressionStringComparisonRowFilter implements RowFilter {
for (int i = 0; i < l; i++) {
try {
if (checkValue(a.get(i).toString())) {
return (invert) ? false : true;
return !invert;
}
} catch (JSONException e) {
// ignore
}
}
return (invert) ? true : false;
return invert;
} else {
if (checkValue(value instanceof String ? ((String) value) : value.toString())) {
return (invert) ? false : true;
return !invert;
}
}
}
return (invert) ? true : false;
return invert;
}
abstract protected boolean checkValue(String s);