Fix a bug in ImplicitObjectELResolver.ScopeMap intruduced when applying generics...
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 17 Feb 2010 01:52:41 +0000 (01:52 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 17 Feb 2010 01:52:41 +0000 (01:52 +0000)
the get(String) and remove(String) methods were not overwriting the ones of AbstractMap,
because those are declared as get(Object) and remove(Object),
thus using ineffective implementations provided by AbstractMap.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@910796 13f79535-47bb-0310-9956-ffa450edef68

java/javax/servlet/jsp/el/ImplicitObjectELResolver.java

index b3bbf98..3288c27 100644 (file)
@@ -561,9 +561,10 @@ public class ImplicitObjectELResolver extends ELResolver {
 
         }
 
-        public final V get(String key) {
+        @Override
+        public final V get(Object key) {
             if (key != null) {
-                return getAttribute(key);
+                return getAttribute((String) key);
             }
             return null;
         }
@@ -574,18 +575,19 @@ public class ImplicitObjectELResolver extends ELResolver {
                 throw new NullPointerException();
             }
             if (value == null) {
-                this.removeAttribute(key.toString());
+                this.removeAttribute(key);
             } else {
-                this.setAttribute(key.toString(), value);
+                this.setAttribute(key, value);
             }
             return null;
         }
 
-        public final V remove(String key) {
+        @Override
+        public final V remove(Object key) {
             if (key == null) {
                 throw new NullPointerException();
             }
-            this.removeAttribute(key.toString());
+            this.removeAttribute((String) key);
             return null;
         }