diff --git a/src/test/java/org/apache/commons/jexl3/VarTest.java b/src/test/java/org/apache/commons/jexl3/VarTest.java index 9890975fc..e48ba483f 100644 --- a/src/test/java/org/apache/commons/jexl3/VarTest.java +++ b/src/test/java/org/apache/commons/jexl3/VarTest.java @@ -130,15 +130,15 @@ public Map get(final Map map) { * @return the string representation of year, month or day */ public String get(final String property) { - if ("yyyy".equals(property)) { + switch (property) { + case "yyyy": return Integer.toString(cal.get(Calendar.YEAR)); - } - if ("MM".equals(property)) { + case "MM": return Integer.toString(cal.get(Calendar.MONTH) + 1); - } - - if ("dd".equals(property)) { + case "dd": return Integer.toString(cal.get(Calendar.DAY_OF_MONTH)); + default: + break; } return null; }