tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1360933 - /tomcat/trunk/java/org/apache/catalina/core/
Date Thu, 12 Jul 2012 20:51:28 GMT
Author: markt
Date: Thu Jul 12 20:51:27 2012
New Revision: 1360933

URL: http://svn.apache.org/viewvc?rev=1360933&view=rev
Log:
Code clean-up for o.a.catalina.core
 - Add final prompted by UCDetector
 - Java 7 use of <>

Modified:
    tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterRegistration.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationJspConfigDescriptor.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationJspPropertyGroupDescriptor.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationServletRegistration.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationTaglibDescriptor.java
    tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
    tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
    tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java
    tomcat/trunk/java/org/apache/catalina/core/StandardHost.java
    tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java
    tomcat/trunk/java/org/apache/catalina/core/StandardServer.java
    tomcat/trunk/java/org/apache/catalina/core/StandardService.java
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Thu Jul 12 20:51:27 2012
@@ -132,21 +132,20 @@ public class ApplicationContext
     /**
      * The context attributes for this context.
      */
-    protected Map<String,Object> attributes =
-        new ConcurrentHashMap<String,Object>();
+    protected Map<String,Object> attributes = new ConcurrentHashMap<>();
 
 
     /**
      * List of read only attributes for this context.
      */
-    private Map<String,String> readOnlyAttributes =
-        new ConcurrentHashMap<String,String>();
+    private final Map<String,String> readOnlyAttributes =
+            new ConcurrentHashMap<>();
 
 
     /**
      * The Context instance with which we are associated.
      */
-    private StandardContext context = null;
+    private final StandardContext context;
 
 
     /**
@@ -163,14 +162,14 @@ public class ApplicationContext
     /**
      * The facade around this object.
      */
-    private ServletContext facade = new ApplicationContextFacade(this);
+    private final ServletContext facade = new ApplicationContextFacade(this);
 
 
     /**
      * The merged context initialization parameters for this Context.
      */
     private final ConcurrentHashMap<String,String> parameters =
-        new ConcurrentHashMap<String,String>();
+            new ConcurrentHashMap<>();
 
 
     /**
@@ -183,14 +182,13 @@ public class ApplicationContext
     /**
      * Thread local data used during request dispatch.
      */
-    private ThreadLocal<DispatchData> dispatchData =
-        new ThreadLocal<DispatchData>();
+    private final ThreadLocal<DispatchData> dispatchData = new ThreadLocal<>();
 
 
     /**
      * Session Cookie config
      */
-    private SessionCookieConfig sessionCookieConfig =
+    private final SessionCookieConfig sessionCookieConfig =
         new ApplicationSessionCookieConfig();
 
     /**
@@ -230,7 +228,7 @@ public class ApplicationContext
      */
     @Override
     public Enumeration<String> getAttributeNames() {
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         names.addAll(attributes.keySet());
         return Collections.enumeration(names);
     }
@@ -617,7 +615,7 @@ public class ApplicationContext
     private Set<String> getResourcePathsInternal(DirContext resources,
             String path) {
 
-        ResourceSet<String> set = new ResourceSet<String>();
+        ResourceSet<String> set = new ResourceSet<>();
         try {
             listCollectionPaths(set, resources, path);
         } catch (NamingException e) {
@@ -971,7 +969,6 @@ public class ApplicationContext
     public <T extends Filter> T createFilter(Class<T> c)
     throws ServletException {
         try {
-            @SuppressWarnings("unchecked")
             T filter = (T) context.getInstanceManager().newInstance(c.getName());
             return filter;
         } catch (IllegalAccessException e) {
@@ -1116,7 +1113,6 @@ public class ApplicationContext
     public <T extends Servlet> T createServlet(Class<T> c)
     throws ServletException {
         try {
-            @SuppressWarnings("unchecked")
             T servlet = (T) context.getInstanceManager().newInstance(c.getName());
             context.dynamicServletCreated(servlet);
             return servlet;
@@ -1348,7 +1344,6 @@ public class ApplicationContext
     public <T extends EventListener> T createListener(Class<T> c)
             throws ServletException {
         try {
-            @SuppressWarnings("unchecked")
             T listener =
                 (T) context.getInstanceManager().newInstance(c.getName());
             if (listener instanceof ServletContextListener ||
@@ -1439,8 +1434,7 @@ public class ApplicationContext
 
     @Override
     public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
-        Map<String, ApplicationFilterRegistration> result =
-            new HashMap<String, ApplicationFilterRegistration>();
+        Map<String, ApplicationFilterRegistration> result = new HashMap<>();
 
         FilterDef[] filterDefs = context.findFilterDefs();
         for (FilterDef filterDef : filterDefs) {
@@ -1460,8 +1454,7 @@ public class ApplicationContext
 
     @Override
     public Map<String, ? extends ServletRegistration> getServletRegistrations() {
-        Map<String, ApplicationServletRegistration> result =
-            new HashMap<String, ApplicationServletRegistration>();
+        Map<String, ApplicationServletRegistration> result = new HashMap<>();
 
         Container[] wrappers = context.findChildren();
         for (Container wrapper : wrappers) {
@@ -1485,7 +1478,7 @@ public class ApplicationContext
     protected void clearAttributes() {
 
         // Create list of attributes to be removed
-        ArrayList<String> list = new ArrayList<String>();
+        ArrayList<String> list = new ArrayList<>();
         Iterator<String> iter = attributes.keySet().iterator();
         while (iter.hasNext()) {
             list.add(iter.next());

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java Thu Jul 12 20:51:27 2012
@@ -64,13 +64,13 @@ public class ApplicationContextFacade im
     /**
      * Cache Class object used for reflection.
      */
-    private HashMap<String,Class<?>[]> classCache;
+    private final HashMap<String,Class<?>[]> classCache;
 
 
     /**
      * Cache method object.
      */
-    private HashMap<String,Method> objectCache;
+    private final HashMap<String,Method> objectCache;
 
 
     // ----------------------------------------------------------- Constructors
@@ -86,8 +86,8 @@ public class ApplicationContextFacade im
         super();
         this.context = context;
 
-        classCache = new HashMap<String,Class<?>[]>();
-        objectCache = new HashMap<String,Method>();
+        classCache = new HashMap<>();
+        objectCache = new HashMap<>();
         initClassCache();
     }
 
@@ -127,7 +127,7 @@ public class ApplicationContextFacade im
     /**
      * Wrapped application context.
      */
-    private ApplicationContext context = null;
+    private final ApplicationContext context;
 
 
     // ------------------------------------------------- ServletContext Methods

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Thu Jul 12 20:51:27 2012
@@ -88,8 +88,8 @@ final class ApplicationDispatcher
 
     protected class PrivilegedForward
             implements PrivilegedExceptionAction<Void> {
-        private ServletRequest request;
-        private ServletResponse response;
+        private final ServletRequest request;
+        private final ServletResponse response;
 
         PrivilegedForward(ServletRequest request, ServletResponse response)
         {
@@ -106,8 +106,8 @@ final class ApplicationDispatcher
 
     protected class PrivilegedInclude implements
             PrivilegedExceptionAction<Void> {
-        private ServletRequest request;
-        private ServletResponse response;
+        private final ServletRequest request;
+        private final ServletResponse response;
 
         PrivilegedInclude(ServletRequest request, ServletResponse response)
         {
@@ -223,37 +223,37 @@ final class ApplicationDispatcher
     /**
      * The Context this RequestDispatcher is associated with.
      */
-    private Context context = null;
+    private final Context context;
 
 
     /**
      * The servlet name for a named dispatcher.
      */
-    private String name = null;
+    private final String name;
 
 
     /**
      * The extra path information for this RequestDispatcher.
      */
-    private String pathInfo = null;
+    private final String pathInfo;
 
 
     /**
      * The query string parameters for this RequestDispatcher.
      */
-    private String queryString = null;
+    private final String queryString;
 
 
     /**
      * The request URI for this RequestDispatcher.
      */
-    private String requestURI = null;
+    private final String requestURI;
 
 
     /**
      * The servlet path for this RequestDispatcher.
      */
-    private String servletPath = null;
+    private final String servletPath;
 
 
     /**
@@ -267,14 +267,14 @@ final class ApplicationDispatcher
      * The InstanceSupport instance associated with our Wrapper (used to
      * send "before dispatch" and "after dispatch" events.
      */
-    private InstanceSupport support = null;
+    private final InstanceSupport support;
 
 
     /**
      * The Wrapper associated with the resource that will be forwarded to
      * or included.
      */
-    private Wrapper wrapper = null;
+    private final Wrapper wrapper;
 
 
     // --------------------------------------------------------- Public Methods

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java Thu Jul 12 20:51:27 2012
@@ -62,8 +62,8 @@ final class ApplicationFilterChain imple
 
     static {
         if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
-            lastServicedRequest = new ThreadLocal<ServletRequest>();
-            lastServicedResponse = new ThreadLocal<ServletResponse>();
+            lastServicedRequest = new ThreadLocal<>();
+            lastServicedResponse = new ThreadLocal<>();
         } else {
             lastServicedRequest = null;
             lastServicedResponse = null;
@@ -136,30 +136,28 @@ final class ApplicationFilterChain imple
      * Static class array used when the SecurityManager is turned on and
      * <code>doFilter</code> is invoked.
      */
-    private static Class<?>[] classType = new Class[]{ServletRequest.class,
-                                                      ServletResponse.class,
-                                                      FilterChain.class};
+    private static final Class<?>[] classType = new Class[]{
+        ServletRequest.class, ServletResponse.class, FilterChain.class};
 
     /**
      * Static class array used when the SecurityManager is turned on and
      * <code>service</code> is invoked.
      */
-    private static Class<?>[] classTypeUsedInService = new Class[]{
-                                                         ServletRequest.class,
-                                                         ServletResponse.class};
+    private static final Class<?>[] classTypeUsedInService = new Class[]{
+        ServletRequest.class, ServletResponse.class};
 
     /**
      * Static class array used when the SecurityManager is turned on and
      * <code>doFilterEvent</code> is invoked.
      */
-    private static Class<?>[] cometClassType =
+    private static final Class<?>[] cometClassType =
         new Class[]{ CometEvent.class, CometFilterChain.class};
 
     /**
      * Static class array used when the SecurityManager is turned on and
      * <code>event</code> is invoked.
      */
-    private static Class<?>[] classTypeUsedInEvent =
+    private static final Class<?>[] classTypeUsedInEvent =
         new Class[] { CometEvent.class };
 
 

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java Thu Jul 12 20:51:27 2012
@@ -115,7 +115,7 @@ public final class ApplicationFilterConf
     /**
      * The Context with which we are associated.
      */
-    private transient Context context = null;
+    private final transient Context context;
 
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterRegistration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterRegistration.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterRegistration.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterRegistration.java Thu Jul 12 20:51:27 2012
@@ -41,8 +41,8 @@ public class ApplicationFilterRegistrati
     private static final StringManager sm =
       StringManager.getManager(Constants.Package);
 
-    private FilterDef filterDef;
-    private Context context;
+    private final FilterDef filterDef;
+    private final Context context;
 
     public ApplicationFilterRegistration(FilterDef filterDef,
             Context context) {
@@ -112,7 +112,7 @@ public class ApplicationFilterRegistrati
 
     @Override
     public Collection<String> getServletNameMappings() {
-        Collection<String> result = new HashSet<String>();
+        Collection<String> result = new HashSet<>();
 
         FilterMap[] filterMaps = context.findFilterMaps();
 
@@ -128,7 +128,7 @@ public class ApplicationFilterRegistrati
 
     @Override
     public Collection<String> getUrlPatternMappings() {
-        Collection<String> result = new HashSet<String>();
+        Collection<String> result = new HashSet<>();
 
         FilterMap[] filterMaps = context.findFilterMaps();
 
@@ -154,7 +154,7 @@ public class ApplicationFilterRegistrati
 
     @Override
     public Map<String, String> getInitParameters() {
-        ParameterMap<String,String> result = new ParameterMap<String,String>();
+        ParameterMap<String,String> result = new ParameterMap<>();
         result.putAll(filterDef.getParameterMap());
         result.setLocked(true);
         return result;
@@ -184,7 +184,7 @@ public class ApplicationFilterRegistrati
     @Override
     public Set<String> setInitParameters(Map<String, String> initParameters) {
 
-        Set<String> conflicts = new HashSet<String>();
+        Set<String> conflicts = new HashSet<>();
 
         for (Map.Entry<String, String> entry : initParameters.entrySet()) {
             if (entry.getKey() == null || entry.getValue() == null) {

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java Thu Jul 12 20:51:27 2012
@@ -105,7 +105,7 @@ class ApplicationHttpRequest extends Htt
     /**
      * The context for this request.
      */
-    protected Context context = null;
+    protected final Context context;
 
 
     /**
@@ -118,7 +118,7 @@ class ApplicationHttpRequest extends Htt
      * If this request is cross context, since this changes session access
      * behavior.
      */
-    protected boolean crossContext = false;
+    protected final boolean crossContext;
 
 
     /**
@@ -185,7 +185,7 @@ class ApplicationHttpRequest extends Htt
     /**
      * Special attributes.
      */
-    protected Object[] specialAttributes = new Object[specials.length];
+    protected final Object[] specialAttributes = new Object[specials.length];
 
 
     // ------------------------------------------------- ServletRequest Methods
@@ -625,9 +625,10 @@ class ApplicationHttpRequest extends Htt
      */
     Map<String, String[]> copyMap(Map<String, String[]> orig) {
 
-        if (orig == null)
-            return (new HashMap<String, String[]>());
-        HashMap<String, String[]> dest = new HashMap<String, String[]>();
+        if (orig == null) {
+            return (new HashMap<>());
+        }
+        HashMap<String, String[]> dest = new HashMap<>();
 
         for (Map.Entry<String, String[]> entry : orig.entrySet()) {
             dest.put(entry.getKey(), entry.getValue());
@@ -734,7 +735,7 @@ class ApplicationHttpRequest extends Htt
             return;
         }
 
-        parameters = new HashMap<String, String[]>();
+        parameters = new HashMap<>();
         parameters = copyMap(getRequest().getParameterMap());
         mergeParameters();
         parsedParams = true;
@@ -826,7 +827,7 @@ class ApplicationHttpRequest extends Htt
      */
     protected String[] mergeValues(Object values1, Object values2) {
 
-        ArrayList<Object> results = new ArrayList<Object>();
+        ArrayList<Object> results = new ArrayList<>();
 
         if (values1 == null) {
             // Skip - nothing to merge
@@ -870,7 +871,7 @@ class ApplicationHttpRequest extends Htt
         if ((queryParamString == null) || (queryParamString.length() < 1))
             return;
 
-        HashMap<String, String[]> queryParameters = new HashMap<String, String[]>();
+        HashMap<String, String[]> queryParameters = new HashMap<>();
         String encoding = getCharacterEncoding();
         if (encoding == null)
             encoding = "ISO-8859-1";
@@ -902,17 +903,19 @@ class ApplicationHttpRequest extends Htt
     protected class AttributeNamesEnumerator implements Enumeration<String> {
 
         protected int pos = -1;
-        protected int last = -1;
-        protected Enumeration<String> parentEnumeration = null;
+        protected final int last;
+        protected final Enumeration<String> parentEnumeration;
         protected String next = null;
 
         public AttributeNamesEnumerator() {
+            int last = -1;
             parentEnumeration = getRequest().getAttributeNames();
             for (int i = 0; i < specialAttributes.length; i++) {
                 if (getAttribute(specials[i]) != null) {
                     last = i;
                 }
             }
+            this.last = last;
         }
 
         @Override

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationJspConfigDescriptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationJspConfigDescriptor.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationJspConfigDescriptor.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationJspConfigDescriptor.java Thu Jul 12 20:51:27 2012
@@ -27,11 +27,10 @@ import javax.servlet.descriptor.TaglibDe
 
 public class ApplicationJspConfigDescriptor implements JspConfigDescriptor {
 
-    private Collection<JspPropertyGroupDescriptor> jspPropertyGroups =
-        new LinkedHashSet<JspPropertyGroupDescriptor>();
+    private final Collection<JspPropertyGroupDescriptor> jspPropertyGroups =
+        new LinkedHashSet<>();
 
-    private Collection<TaglibDescriptor> taglibs =
-        new HashSet<TaglibDescriptor>();
+    private final Collection<TaglibDescriptor> taglibs = new HashSet<>();
 
     @Override
     public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups() {

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationJspPropertyGroupDescriptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationJspPropertyGroupDescriptor.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationJspPropertyGroupDescriptor.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationJspPropertyGroupDescriptor.java Thu Jul 12 20:51:27 2012
@@ -28,11 +28,7 @@ import org.apache.catalina.deploy.JspPro
 public class ApplicationJspPropertyGroupDescriptor
         implements JspPropertyGroupDescriptor{
 
-    /**
-     * @deprecated  Will be made private in 8.0.x
-     */
-    @Deprecated
-    JspPropertyGroup jspPropertyGroup;
+    private final JspPropertyGroup jspPropertyGroup;
 
 
     public ApplicationJspPropertyGroupDescriptor(
@@ -164,7 +160,7 @@ public class ApplicationJspPropertyGroup
 
     @Override
     public Collection<String> getUrlPatterns() {
-        Collection<String> result = new HashSet<String>();
+        Collection<String> result = new HashSet<>();
 
         if (jspPropertyGroup.getUrlPattern() != null) {
             result.add(jspPropertyGroup.getUrlPattern());

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java Thu Jul 12 20:51:27 2012
@@ -42,8 +42,8 @@ import org.apache.tomcat.util.http.fileu
  */
 public class ApplicationPart implements Part {
 
-    private FileItem fileItem;
-    private MultipartConfigElement mce;
+    private final FileItem fileItem;
+    private final MultipartConfigElement mce;
 
     public ApplicationPart(FileItem fileItem, MultipartConfigElement mce) {
         this.fileItem = fileItem;
@@ -71,7 +71,7 @@ public class ApplicationPart implements 
     @Override
     public Collection<String> getHeaderNames() {
         if (fileItem instanceof DiskFileItem) {
-            HashSet<String> headerNames = new HashSet<String>();
+            HashSet<String> headerNames = new HashSet<>();
             Iterator<String> iter =
                 ((DiskFileItem) fileItem).getHeaders().getHeaderNames();
             while (iter.hasNext()) {
@@ -85,7 +85,7 @@ public class ApplicationPart implements 
     @Override
     public Collection<String> getHeaders(String name) {
         if (fileItem instanceof DiskFileItem) {
-            HashSet<String> headers = new HashSet<String>();
+            HashSet<String> headers = new HashSet<>();
             Iterator<String> iter =
                 ((DiskFileItem) fileItem).getHeaders().getHeaders(name);
             while (iter.hasNext()) {

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java Thu Jul 12 20:51:27 2012
@@ -89,8 +89,7 @@ class ApplicationRequest extends Servlet
      * The request attributes for this request.  This is initialized from the
      * wrapped request, but updates are allowed.
      */
-    protected HashMap<String, Object> attributes =
-        new HashMap<String, Object>();
+    protected final HashMap<String, Object> attributes = new HashMap<>();
 
 
     // ------------------------------------------------- ServletRequest Methods

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationServletRegistration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationServletRegistration.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationServletRegistration.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationServletRegistration.java Thu Jul 12 20:51:27 2012
@@ -42,8 +42,8 @@ public class ApplicationServletRegistrat
     private static final StringManager sm =
       StringManager.getManager(Constants.Package);
 
-    private Wrapper wrapper;
-    private Context context;
+    private final Wrapper wrapper;
+    private final Context context;
 
     public ApplicationServletRegistration(Wrapper wrapper,
             Context context) {
@@ -64,7 +64,7 @@ public class ApplicationServletRegistrat
 
     @Override
     public Map<String, String> getInitParameters() {
-        ParameterMap<String,String> result = new ParameterMap<String,String>();
+        ParameterMap<String,String> result = new ParameterMap<>();
 
         String[] parameterNames = wrapper.findInitParameters();
 
@@ -100,7 +100,7 @@ public class ApplicationServletRegistrat
     @Override
     public Set<String> setInitParameters(Map<String, String> initParameters) {
 
-        Set<String> conflicts = new HashSet<String>();
+        Set<String> conflicts = new HashSet<>();
 
         for (Map.Entry<String, String> entry : initParameters.entrySet()) {
             if (entry.getKey() == null || entry.getValue() == null) {
@@ -168,7 +168,7 @@ public class ApplicationServletRegistrat
             return Collections.emptySet();
         }
 
-        Set<String> conflicts = new HashSet<String>();
+        Set<String> conflicts = new HashSet<>();
 
         for (String urlPattern : urlPatterns) {
             String wrapperName = context.findServletMapping(urlPattern);
@@ -197,7 +197,7 @@ public class ApplicationServletRegistrat
     @Override
     public Collection<String> getMappings() {
 
-        Set<String> result = new HashSet<String>();
+        Set<String> result = new HashSet<>();
         String servletName = wrapper.getName();
 
         String[] urlPatterns = context.findServletMappings();

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationTaglibDescriptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationTaglibDescriptor.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationTaglibDescriptor.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationTaglibDescriptor.java Thu Jul 12 20:51:27 2012
@@ -21,8 +21,8 @@ import javax.servlet.descriptor.TaglibDe
 
 public class ApplicationTaglibDescriptor implements TaglibDescriptor {
 
-    private String location;
-    private String uri;
+    private final String location;
+    private final String uri;
 
     public ApplicationTaglibDescriptor(String location, String uri) {
         this.location = location;

Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Thu Jul 12 20:51:27 2012
@@ -72,13 +72,13 @@ public class DefaultInstanceManager impl
     private final Map<String, Map<String, String>> injectionMap;
     protected final ClassLoader classLoader;
     protected final ClassLoader containerClassLoader;
-    protected boolean privileged;
-    protected boolean ignoreAnnotations;
+    protected final boolean privileged;
+    protected final boolean ignoreAnnotations;
     private final Properties restrictedFilters = new Properties();
     private final Properties restrictedListeners = new Properties();
     private final Properties restrictedServlets = new Properties();
     private final Map<Class<?>, AnnotationCacheEntry[]> annotationCache =
-        new WeakHashMap<Class<?>, AnnotationCacheEntry[]>();
+        new WeakHashMap<>();
 
     public DefaultInstanceManager(Context context, Map<String, Map<String, String>> injectionMap, org.apache.catalina.Context catalinaContext, ClassLoader containerClassLoader) {
         classLoader = catalinaContext.getLoader().getClassLoader();
@@ -156,7 +156,7 @@ public class DefaultInstanceManager impl
     }
 
     private Map<String, String> assembleInjectionsFromClassHierarchy(Class<?> clazz) {
-        Map<String, String> injections = new HashMap<String, String>();
+        Map<String, String> injections = new HashMap<>();
         Map<String, String> currentInjections = null;
         while (clazz != null) {
             currentInjections = this.injectionMap.get(clazz.getName());
@@ -281,7 +281,7 @@ public class DefaultInstanceManager impl
             }
             if (annotationsArray == null) {
                 if (annotations == null) {
-                    annotations = new ArrayList<AnnotationCacheEntry>();
+                    annotations = new ArrayList<>();
                 } else {
                     annotations.clear();
                 }

Modified: tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java Thu Jul 12 20:51:27 2012
@@ -135,8 +135,7 @@ public class NamingContextListener
     /**
      * Objectnames hashtable.
      */
-    protected HashMap<String, ObjectName> objectNames =
-        new HashMap<String, ObjectName>();
+    protected HashMap<String, ObjectName> objectNames = new HashMap<>();
 
 
     /**
@@ -227,7 +226,7 @@ public class NamingContextListener
             if (initialized)
                 return;
 
-            Hashtable<String, Object> contextEnv = new Hashtable<String, Object>();
+            Hashtable<String, Object> contextEnv = new Hashtable<>();
             try {
                 namingContext = new NamingContext(contextEnv, getName());
             } catch (NamingException e) {

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Jul 12 20:51:27 2012
@@ -253,7 +253,7 @@ public class StandardContext extends Con
      * The ordered set of ServletContainerInitializers for this web application.
      */
     private Map<ServletContainerInitializer,Set<Class<?>>> initializers =
-        new LinkedHashMap<ServletContainerInitializer,Set<Class<?>>>();
+        new LinkedHashMap<>();
 
 
     /**
@@ -376,8 +376,7 @@ public class StandardContext extends Con
      * The exception pages for this web application, keyed by fully qualified
      * class name of the Java exception.
      */
-    private HashMap<String, ErrorPage> exceptionPages =
-        new HashMap<String, ErrorPage>();
+    private HashMap<String, ErrorPage> exceptionPages = new HashMap<>();
 
 
     /**
@@ -385,15 +384,14 @@ public class StandardContext extends Con
      * have initialized, keyed by filter name.
      */
     private HashMap<String, ApplicationFilterConfig> filterConfigs =
-        new HashMap<String, ApplicationFilterConfig>();
+            new HashMap<>();
 
 
     /**
      * The set of filter definitions for this application, keyed by
      * filter name.
      */
-    private HashMap<String, FilterDef> filterDefs =
-        new HashMap<String, FilterDef>();
+    private HashMap<String, FilterDef> filterDefs = new HashMap<>();
 
 
     /**
@@ -459,21 +457,20 @@ public class StandardContext extends Con
      * The message destinations for this web application.
      */
     private HashMap<String, MessageDestination> messageDestinations =
-        new HashMap<String, MessageDestination>();
+        new HashMap<>();
 
 
     /**
      * The MIME mappings for this web application, keyed by extension.
      */
-    private HashMap<String, String> mimeMappings =
-        new HashMap<String, String>();
+    private HashMap<String, String> mimeMappings = new HashMap<>();
 
 
     /**
      * The context initialization parameters for this web application,
      * keyed by name.
      */
-    private HashMap<String, String> parameters = new HashMap<String, String>();
+    private HashMap<String, String> parameters = new HashMap<>();
 
 
     /**
@@ -534,8 +531,7 @@ public class StandardContext extends Con
      * The security role mappings for this application, keyed by role
      * name (as used within the application).
      */
-    private HashMap<String, String> roleMappings =
-        new HashMap<String, String>();
+    private HashMap<String, String> roleMappings = new HashMap<>();
 
 
     /**
@@ -550,8 +546,7 @@ public class StandardContext extends Con
      * The servlet mappings for this web application, keyed by
      * matching pattern.
      */
-    private HashMap<String, String> servletMappings =
-        new HashMap<String, String>();
+    private HashMap<String, String> servletMappings = new HashMap<>();
 
     private final Object servletMappingsLock = new Object();
 
@@ -571,8 +566,7 @@ public class StandardContext extends Con
      * HTTP status code (as an Integer). Note status code zero is used for the
      * default error page.
      */
-    private HashMap<Integer, ErrorPage> statusPages =
-        new HashMap<Integer, ErrorPage>();
+    private HashMap<Integer, ErrorPage> statusPages = new HashMap<>();
 
 
     /**
@@ -828,7 +822,7 @@ public class StandardContext extends Con
     private JspConfigDescriptor jspConfigDescriptor =
         new ApplicationJspConfigDescriptor();
 
-    private Set<String> resourceOnlyServlets = new HashSet<String>();
+    private Set<String> resourceOnlyServlets = new HashSet<>();
 
     private String webappVersion = "";
 
@@ -840,7 +834,7 @@ public class StandardContext extends Con
      * Servlets created via {@link ApplicationContext#createServlet(Class)} for
      * tracking purposes.
      */
-    private Set<Servlet> createdServlets = new HashSet<Servlet>();
+    private Set<Servlet> createdServlets = new HashSet<>();
 
     private boolean preemptiveAuthentication = false;
 
@@ -3557,8 +3551,7 @@ public class StandardContext extends Con
      *
      * @param name Name of the desired message destination ref
      */
-    public MessageDestinationRef
-        findMessageDestinationRef(String name) {
+    public MessageDestinationRef findMessageDestinationRef(String name) {
 
         return namingResources.findMessageDestinationRef(name);
 
@@ -3570,8 +3563,7 @@ public class StandardContext extends Con
      * application.  If none have been defined, a zero-length array
      * is returned.
      */
-    public MessageDestinationRef[]
-        findMessageDestinationRefs() {
+    public MessageDestinationRef[] findMessageDestinationRefs() {
 
         return namingResources.findMessageDestinationRefs();
 
@@ -4698,8 +4690,8 @@ public class StandardContext extends Con
         }
 
         // Sort listeners in two arrays
-        ArrayList<Object> eventListeners = new ArrayList<Object>();
-        ArrayList<Object> lifecycleListeners = new ArrayList<Object>();
+        ArrayList<Object> eventListeners = new ArrayList<>();
+        ArrayList<Object> lifecycleListeners = new ArrayList<>();
         for (int i = 0; i < results.length; i++) {
             if ((results[i] instanceof ServletContextAttributeListener)
                 || (results[i] instanceof ServletRequestAttributeListener)
@@ -4847,7 +4839,7 @@ public class StandardContext extends Con
 
         boolean ok = true;
 
-        Hashtable<String, String> env = new Hashtable<String, String>();
+        Hashtable<String, String> env = new Hashtable<>();
         if (getParent() != null)
             env.put(ProxyDirContext.HOST, getParent().getName());
         env.put(ProxyDirContext.CONTEXT, getName());
@@ -4961,8 +4953,7 @@ public class StandardContext extends Con
     public void loadOnStartup(Container children[]) {
 
         // Collect "load on startup" servlets that need to be initialized
-        TreeMap<Integer, ArrayList<Wrapper>> map =
-            new TreeMap<Integer, ArrayList<Wrapper>>();
+        TreeMap<Integer, ArrayList<Wrapper>> map = new TreeMap<>();
         for (int i = 0; i < children.length; i++) {
             Wrapper wrapper = (Wrapper) children[i];
             int loadOnStartup = wrapper.getLoadOnStartup();
@@ -4971,7 +4962,7 @@ public class StandardContext extends Con
             Integer key = Integer.valueOf(loadOnStartup);
             ArrayList<Wrapper> list = map.get(key);
             if (list == null) {
-                list = new ArrayList<Wrapper>();
+                list = new ArrayList<>();
                 map.put(key, list);
             }
             list.add(wrapper);
@@ -5329,7 +5320,7 @@ public class StandardContext extends Con
     }
 
     private Map<String, Map<String, String>> buildInjectionMap(NamingResources namingResources) {
-        Map<String, Map<String, String>> injectionMap = new HashMap<String, Map<String, String>>();
+        Map<String, Map<String, String>> injectionMap = new HashMap<>();
         for (Injectable resource: namingResources.findLocalEjbs()) {
             addInjectionTarget(resource, injectionMap);
         }
@@ -5362,7 +5353,7 @@ public class StandardContext extends Con
                 String clazz = injectionTarget.getTargetClass();
                 Map<String, String> injections = injectionMap.get(clazz);
                 if (injections == null) {
-                    injections = new HashMap<String, String>();
+                    injections = new HashMap<>();
                     injectionMap.put(clazz, injections);
                 }
                 injections.put(injectionTarget.getTargetName(), jndiName);
@@ -5379,7 +5370,7 @@ public class StandardContext extends Con
      * the application parameters appropriately.
      */
     private void mergeParameters() {
-        Map<String,String> mergedParams = new HashMap<String,String>();
+        Map<String,String> mergedParams = new HashMap<>();
 
         String names[] = findParameters();
         for (int i = 0; i < names.length; i++) {
@@ -5696,7 +5687,7 @@ public class StandardContext extends Con
             ServletRegistration.Dynamic registration,
             ServletSecurityElement servletSecurityElement) {
 
-        Set<String> conflicts = new HashSet<String>();
+        Set<String> conflicts = new HashSet<>();
 
         Collection<String> urlPatterns = registration.getMappings();
         for (String urlPattern : urlPatterns) {
@@ -5845,7 +5836,7 @@ public class StandardContext extends Con
         if (parent == null) {
         namingContextName = getName();
         } else {
-        Stack<String> stk = new Stack<String>();
+        Stack<String> stk = new Stack<>();
         StringBuilder buff = new StringBuilder();
         while (parent != null) {
             stk.push(parent.getName());

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java Thu Jul 12 20:51:27 2012
@@ -105,7 +105,7 @@ public class StandardEngine extends Cont
      * the intended host and context.
      */
     private final AtomicReference<AccessLog> defaultAccessLog =
-        new AtomicReference<AccessLog>();
+        new AtomicReference<>();
 
     // ------------------------------------------------------------- Properties
 
@@ -416,9 +416,9 @@ public class StandardEngine extends Cont
             implements PropertyChangeListener, LifecycleListener,
             ContainerListener {
 
-        private StandardEngine engine;
-        private Host host;
-        private Context context;
+        private final StandardEngine engine;
+        private final Host host;
+        private final Context context;
         private volatile boolean disabled = false;
 
         public AccessLogListener(StandardEngine engine, Host host,

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHost.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHost.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Thu Jul 12 20:51:27 2012
@@ -169,8 +169,8 @@ public class StandardHost extends Contai
       * Track the class loaders for the child web applications so memory leaks
       * can be detected.
       */
-     private Map<ClassLoader, String> childClassLoaders =
-         new WeakHashMap<ClassLoader, String>();
+     private final Map<ClassLoader, String> childClassLoaders =
+             new WeakHashMap<>();
 
 
      /**
@@ -713,7 +713,7 @@ public class StandardHost extends Contai
 
         System.gc();
 
-        List<String> result = new ArrayList<String>();
+        List<String> result = new ArrayList<>();
 
         for (Map.Entry<ClassLoader, String> entry :
                 childClassLoaders.entrySet()) {

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardPipeline.java Thu Jul 12 20:51:27 2012
@@ -369,7 +369,7 @@ public class StandardPipeline extends Li
     @Override
     public Valve[] getValves() {
 
-        ArrayList<Valve> valveList = new ArrayList<Valve>();
+        ArrayList<Valve> valveList = new ArrayList<>();
         Valve current = first;
         if (current == null) {
             current = basic;
@@ -385,7 +385,7 @@ public class StandardPipeline extends Li
 
     public ObjectName[] getValveObjectNames() {
 
-        ArrayList<ObjectName> valveList = new ArrayList<ObjectName>();
+        ArrayList<ObjectName> valveList = new ArrayList<>();
         Valve current = first;
         if (current == null) {
             current = basic;

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardServer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardServer.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardServer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardServer.java Thu Jul 12 20:51:27 2012
@@ -76,10 +76,10 @@ public final class StandardServer extend
         globalNamingResources.setContainer(this);
 
         if (isUseNaming()) {
-            if (namingContextListener == null) {
-                namingContextListener = new NamingContextListener();
-                addLifecycleListener(namingContextListener);
-            }
+            namingContextListener = new NamingContextListener();
+            addLifecycleListener(namingContextListener);
+        } else {
+            namingContextListener = null;
         }
 
     }
@@ -103,7 +103,7 @@ public final class StandardServer extend
     /**
      * The naming context listener for this web application.
      */
-    private NamingContextListener namingContextListener = null;
+    private final NamingContextListener namingContextListener;
 
 
     /**
@@ -146,7 +146,7 @@ public final class StandardServer extend
     /**
      * The property change support for this component.
      */
-    protected PropertyChangeSupport support = new PropertyChangeSupport(this);
+    protected final PropertyChangeSupport support = new PropertyChangeSupport(this);
 
     private volatile boolean stopAwait = false;
 

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardService.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardService.java Thu Jul 12 20:51:27 2012
@@ -73,7 +73,7 @@ public class StandardService extends Lif
     /**
      * The property change support for this component.
      */
-    protected PropertyChangeSupport support = new PropertyChangeSupport(this);
+    protected final PropertyChangeSupport support = new PropertyChangeSupport(this);
 
 
     /**
@@ -84,7 +84,7 @@ public class StandardService extends Lif
     /**
      *
      */
-    protected ArrayList<Executor> executors = new ArrayList<Executor>();
+    protected final ArrayList<Executor> executors = new ArrayList<>();
 
     /**
      * The Container associated with this Service.

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Thu Jul 12 20:51:27 2012
@@ -115,20 +115,19 @@ public class StandardWrapper extends Con
     /**
      * The broadcaster that sends j2ee notifications.
      */
-    protected NotificationBroadcasterSupport broadcaster = null;
+    protected final NotificationBroadcasterSupport broadcaster;
 
     /**
      * The count of allocations that are currently active (even if they
      * are for the same instance, as will be true on a non-STM servlet).
      */
-    protected AtomicInteger countAllocated = new AtomicInteger(0);
+    protected final AtomicInteger countAllocated = new AtomicInteger(0);
 
 
     /**
      * The facade associated with this wrapper.
      */
-    protected StandardWrapperFacade facade =
-        new StandardWrapperFacade(this);
+    protected final StandardWrapperFacade facade = new StandardWrapperFacade(this);
 
 
     /**
@@ -145,7 +144,7 @@ public class StandardWrapper extends Con
     /**
      * The support object for our instance listeners.
      */
-    protected InstanceSupport instanceSupport = new InstanceSupport(this);
+    protected final InstanceSupport instanceSupport = new InstanceSupport(this);
 
 
     /**
@@ -158,14 +157,14 @@ public class StandardWrapper extends Con
     /**
      * Mappings associated with the wrapper.
      */
-    protected ArrayList<String> mappings = new ArrayList<String>();
+    protected final ArrayList<String> mappings = new ArrayList<>();
 
 
     /**
      * The initialization parameters for this servlet, keyed by
      * parameter name.
      */
-    protected HashMap<String, String> parameters = new HashMap<String, String>();
+    protected HashMap<String, String> parameters = new HashMap<>();
 
 
     /**
@@ -173,7 +172,7 @@ public class StandardWrapper extends Con
      * used in the servlet.  The corresponding value is the role name of
      * the web application itself.
      */
-    protected HashMap<String, String> references = new HashMap<String, String>();
+    protected HashMap<String, String> references = new HashMap<>();
 
 
     /**
@@ -604,7 +603,7 @@ public class StandardWrapper extends Con
             return DEFAULT_SERVLET_METHODS;
         }
 
-        HashSet<String> allow = new HashSet<String>();
+        HashSet<String> allow = new HashSet<>();
         allow.add("TRACE");
         allow.add("OPTIONS");
 
@@ -1133,7 +1132,7 @@ public class StandardWrapper extends Con
 
             if (servlet instanceof SingleThreadModel) {
                 if (instancePool == null) {
-                    instancePool = new Stack<Servlet>();
+                    instancePool = new Stack<>();
                 }
                 singleThreadModel = true;
             }

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java?rev=1360933&r1=1360932&r2=1360933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java Thu Jul 12 20:51:27 2012
@@ -56,7 +56,7 @@ public final class StandardWrapperFacade
     /**
      * Wrapped config.
      */
-    private ServletConfig config = null;
+    private final ServletConfig config;
 
 
     /**



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


Mime
View raw message