tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1195962 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/ha/context/ java/org/apache/catalina/session/ java/org/apache/catalina/util/ java/org/apache/jasper/runtime/...
Date Tue, 01 Nov 2011 12:37:25 GMT
Author: markt
Date: Tue Nov  1 12:37:24 2011
New Revision: 1195962

URL: http://svn.apache.org/viewvc?rev=1195962&view=rev
Log:
Deprecate use of o.a.[catalina|jasper].util.enumeration and replace with Collections.enumeration

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationRequest.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/Enumerator.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/Enumerator.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  1 12:37:24 2011
@@ -1 +1 @@
-/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166693,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172556,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096
 ,1173241,1173256,1173288,1173333,1173342,1173461,1173614,1173630,1173659,1173722,1174061,1174239,1174322,1174325,1174329-1174330,1174337-1174339,1174343,1174353,1174799,1174882,1174884,1174983,1175155,1175158,1175167,1175182,1175190,1175201,1175272,1175275,1175283,1175582,1175589-1175590,1175594,1175602,1175613,1175633,1175690,1175713,1175889,1175896,1175907,1176584,1176590,1176799,1177050,1177060,1177125,1177152,1177160,1177245,1177850,1177862,1177978,1178209,1178228,1178233,1178449,1178542,1178681,1178684,1178721,1179268,1179274,1180261,1180865,1180891,1180894,1180907,1181028,1181123,1181125,1181136,1181291,1181743,1182796,1183078,1183105,1183142,1183328,1183339-1183340,1183492-1183494,1183605,1184917,1184919,1185018,1185020,1185200,1185588,1185626,1185756,1185758,1186011,1186042-1186045,1186104,1186123,1186137,1186153,1186254,1186257,1186377-1186379,1186479-1186480,1186712,1186743,1186750,1186763,1186890-1186892,1186894,1186949,1187018,1187027-1187028,1187381,1187755,1187
 775,1187827,1188301,1188303-1188305,1188399,1188822,1188930-1188931,1189116,1189129,1189183,1189240,1189256,1189386,1189413-1189414,1189477,1189685,1189805,1189857,1189864,1189882,1190034,1190185,1190279,1190339,1190371,1190388-1190389,1190474,1190481,1194915,1195222-1195223,1195531,1195899,1195905,1195943,1195949
+/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166693,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172556,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096
 ,1173241,1173256,1173288,1173333,1173342,1173461,1173614,1173630,1173659,1173722,1174061,1174239,1174322,1174325,1174329-1174330,1174337-1174339,1174343,1174353,1174799,1174882,1174884,1174983,1175155,1175158,1175167,1175182,1175190,1175201,1175272,1175275,1175283,1175582,1175589-1175590,1175594,1175602,1175613,1175633,1175690,1175713,1175889,1175896,1175907,1176584,1176590,1176799,1177050,1177060,1177125,1177152,1177160,1177245,1177850,1177862,1177978,1178209,1178228,1178233,1178449,1178542,1178681,1178684,1178721,1179268,1179274,1180261,1180865,1180891,1180894,1180907,1181028,1181123,1181125,1181136,1181291,1181743,1182796,1183078,1183105,1183142,1183328,1183339-1183340,1183492-1183494,1183605,1184917,1184919,1185018,1185020,1185200,1185588,1185626,1185756,1185758,1186011,1186042-1186045,1186104,1186123,1186137,1186153,1186254,1186257,1186377-1186379,1186479-1186480,1186712,1186743,1186750,1186763,1186890-1186892,1186894,1186949,1187018,1187027-1187028,1187381,1187755,1187
 775,1187827,1188301,1188303-1188305,1188399,1188822,1188930-1188931,1189116,1189129,1189183,1189240,1189256,1189386,1189413-1189414,1189477,1189685,1189805,1189857,1189864,1189882,1190034,1190185,1190279,1190339,1190371,1190388-1190389,1190474,1190481,1194915,1195222-1195223,1195531,1195899,1195905,1195943,1195949,1195953,1195955

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java Tue Nov  1 12:37:24
2011
@@ -31,10 +31,12 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 import java.util.TimeZone;
 import java.util.TreeMap;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -71,7 +73,6 @@ import org.apache.catalina.core.Applicat
 import org.apache.catalina.core.AsyncContextImpl;
 import org.apache.catalina.deploy.LoginConfig;
 import org.apache.catalina.realm.GenericPrincipal;
-import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.ParameterMap;
 import org.apache.catalina.util.StringParser;
 import org.apache.coyote.ActionCode;
@@ -1030,7 +1031,11 @@ public class Request
         if (isSecure() && !sslAttributesParsed) {
             getAttribute(Globals.CERTIFICATES_ATTR);
         }
-        return new Enumerator<String>(attributes.keySet(), true);
+        // Take a copy to prevent ConncurrentModificationExceptions if used to
+        // remove attributes
+        Set<String> names = new HashSet<String>();
+        names.addAll(attributes.keySet());
+        return Collections.enumeration(names);
     }
 
 
@@ -1119,10 +1124,10 @@ public class Request
             parseLocales();
 
         if (locales.size() > 0)
-            return (new Enumerator<Locale>(locales));
+            return Collections.enumeration(locales);
         ArrayList<Locale> results = new ArrayList<Locale>();
         results.add(defaultLocale);
-        return new Enumerator<Locale>(results);
+        return Collections.enumeration(results);
 
     }
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java Tue Nov  1
12:37:24 2011
@@ -29,6 +29,7 @@ import java.util.EnumSet;
 import java.util.Enumeration;
 import java.util.EventListener;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -66,7 +67,6 @@ import org.apache.catalina.Service;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Connector;
 import org.apache.catalina.deploy.FilterDef;
-import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.ResourceSet;
 import org.apache.catalina.util.ServerInfo;
@@ -248,9 +248,9 @@ public class ApplicationContext
      */
     @Override
     public Enumeration<String> getAttributeNames() {
-
-        return new Enumerator<String>(attributes.keySet(), true);
-
+        Set<String> names = new HashSet<String>();
+        names.addAll(attributes.keySet());
+        return Collections.enumeration(names);
     }
 
 
@@ -332,7 +332,7 @@ public class ApplicationContext
      */
     @Override
     public Enumeration<String> getInitParameterNames() {
-        return (new Enumerator<String>(parameters.keySet()));
+        return Collections.enumeration(parameters.keySet());
     }
 
 
@@ -686,7 +686,7 @@ public class ApplicationContext
     @Override
     @Deprecated
     public Enumeration<String> getServletNames() {
-        return (new Enumerator<String>(emptyString));
+        return Collections.enumeration(emptyString);
     }
 
 
@@ -696,7 +696,7 @@ public class ApplicationContext
     @Override
     @Deprecated
     public Enumeration<Servlet> getServlets() {
-        return (new Enumerator<Servlet>(emptyServlet));
+        return Collections.enumeration(emptyServlet);
     }
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java Tue Nov
 1 12:37:24 2011
@@ -21,10 +21,10 @@ package org.apache.catalina.core;
 
 import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.management.ObjectName;
@@ -38,7 +38,6 @@ import org.apache.catalina.Context;
 import org.apache.catalina.Globals;
 import org.apache.catalina.deploy.FilterDef;
 import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.Enumerator;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.InstanceManager;
 import org.apache.tomcat.util.log.SystemLogHandler;
@@ -65,6 +64,11 @@ public final class ApplicationFilterConf
     private static final org.apache.juli.logging.Log log =
         LogFactory.getLog(ApplicationFilterConfig.class);
 
+    /**
+     * Empty String collection to serve as the basis for empty enumerations.
+     */
+    private static final List<String> emptyString = Collections.emptyList();
+
     // ----------------------------------------------------------- Constructors
 
 
@@ -181,11 +185,10 @@ public final class ApplicationFilterConf
         Map<String,String> map = filterDef.getParameterMap();
         
         if (map == null) {
-            return (new Enumerator<String>(new ArrayList<String>()));
+            return Collections.enumeration(emptyString);
         }
 
-        return new Enumerator<String>(map.keySet());
-
+        return Collections.enumeration(map.keySet());
     }
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java Tue Nov
 1 12:37:24 2011
@@ -21,6 +21,7 @@ package org.apache.catalina.core;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -37,7 +38,6 @@ import org.apache.catalina.Context;
 import org.apache.catalina.Globals;
 import org.apache.catalina.Manager;
 import org.apache.catalina.Session;
-import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.RequestUtil;
 
 
@@ -400,8 +400,7 @@ class ApplicationHttpRequest extends Htt
     public Enumeration<String> getParameterNames() {
 
         parseParameters();
-        return (new Enumerator<String>(parameters.keySet()));
-
+        return Collections.enumeration(parameters.keySet());
     }
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationRequest.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationRequest.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationRequest.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationRequest.java Tue Nov  1
12:37:24 2011
@@ -19,6 +19,7 @@
 package org.apache.catalina.core;
 
 
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 
@@ -26,8 +27,6 @@ import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletRequestWrapper;
 
-import org.apache.catalina.util.Enumerator;
-
 
 /**
  * Wrapper around a <code>javax.servlet.ServletRequest</code>
@@ -120,7 +119,7 @@ class ApplicationRequest extends Servlet
     public Enumeration<String> getAttributeNames() {
 
         synchronized (attributes) {
-            return (new Enumerator<String>(attributes.keySet()));
+            return Collections.enumeration(attributes.keySet());
         }
 
     }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java Tue Nov  1 12:37:24
2011
@@ -21,6 +21,7 @@ package org.apache.catalina.core;
 import java.io.PrintStream;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -60,7 +61,6 @@ import org.apache.catalina.LifecycleStat
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.InstanceSupport;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -1568,7 +1568,7 @@ public class StandardWrapper extends Con
 
         try {
             parametersLock.readLock().lock();
-            return (new Enumerator<String>(parameters.keySet()));
+            return Collections.enumeration(parameters.keySet());
         } finally {
             parametersLock.readLock().unlock();
         }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java Tue Nov
 1 12:37:24 2011
@@ -17,7 +17,10 @@
 package org.apache.catalina.ha.context;
 
 import java.util.AbstractMap;
+import java.util.Collections;
 import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.servlet.ServletContext;
@@ -31,7 +34,6 @@ import org.apache.catalina.ha.CatalinaCl
 import org.apache.catalina.tribes.Channel;
 import org.apache.catalina.tribes.tipis.AbstractReplicatedMap.MapOwner;
 import org.apache.catalina.tribes.tipis.ReplicatedMap;
-import org.apache.catalina.util.Enumerator;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -175,11 +177,13 @@ public class ReplicatedContext extends S
         @SuppressWarnings("unchecked")
         @Override
         public Enumeration<String> getAttributeNames() {
+            Set<String> names = new HashSet<String>();
+            names.addAll(attributes.keySet());
+
             return new MultiEnumeration<String>(new Enumeration[] {
                     super.getAttributeNames(),
-                    new Enumerator<String>(tomcatAttributes.keySet(), true)});
+                    Collections.enumeration(names) });
         }
-        
     }
 
     protected static class MultiEnumeration<T> implements Enumeration<T> {

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java Tue Nov  1
12:37:24 2011
@@ -29,11 +29,14 @@ import java.security.AccessController;
 import java.security.Principal;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
-import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -55,7 +58,6 @@ import org.apache.catalina.SessionListen
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.realm.GenericPrincipal;
 import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.Enumerator;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -1199,8 +1201,9 @@ public class StandardSession implements 
             throw new IllegalStateException
                 (sm.getString("standardSession.getAttributeNames.ise"));
 
-        return (new Enumerator<String>(attributes.keySet(), true));
-
+        Set<String> names = new HashSet<String>();
+        names.addAll(attributes.keySet());
+        return Collections.enumeration(names);
     }
 
 
@@ -1889,8 +1892,7 @@ public class StandardSession implements 
 final class StandardSessionContext
         implements javax.servlet.http.HttpSessionContext {
 
-
-    protected HashMap<?,String> dummy = new HashMap<String,String>();
+    private static final List<String> emptyString = Collections.emptyList();
 
     /**
      * Return the session identifiers of all sessions defined
@@ -1903,9 +1905,7 @@ final class StandardSessionContext
     @Override
     @Deprecated
     public Enumeration<String> getIds() {
-
-        return (new Enumerator<String>(dummy));
-
+        return Collections.enumeration(emptyString);
     }
 
 
@@ -1922,10 +1922,6 @@ final class StandardSessionContext
     @Override
     @Deprecated
     public HttpSession getSession(String id) {
-
         return (null);
-
     }
-
-
 }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/Enumerator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/Enumerator.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/Enumerator.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/Enumerator.java Tue Nov  1 12:37:24
2011
@@ -37,7 +37,7 @@ import java.util.NoSuchElementException;
  * @author Craig R. McClanahan
  * @version $Id$
  */
-
+@Deprecated
 public final class Enumerator<T> implements Enumeration<T> {
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java Tue Nov  1
12:37:24 2011
@@ -20,6 +20,7 @@ package org.apache.jasper.runtime;
 import java.io.IOException;
 import java.io.Writer;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -43,7 +44,6 @@ import javax.servlet.jsp.tagext.BodyCont
 import javax.servlet.jsp.tagext.VariableInfo;
 
 import org.apache.jasper.compiler.Localizer;
-import org.apache.jasper.util.Enumerator;
 
 /**
  * Implementation of a JSP Context Wrapper.
@@ -233,7 +233,7 @@ public class JspContextWrapper extends P
     @Override
     public Enumeration<String> getAttributeNamesInScope(int scope) {
         if (scope == PAGE_SCOPE) {
-            return new Enumerator<String>(pageAttributes.keySet().iterator());
+            return Collections.enumeration(pageAttributes.keySet());
         }
 
         return invokingJspCtxt.getAttributeNamesInScope(scope);

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Tue Nov  1 12:37:24
2011
@@ -23,6 +23,7 @@ import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 
@@ -54,7 +55,6 @@ import org.apache.jasper.el.ExpressionEv
 import org.apache.jasper.el.FunctionMapperImpl;
 import org.apache.jasper.el.VariableResolverImpl;
 import org.apache.jasper.security.SecurityUtil;
-import org.apache.jasper.util.Enumerator;
 
 /**
  * Implementation of the PageContext class from the JSP spec. Also doubles as a
@@ -522,7 +522,7 @@ public class PageContextImpl extends Pag
     private Enumeration<String> doGetAttributeNamesInScope(int scope) {
         switch (scope) {
         case PAGE_SCOPE:
-            return new Enumerator<String>(attributes.keySet().iterator());
+            return Collections.enumeration(attributes.keySet());
 
         case REQUEST_SCOPE:
             return request.getAttributeNames();

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/Enumerator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/Enumerator.java?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/Enumerator.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/Enumerator.java Tue Nov  1 12:37:24 2011
@@ -35,7 +35,7 @@ import java.util.NoSuchElementException;
  * @author Craig R. McClanahan
  * @version $Id$
  */
-
+@Deprecated
 public final class Enumerator<T> implements Enumeration<T> {
 
 

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1195962&r1=1195961&r2=1195962&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Nov  1 12:37:24 2011
@@ -165,6 +165,10 @@
         <bug>52091</bug>: Address performance issues related to lock contention
         StandardWrapper. Patch provided by Taiki Sugawara. (markt)
       </fix>
+      <scode>
+        Switch to using Collections.enumeration() rather than custom code that
+        does the same thing. (markt)
+      </scode>
     </changelog>
   </subsection>
   <subsection name="Coyote">
@@ -206,6 +210,10 @@
         <bug>52091</bug>: Address performance issues related to log creation
         TagHandlerPool. Patch provided by Taiki Sugawara. (markt)
       </fix>
+      <scode>
+        Switch to using Collections.enumeration() rather than custom code that
+        does the same thing. (markt)
+      </scode>
     </changelog>
   </subsection>
   <subsection name="Cluster">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message