--- java/javax/servlet/jsp/el/ImplicitObjectELResolver.java (revision 1403052) +++ java/javax/servlet/jsp/el/ImplicitObjectELResolver.java (working copy) @@ -20,8 +20,8 @@ import java.beans.FeatureDescriptor; import java.util.AbstractMap; import java.util.ArrayList; -import java.util.Arrays; import java.util.Enumeration; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -73,6 +73,14 @@ private static final int SESSION_SCOPE = 10; + private static final Map scopeMap = new HashMap<>(); + + static { + for (int i = 0; i < SCOPE_NAMES.length; i++) { + scopeMap.put(SCOPE_NAMES[i], Integer.valueOf(i)); + } + } + public ImplicitObjectELResolver() { super(); } @@ -85,13 +93,13 @@ } if (base == null && property != null) { - int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString()); + Integer idx = scopeMap.get(property.toString()); - if (idx >= 0) { + if (idx != null) { PageContext page = (PageContext) context .getContext(JspContext.class); context.setPropertyResolved(true); - switch (idx) { + switch (idx.intValue()) { case APPLICATIONSCOPE: return ScopeManager.get(page).getApplicationScope(); case COOKIE: @@ -129,8 +137,8 @@ } if (base == null && property != null) { - int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString()); - if (idx >= 0) { + Integer idx = scopeMap.get(property.toString()); + if (idx != null) { context.setPropertyResolved(true); } } @@ -147,8 +155,8 @@ } if (base == null && property != null) { - int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString()); - if (idx >= 0) { + Integer idx = scopeMap.get(property.toString()); + if (idx != null) { context.setPropertyResolved(true); throw new PropertyNotWritableException(); } @@ -163,8 +171,8 @@ } if (base == null && property != null) { - int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString()); - if (idx >= 0) { + Integer idx = scopeMap.get(property.toString()); + if (idx != null) { context.setPropertyResolved(true); return true; }