tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1384085 [1/2] - in /tomcat/sandbox/trunk-resources: ./ java/org/apache/catalina/core/ java/org/apache/catalina/tribes/tipis/ java/org/apache/coyote/spdy/ java/org/apache/jasper/runtime/ java/org/apache/jasper/security/ java/org/apache/jasp...
Date Wed, 12 Sep 2012 18:51:22 GMT
Author: markt
Date: Wed Sep 12 18:51:20 2012
New Revision: 1384085

URL: http://svn.apache.org/viewvc?rev=1384085&view=rev
Log:
Merge latest changes from trunk

Modified:
    tomcat/sandbox/trunk-resources/   (props changed)
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/core/StandardContext.java
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java
    tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProcessor.java
    tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProxyProtocol.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspContextWrapper.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFactoryImpl.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFragmentHelper.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspWriterImpl.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/PageContextImpl.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/security/SecurityUtil.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JasperLoader.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspCServletContext.java
    tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspServletWrapper.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/CheckEol.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/Txt2Html.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocket.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocketContext.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportSocket.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyConnection.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyContext.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyStream.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/IntrospectionUtils.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/   (props changed)
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Method.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Utility.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/StringCache.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/ManagedConcurrentWeakHashMap.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/Digester.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/FactoryCreateRule.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/RulesBase.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/WithDefaultsRulesWrapper.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/XercesParser.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/Parameters.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/fileupload/   (props changed)
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/fileupload/ParameterParser.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/log/SystemLogHandler.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/BaseAttributeFilter.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/ManagedBean.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/Registry.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioBlockingSelector.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioSelectorPool.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/jsse/JSSESupport.java
    tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/res/StringManager.java
    tomcat/sandbox/trunk-resources/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
    tomcat/sandbox/trunk-resources/res/findbugs/filter-false-positives.xml

Propchange: tomcat/sandbox/trunk-resources/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1382848-1384080

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/core/StandardContext.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/core/StandardContext.java Wed Sep 12 18:51:20 2012
@@ -2439,7 +2439,7 @@ public class StandardContext extends Con
 
 
     @Override
-    public synchronized void setResources(WebResourceRoot resources) {
+    public void setResources(WebResourceRoot resources) {
 
         Lock writeLock = resourcesLock.writeLock();
         writeLock.lock();
@@ -2455,11 +2455,12 @@ public class StandardContext extends Con
                 return;
 
             this.resources = resources;
+
+            support.firePropertyChange("resources", oldResources,
+                    resources);
         } finally {
             writeLock.unlock();
         }
-
-        support.firePropertyChange("resources", oldResources, resources);
     }
 
 
@@ -4811,10 +4812,12 @@ public class StandardContext extends Con
             if (resources != null) {
                 resources.stop();
             }
+            this.resources = null;
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("standardContext.resourcesStop"), t);
             ok = false;
+            this.resources = null;
         } finally {
             writeLock.unlock();
         }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Wed Sep 12 18:51:20 2012
@@ -623,17 +623,12 @@ public abstract class AbstractReplicated
             MapEntry<K,V> entry = innerMap.get(mapmsg.getKey());
             if ( entry==null ) {
                 entry = new MapEntry<>((K) mapmsg.getKey(), (V) mapmsg.getValue());
-                entry.setBackup(false);
-                entry.setProxy(true);
-                entry.setBackupNodes(mapmsg.getBackupNodes());
-                entry.setPrimary(mapmsg.getPrimary());
-                innerMap.put(entry.getKey(), entry);
-            } else {
-                entry.setProxy(true);
-                entry.setBackup(false);
-                entry.setBackupNodes(mapmsg.getBackupNodes());
-                entry.setPrimary(mapmsg.getPrimary());
+                entry = innerMap.putIfAbsent(entry.getKey(), entry);
             }
+            entry.setProxy(true);
+            entry.setBackup(false);
+            entry.setBackupNodes(mapmsg.getBackupNodes());
+            entry.setPrimary(mapmsg.getPrimary());
         }
 
         if (mapmsg.getMsgType() == MapMessage.MSG_REMOVE) {
@@ -1036,17 +1031,16 @@ public abstract class AbstractReplicated
 
     @Override
     public boolean containsValue(Object value) {
-        if ( value == null ) {
-            return innerMap.containsValue(value);
-        } else {
-            Iterator<Map.Entry<K,MapEntry<K,V>>> i = innerMap.entrySet().iterator();
-            while (i.hasNext()) {
-                Map.Entry<K,MapEntry<K,V>> e = i.next();
-                MapEntry<K,V> entry = innerMap.get(e.getKey());
-                if (entry!=null && entry.isActive() && value.equals(entry.getValue())) return true;
-            }//while
-            return false;
-        }//end if
+        if (value == null) {
+            throw new NullPointerException();
+        }
+        Iterator<Map.Entry<K,MapEntry<K,V>>> i = innerMap.entrySet().iterator();
+        while (i.hasNext()) {
+            Map.Entry<K,MapEntry<K,V>> e = i.next();
+            MapEntry<K,V> entry = innerMap.get(e.getKey());
+            if (entry!=null && entry.isActive() && value.equals(entry.getValue())) return true;
+        }
+        return false;
     }
 
     @Override

Modified: tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java Wed Sep 12 18:51:20 2012
@@ -99,10 +99,8 @@ public class SpdyAprNpnHandler implement
             return SocketState.OPEN;
         }
 
-        try {
-            ((NetSupportOpenSSL) spdyContext.getNetSupport()).onAcceptLong(socket);
-        } catch (IOException e) {
-        }
+        ((NetSupportOpenSSL) spdyContext.getNetSupport()).onAcceptLong(socket);
+
         // No need to keep tomcat thread busy - but socket will be handled by apr socket context.
         return SocketState.LONG;
     }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProcessor.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProcessor.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProcessor.java Wed Sep 12 18:51:20 2012
@@ -107,7 +107,6 @@ public class SpdyProcessor extends Abstr
                     bchunk.getStart(), rd);
             inFrame.advance(rd);
             if (inFrame.remaining() == 0) {
-                spdy.getSpdyContext().releaseFrame(inFrame);
                 if (!inFrame.isHalfClose()) {
                     inFrame = null;
                 }
@@ -213,14 +212,7 @@ public class SpdyProcessor extends Abstr
         }
         if (!response.isCommitted()) {
             // Validate and write response headers
-            try {
-                sendSynReply();
-            } catch (IOException e) {
-                e.printStackTrace();
-                // Set error flag
-                error = true;
-                return;
-            }
+            sendSynReply();
         }
     }
 
@@ -259,13 +251,7 @@ public class SpdyProcessor extends Abstr
             // transactions with the client
             maybeCommit();
 
-            try {
-                spdyStream.sendDataFrame(EMPTY, 0, 0, true);
-            } catch (IOException e) {
-                // Set error flag
-                e.printStackTrace();
-                error = true;
-            }
+            spdyStream.sendDataFrame(EMPTY, 0, 0, true);
 
         } else if (actionCode == ActionCode.REQ_SSL_ATTRIBUTE) {
 
@@ -401,7 +387,7 @@ public class SpdyProcessor extends Abstr
      * When committing the response, we have to validate the set of headers, as
      * well as setup the response filters.
      */
-    protected void sendSynReply() throws IOException {
+    protected void sendSynReply() {
 
         response.setCommitted(true);
 
@@ -423,7 +409,7 @@ public class SpdyProcessor extends Abstr
         sendResponseHead();
     }
 
-    private void sendResponseHead() throws IOException {
+    private void sendResponseHead() {
         SpdyFrame rframe = spdy.getFrame(SpdyConnection.TYPE_SYN_REPLY);
         rframe.associated = 0;
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProxyProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProxyProtocol.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProxyProtocol.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/coyote/spdy/SpdyProxyProtocol.java Wed Sep 12 18:51:20 2012
@@ -114,11 +114,8 @@ public class SpdyProxyProtocol extends A
         @Override
         public SocketState process(SocketWrapper<Socket> socket,
                 SocketStatus status) {
-            try {
-                spdyContext.getNetSupport().onAccept(socket.getSocket());
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+
+            spdyContext.getNetSupport().onAccept(socket.getSocket());
             return SocketState.CLOSED;
         }
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspApplicationContextImpl.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspApplicationContextImpl.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspApplicationContextImpl.java Wed Sep 12 18:51:20 2012
@@ -53,9 +53,9 @@ public class JspApplicationContextImpl i
     private final ExpressionFactory expressionFactory =
             ExpressionFactory.newInstance();
 
-    private final List<ELContextListener> contextListeners = new ArrayList<ELContextListener>();
+    private final List<ELContextListener> contextListeners = new ArrayList<>();
 
-    private final List<ELResolver> resolvers = new ArrayList<ELResolver>();
+    private final List<ELResolver> resolvers = new ArrayList<>();
 
     private boolean instantiated = false;
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspContextWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspContextWrapper.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspContextWrapper.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspContextWrapper.java Wed Sep 12 18:51:20 2012
@@ -60,22 +60,22 @@ import org.apache.jasper.compiler.Locali
 public class JspContextWrapper extends PageContext implements VariableResolver {
 
     // Invoking JSP context
-    private PageContext invokingJspCtxt;
+    private final PageContext invokingJspCtxt;
 
-    private transient HashMap<String, Object> pageAttributes;
+    private final transient HashMap<String, Object> pageAttributes;
 
     // ArrayList of NESTED scripting variables
-    private ArrayList<String> nestedVars;
+    private final ArrayList<String> nestedVars;
 
     // ArrayList of AT_BEGIN scripting variables
-    private ArrayList<String> atBeginVars;
+    private final ArrayList<String> atBeginVars;
 
     // ArrayList of AT_END scripting variables
-    private ArrayList<String> atEndVars;
+    private final ArrayList<String> atEndVars;
 
-    private Map<String,String> aliases;
+    private final Map<String,String> aliases;
 
-    private HashMap<String, Object> originalNestedVars;
+    private final HashMap<String, Object> originalNestedVars;
 
     public JspContextWrapper(JspContext jspContext,
             ArrayList<String> nestedVars, ArrayList<String> atBeginVars,
@@ -84,11 +84,13 @@ public class JspContextWrapper extends P
         this.nestedVars = nestedVars;
         this.atBeginVars = atBeginVars;
         this.atEndVars = atEndVars;
-        this.pageAttributes = new HashMap<String, Object>(16);
+        this.pageAttributes = new HashMap<>(16);
         this.aliases = aliases;
 
         if (nestedVars != null) {
-            this.originalNestedVars = new HashMap<String, Object>(nestedVars.size());
+            this.originalNestedVars = new HashMap<>(nestedVars.size());
+        } else {
+            this.originalNestedVars = null;
         }
         syncBeginTagFile();
     }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFactoryImpl.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFactoryImpl.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFactoryImpl.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFactoryImpl.java Wed Sep 12 18:51:20 2012
@@ -30,8 +30,6 @@ import javax.servlet.jsp.JspFactory;
 import javax.servlet.jsp.PageContext;
 
 import org.apache.jasper.Constants;
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
 
 /**
  * Implementation of JspFactory.
@@ -40,16 +38,13 @@ import org.apache.juli.logging.LogFactor
  */
 public class JspFactoryImpl extends JspFactory {
 
-    // Logger
-    private final Log log = LogFactory.getLog(JspFactoryImpl.class);
-
     private static final String SPEC_VERSION = "2.1";
     private static final boolean USE_POOL =
         Boolean.valueOf(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL", "true")).booleanValue();
     private static final int POOL_SIZE =
         Integer.valueOf(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.POOL_SIZE", "8")).intValue();
 
-    private ThreadLocal<PageContextPool> localPool = new ThreadLocal<PageContextPool>();
+    private final ThreadLocal<PageContextPool> localPool = new ThreadLocal<>();
 
     @Override
     public PageContext getPageContext(Servlet servlet, ServletRequest request,
@@ -181,7 +176,7 @@ public class JspFactoryImpl extends JspF
 
     protected static final class PageContextPool  {
 
-        private PageContext[] pool;
+        private final PageContext[] pool;
 
         private int current = -1;
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFragmentHelper.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFragmentHelper.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFragmentHelper.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspFragmentHelper.java Wed Sep 12 18:51:20 2012
@@ -33,23 +33,22 @@ import javax.servlet.jsp.tagext.JspTag;
  *
  * @author Mark Roth
  */
-public abstract class JspFragmentHelper
-    extends JspFragment
-{
+public abstract class JspFragmentHelper extends JspFragment {
 
-    protected int discriminator;
-    protected JspContext jspContext;
-    protected PageContext _jspx_page_context;
-    protected JspTag parentTag;
+    protected final int discriminator;
+    protected final JspContext jspContext;
+    protected final PageContext _jspx_page_context;
+    protected final JspTag parentTag;
 
     public JspFragmentHelper( int discriminator, JspContext jspContext,
         JspTag parentTag )
     {
         this.discriminator = discriminator;
         this.jspContext = jspContext;
-        this._jspx_page_context = null;
-        if( jspContext instanceof PageContext ) {
+        if(jspContext instanceof PageContext) {
             _jspx_page_context = (PageContext)jspContext;
+        } else {
+            _jspx_page_context = null;
         }
         this.parentTag = parentTag;
     }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Wed Sep 12 18:51:20 2012
@@ -190,8 +190,11 @@ public class JspRuntimeLibrary {
         } else if (target == Character.class) {
             if (isNullOrEmpty)
                 return Character.valueOf((char) 0);
-            else
-                return Character.valueOf(s.charAt(0));
+            else {
+                @SuppressWarnings("null")
+                Character result = Character.valueOf(s.charAt(0));
+                return result;
+            }
         } else if (target == Double.class) {
             if (isNullOrEmpty)
                 return Double.valueOf(0);
@@ -331,7 +334,7 @@ public class JspRuntimeLibrary {
                     }
                 }
             }
-            if ( method != null ) {
+            if (method != null && type != null) {
                 if (type.isArray()) {
                     if (request == null) {
                         throw new JasperException(

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspWriterImpl.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspWriterImpl.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspWriterImpl.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/JspWriterImpl.java Wed Sep 12 18:51:20 2012
@@ -355,7 +355,7 @@ public class JspWriterImpl extends JspWr
     }
 
 
-    static String lineSeparator = System.getProperty("line.separator");
+    static final String lineSeparator = System.getProperty("line.separator");
 
     /**
      * Write a line separator.  The line separator string is defined by the

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/PageContextImpl.java Wed Sep 12 18:51:20 2012
@@ -112,7 +112,7 @@ public class PageContextImpl extends Pag
      */
     PageContextImpl() {
         this.outs = new BodyContentImpl[0];
-        this.attributes = new HashMap<String, Object>(16);
+        this.attributes = new HashMap<>(16);
         this.depth = -1;
     }
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java Wed Sep 12 18:51:20 2012
@@ -75,7 +75,7 @@ public final class ProtectedFunctionMapp
         } else {
             funcMapper = new ProtectedFunctionMapper();
         }
-        funcMapper.fnmap = new HashMap<String,Method>();
+        funcMapper.fnmap = new HashMap<>();
         return funcMapper;
     }
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java Wed Sep 12 18:51:20 2012
@@ -41,9 +41,9 @@ public class ServletResponseWrapperInclu
     /**
      * PrintWriter which appends to the JspWriter of the including page.
      */
-    private PrintWriter printWriter;
+    private final PrintWriter printWriter;
 
-    private JspWriter jspWriter;
+    private final JspWriter jspWriter;
 
     public ServletResponseWrapperInclude(ServletResponse response,
                                          JspWriter jspWriter) {

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/security/SecurityUtil.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/security/SecurityUtil.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/security/SecurityUtil.java Wed Sep 12 18:51:20 2012
@@ -26,7 +26,7 @@ import org.apache.jasper.Constants;
 
 public final class SecurityUtil{
 
-    private static boolean packageDefinitionEnabled =
+    private static final boolean packageDefinitionEnabled =
          System.getProperty("package.definition") == null ? false : true;
 
     /**

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JasperLoader.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JasperLoader.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JasperLoader.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JasperLoader.java Wed Sep 12 18:51:20 2012
@@ -36,9 +36,9 @@ import org.apache.jasper.Constants;
  */
 public class JasperLoader extends URLClassLoader {
 
-    private PermissionCollection permissionCollection;
-    private ClassLoader parent;
-    private SecurityManager securityManager;
+    private final PermissionCollection permissionCollection;
+    private final ClassLoader parent;
+    private final SecurityManager securityManager;
 
     public JasperLoader(URL[] urls, ClassLoader parent,
                         PermissionCollection permissionCollection) {

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspCServletContext.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspCServletContext.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspCServletContext.java Wed Sep 12 18:51:20 2012
@@ -63,19 +63,19 @@ public class JspCServletContext implemen
     /**
      * Servlet context attributes.
      */
-    protected Hashtable<String,Object> myAttributes;
+    protected final Hashtable<String,Object> myAttributes;
 
 
     /**
      * The log writer we will write log messages to.
      */
-    protected PrintWriter myLogWriter;
+    protected final PrintWriter myLogWriter;
 
 
     /**
      * The base URL (document root) for this context.
      */
-    protected URL myResourceBaseURL;
+    protected final URL myResourceBaseURL;
 
 
     // ----------------------------------------------------------- Constructors

Modified: tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspServletWrapper.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/jasper/servlet/JspServletWrapper.java Wed Sep 12 18:51:20 2012
@@ -83,16 +83,16 @@ public class JspServletWrapper {
     private final Log log = LogFactory.getLog(JspServletWrapper.class);
 
     private Servlet theServlet;
-    private String jspUri;
+    private final String jspUri;
     private Class<?> tagHandlerClass;
-    private JspCompilationContext ctxt;
+    private final JspCompilationContext ctxt;
     private long available = 0L;
-    private ServletConfig config;
-    private Options options;
+    private final ServletConfig config;
+    private final Options options;
     private boolean firstTime = true;
     /** Whether the servlet needs reloading on next access */
     private volatile boolean reload = true;
-    private boolean isTagFile;
+    private final boolean isTagFile;
     private int tripCount;
     private JasperException compileException;
     /** Timestamp of last time servlet resource was modified */

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/CheckEol.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/CheckEol.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/CheckEol.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/CheckEol.java Wed Sep 12 18:51:20 2012
@@ -44,7 +44,7 @@ public class CheckEol extends Task {
     private static final String eoln = System.getProperty("line.separator");
 
     /** The files to be checked */
-    private final List<FileSet> filesets = new LinkedList<FileSet>();
+    private final List<FileSet> filesets = new LinkedList<>();
 
     /**
      * Sets the files to be checked
@@ -77,7 +77,7 @@ public class CheckEol extends Task {
 
         int count = 0;
 
-        List<CheckFailure> errors = new ArrayList<CheckFailure>();
+        List<CheckFailure> errors = new ArrayList<>();
 
         // Step through each file and check.
         for (FileSet fs : filesets) {

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/Txt2Html.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/Txt2Html.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/Txt2Html.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/buildutil/Txt2Html.java Wed Sep 12 18:51:20 2012
@@ -50,7 +50,7 @@ public class Txt2Html
     private File todir;
 
     /** The file to be converted into HTML */
-    private final List<FileSet> filesets = new LinkedList<FileSet>();
+    private final List<FileSet> filesets = new LinkedList<>();
 
     /**
      * Sets the directory to contain the resulting files

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocket.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocket.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocket.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocket.java Wed Sep 12 18:51:20 2012
@@ -363,7 +363,7 @@ public class AprSocket implements Runnab
 
      */
 
-    public void close() throws IOException {
+    public void close() {
         synchronized (this) {
             if ((status & CLOSED) != 0 || socket == 0) {
                 return;
@@ -442,11 +442,7 @@ public class AprSocket implements Runnab
      */
     public void reset() {
         setStatus(ERROR);
-        try {
-            close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
+        close();
     }
 
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocketContext.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocketContext.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocketContext.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/jni/socket/AprSocketContext.java Wed Sep 12 18:51:20 2012
@@ -118,7 +118,7 @@ public class AprSocketContext {
     /**
      * Pollers.
      */
-    List<AprPoller> pollers = new ArrayList<AprPoller>();
+    List<AprPoller> pollers = new ArrayList<>();
     static int pollerCnt = 0;
 
     // Set on all accepted or connected sockets.
@@ -133,7 +133,7 @@ public class AprSocketContext {
     // If false: use executor ( but that may choke the acceptor thread )
     protected boolean nonBlockingAccept = false;
 
-    BlockingQueue<AprSocket> acceptedQueue = new LinkedBlockingQueue<AprSocket>();
+    BlockingQueue<AprSocket> acceptedQueue = new LinkedBlockingQueue<>();
 
     /**
      * Root APR memory pool.
@@ -167,7 +167,7 @@ public class AprSocketContext {
     RawDataHandler rawDataHandler = null;
 
     // TODO: do we need this here ?
-    protected Map<String, HostInfo> hosts = new HashMap<String, HostInfo>();
+    protected Map<String, HostInfo> hosts = new HashMap<>();
 
     String[] enabledCiphers;
 
@@ -338,8 +338,7 @@ public class AprSocketContext {
     /**
      * Set certificate, will also enable TLS mode.
      */
-    public AprSocketContext setKeys(String certPemFile, String keyDerFile)
-            throws IOException {
+    public AprSocketContext setKeys(String certPemFile, String keyDerFile) {
         this.sslMode = true;
         setTls();
         certFile = certPemFile;
@@ -387,7 +386,7 @@ public class AprSocketContext {
             throw new IOException("Missing certificates for server");
         }
         if (sslMode || !nonBlockingAccept) {
-            acceptorDispatch = new AcceptorDispatchThread(port);
+            acceptorDispatch = new AcceptorDispatchThread();
             acceptorDispatch.setName("AprAcceptorDispatch-" + port);
             acceptorDispatch.start();
         }
@@ -403,18 +402,18 @@ public class AprSocketContext {
     /**
      * Get a socket for connectiong to host:port.
      */
-    public AprSocket socket(String host, int port, boolean ssl) throws IOException {
+    public AprSocket socket(String host, int port, boolean ssl) {
         HostInfo hi = getHostInfo(host, port, ssl);
         return socket(hi);
     }
 
-    public AprSocket socket(HostInfo hi) throws IOException {
+    public AprSocket socket(HostInfo hi) {
         AprSocket sock = newSocket(this);
         sock.setHost(hi);
         return sock;
     }
 
-    public AprSocket socket(long socket) throws IOException {
+    public AprSocket socket(long socket) {
         AprSocket sock = newSocket(this);
         // Tomcat doesn't set this
         SSLExt.sslSetMode(socket, SSLExt.SSL_MODE_ENABLE_PARTIAL_WRITE |
@@ -502,7 +501,7 @@ public class AprSocketContext {
         }
     }
 
-    AprSocket newSocket(AprSocketContext context) throws IOException {
+    AprSocket newSocket(AprSocketContext context) {
         return new AprSocket(context);
     }
 
@@ -524,7 +523,7 @@ public class AprSocketContext {
     }
 
 
-    public void stop() throws IOException {
+    public void stop() {
         synchronized (pollers) {
             if (!running) {
                 return;
@@ -689,10 +688,6 @@ public class AprSocketContext {
                 throw new IOException(e);
             }
 
-            long mode =
-                    SSLExt.sslCtxSetMode(sslCtx, SSLExt.SSL_MODE_ENABLE_PARTIAL_WRITE |
-                            SSLExt.SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
-
             // TODO: try release buffers
             }
         }
@@ -739,11 +734,11 @@ public class AprSocketContext {
     }
 
     /**
-     * Called on each accepted socket ( for servers ) or after connection (client)
+     * Called on each accepted socket (for servers) or after connection (client)
      * after handshake.
      */
-    protected void onSocket(AprSocket s) throws IOException {
-
+    protected void onSocket(@SuppressWarnings("unused") AprSocket s) {
+        // Defaults to NO-OP. Parameter is used by sub-classes.
     }
 
     class AcceptorThread extends Thread {
@@ -859,7 +854,7 @@ public class AprSocketContext {
 
     class AcceptorDispatchThread extends Thread {
 
-        AcceptorDispatchThread(int port) {
+        AcceptorDispatchThread() {
             setDaemon(true);
         }
 
@@ -886,19 +881,18 @@ public class AprSocketContext {
     AprPoller allocatePoller() throws IOException {
         long pool = Pool.create(getRootPool());
         int size = maxConnections / pollerThreadCount;
-        int timeout = keepAliveTimeout;
 
-        long serverPollset = allocatePoller(size, pool, timeout);
+        long serverPollset = allocatePoller(size, pool);
 
         if (serverPollset == 0 && size > 1024) {
             log.severe("Falling back to 1024-sized poll, won't scale");
             size = 1024;
-            serverPollset = allocatePoller(size, pool, timeout);
+            serverPollset = allocatePoller(size, pool);
         }
         if (serverPollset == 0) {
             log.severe("Falling back to 62-sized poll, won't scale");
             size = 62;
-            serverPollset = allocatePoller(size, pool, timeout);
+            serverPollset = allocatePoller(size, pool);
         }
 
         AprPoller res = new AprPoller();
@@ -921,12 +915,12 @@ public class AprSocketContext {
     // last test shows a small improvement, can switch later.
     static boolean sizeLogged = false;
 
-    protected long allocatePoller(int size, long pool, int timeout) {
+    protected long allocatePoller(int size, long pool) {
         int flag = threadSafe ? Poll.APR_POLLSET_THREADSAFE: 0;
         for (int i = 0; i < 2; i++) {
             try {
                 //  timeout must be -1 - or ttl will take effect, strange results.
-                return Poll.create(size, pool, flag, -1); // timeout * 1000);
+                return Poll.create(size, pool, flag, -1);
             } catch (Error e) {
                 e.printStackTrace();
                 if (Status.APR_STATUS_IS_EINVAL(e.getError())) {
@@ -963,7 +957,7 @@ public class AprSocketContext {
 
         // Should be replaced with socket data.
         // used only to lookup by socket
-        Map<Long, AprSocket> channels = new HashMap<Long, AprSocket>();
+        Map<Long, AprSocket> channels = new HashMap<>();
 
         // Active + pending, must be < desc.length / 2
         // The channel will also have poller=this when active or pending
@@ -974,7 +968,7 @@ public class AprSocketContext {
 
         protected AtomicInteger pollCount = new AtomicInteger();
 
-        private List<AprSocket> updates = new ArrayList<AprSocket>();
+        private List<AprSocket> updates = new ArrayList<>();
 
         @Override
         public void run() {
@@ -1024,7 +1018,7 @@ public class AprSocketContext {
                             boolean blocking = false;
 
                             synchronized (channels) {
-                                ch = channels.get(sock);
+                                ch = channels.get(Long.valueOf(sock));
                                 if (ch != null) {
                                     blocking = ch.isBlocking();
                                 } else {
@@ -1040,7 +1034,6 @@ public class AprSocketContext {
                             // Check for failed sockets and hand this socket off to a worker
                             long mask = desc[pollIdx * 2];
 
-                            boolean hup = ((mask & Poll.APR_POLLHUP) == Poll.APR_POLLHUP);
                             boolean err = ((mask & Poll.APR_POLLERR) == Poll.APR_POLLERR);
                             boolean nval = ((mask & Poll.APR_POLLNVAL) != 0);
                             if (err || nval) {
@@ -1256,7 +1249,7 @@ public class AprSocketContext {
                 if (ch.isClosed()) {
                     synchronized (channels) {
                         ch.poller = null;
-                        channels.remove(ch.socket);
+                        channels.remove(Long.valueOf(ch.socket));
                     }
                     keepAliveCount.decrementAndGet();
                     ch.reset();
@@ -1290,7 +1283,7 @@ public class AprSocketContext {
                     failed = true;
                 } else {
                     polledCount.incrementAndGet();
-                    channels.put(up.socket, up);
+                    channels.put(Long.valueOf(up.socket), up);
                     up.setStatus(AprSocket.POLL);
                 }
             }
@@ -1304,7 +1297,7 @@ public class AprSocketContext {
          * Called only from IO thread. Remove from Poll and channels,
          * set POLL bit to false.
          */
-        private void removeSafe(AprSocket up) throws IOException {
+        private void removeSafe(AprSocket up) {
             int rv = Status.APR_EGENERAL;
             if (running && serverPollset != 0 && up.socket != 0
                     && !up.isClosed()) {

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java Wed Sep 12 18:51:20 2012
@@ -48,7 +48,7 @@ public class NetSupportOpenSSL extends S
     @Override
     public boolean isSpdy(Object socketW) {
         byte[] proto = new byte[32];
-        int len = SSLExt.getNPN((Long) socketW, proto);
+        int len = SSLExt.getNPN(((Long) socketW).longValue(), proto);
         return len == 6; // todo: check spdy/2
     }
 
@@ -75,11 +75,11 @@ public class NetSupportOpenSSL extends S
     }
 
     @Override
-    public void onAccept(Object socket) throws IOException {
-        onAcceptLong((Long) socket);
+    public void onAccept(Object socket) {
+        onAcceptLong(((Long) socket).longValue());
     }
 
-    public void onAcceptLong(long socket) throws IOException {
+    public void onAcceptLong(long socket) {
         SpdyConnectionAprSocket spdy = new SpdyConnectionAprSocket(ctx);
         AprSocket s = con.socket(socket);
         spdy.setSocket(s);
@@ -98,7 +98,7 @@ public class NetSupportOpenSSL extends S
     public void listen(final int port, String cert, String key) throws IOException {
         con = new AprSocketContext() {
             @Override
-            protected void onSocket(AprSocket s) throws IOException {
+            protected void onSocket(AprSocket s) {
                 SpdyConnectionAprSocket spdy = new SpdyConnectionAprSocket(ctx);
                 spdy.setSocket(s);
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportSocket.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportSocket.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportSocket.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/NetSupportSocket.java Wed Sep 12 18:51:20 2012
@@ -29,10 +29,6 @@ import javax.net.ssl.SSLSocket;
 public class NetSupportSocket extends SpdyContext.NetSupport {
 
     @Override
-    public void onCreateEngine(Object engine) {
-    }
-
-    @Override
     public boolean isSpdy(Object socketW) {
         return false;
     }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyConnection.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyConnection.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyConnection.java Wed Sep 12 18:51:20 2012
@@ -47,7 +47,7 @@ public abstract class SpdyConnection { /
     protected CompressSupport compressSupport;
 
     // Fields stored for each spdy connection
-    Map<Integer, SpdyStream> channels = new HashMap<Integer, SpdyStream>();
+    Map<Integer, SpdyStream> channels = new HashMap<>();
 
     // --------------
     protected static final Logger log = Logger.getLogger(SpdyConnection.class
@@ -112,9 +112,9 @@ public abstract class SpdyConnection { /
     int outStreamId = 1;
 
     // TODO: finer handling of priorities
-    LinkedList<SpdyFrame> prioriyQueue = new LinkedList<SpdyFrame>();
+    LinkedList<SpdyFrame> prioriyQueue = new LinkedList<>();
 
-    LinkedList<SpdyFrame> outQueue = new LinkedList<SpdyFrame>();
+    LinkedList<SpdyFrame> outQueue = new LinkedList<>();
 
     // --------------
 
@@ -246,7 +246,8 @@ public abstract class SpdyConnection { /
                         out.streamId = outStreamId;
                         outStreamId += 2;
                         synchronized(channels) {
-                            channels.put(out.streamId, out.stream);
+                            channels.put(Integer.valueOf(out.streamId),
+                                    out.stream);
                         }
                     }
 
@@ -286,7 +287,7 @@ public abstract class SpdyConnection { /
                             out.stream.finSent = true;
                         }
                         if (out.stream.finRcvd && out.stream.finSent) {
-                            channels.remove(out.streamId);
+                            channels.remove(Integer.valueOf(out.streamId));
                         }
                     }
                 }
@@ -305,8 +306,7 @@ public abstract class SpdyConnection { /
      *
      * With a nb transport it should call drain directly.
      */
-    public void nonBlockingSend(SpdyFrame oframe, SpdyStream proc)
-            throws IOException {
+    public void nonBlockingSend(SpdyFrame oframe, SpdyStream proc) {
         queueFrame(oframe, proc, oframe.pri == 0 ? outQueue : prioriyQueue);
         getSpdyContext().getExecutor().execute(nbDrain);
     }
@@ -324,14 +324,13 @@ public abstract class SpdyConnection { /
      * Add the frame to the queue and send until the queue is empty.
      *
      */
-    public void send(SpdyFrame oframe, SpdyStream proc)
-            throws IOException {
+    public void send(SpdyFrame oframe, SpdyStream proc) {
         queueFrame(oframe, proc, oframe.pri == 0 ? outQueue : prioriyQueue);
         drain();
     }
 
     private void queueFrame(SpdyFrame oframe, SpdyStream proc,
-            LinkedList<SpdyFrame> queue) throws IOException {
+            LinkedList<SpdyFrame> queue) {
 
         oframe.endData = oframe.off;
         oframe.off = 0;
@@ -493,7 +492,6 @@ public abstract class SpdyConnection { /
             if (inFrame != null) {
                 inFrame.recyle();
                 if (nextFrame != null) {
-                    getSpdyContext().releaseFrame(inFrame);
                     inFrame = nextFrame;
                     nextFrame = null;
                 }
@@ -512,7 +510,7 @@ public abstract class SpdyConnection { /
         System.err.println(msg);
         inClosed = true;
 
-        List<Integer> ch = new ArrayList<Integer>(channels.keySet());
+        List<Integer> ch = new ArrayList<>(channels.keySet());
         for (Integer i: ch) {
             SpdyStream stream = channels.remove(i);
             if (stream != null) {
@@ -525,9 +523,9 @@ public abstract class SpdyConnection { /
         System.err.println(msg);
         inClosed = true;
 
-        List<Integer> ch = new ArrayList<Integer>(channels.keySet());
+        List<Integer> ch = new ArrayList<>(channels.keySet());
         for (Integer i: ch) {
-            if (i > last) {
+            if (i.intValue() > last) {
                 SpdyStream stream = channels.remove(i);
                 if (stream != null) {
                     stream.onReset();
@@ -548,9 +546,9 @@ public abstract class SpdyConnection { /
             case TYPE_SETTINGS: {
                 int cnt = inFrame.readInt();
                 for (int i = 0; i < cnt; i++) {
-                    int flag = inFrame.readByte();
-                    int id = inFrame.read24();
-                    int value = inFrame.readInt();
+                    inFrame.readByte();
+                    inFrame.read24();
+                    inFrame.readInt();
                 }
                 // TODO: save/interpret settings
                 break;
@@ -573,11 +571,12 @@ public abstract class SpdyConnection { /
                             + inFrame.streamId
                             + " "
                             + ((errCode < RST_ERRORS.length) ? RST_ERRORS[errCode]
-                                    : errCode));
+                                    : Integer.valueOf(errCode)));
                 }
                 SpdyStream sch;
                 synchronized(channels) {
-                        sch = channels.remove(inFrame.streamId);
+                        sch = channels.remove(
+                                Integer.valueOf(inFrame.streamId));
                 }
                 // if RST stream is for a closed channel - we can ignore.
                 if (sch != null) {
@@ -592,7 +591,7 @@ public abstract class SpdyConnection { /
                 SpdyStream ch = getSpdyContext().getStream(this);
 
                 synchronized (channels) {
-                    channels.put(inFrame.streamId, ch);
+                    channels.put(Integer.valueOf(inFrame.streamId), ch);
                 }
 
                 try {
@@ -609,7 +608,7 @@ public abstract class SpdyConnection { /
             case TYPE_SYN_REPLY: {
                 SpdyStream sch;
                 synchronized(channels) {
-                    sch = channels.get(inFrame.streamId);
+                    sch = channels.get(Integer.valueOf(inFrame.streamId));
                 }
                 if (sch == null) {
                     abort("Missing channel");
@@ -642,7 +641,7 @@ public abstract class SpdyConnection { /
             // Data frame
             SpdyStream sch;
             synchronized (channels) {
-                sch = channels.get(inFrame.streamId);
+                sch = channels.get(Integer.valueOf(inFrame.streamId));
             }
             if (sch == null) {
                 abort("Missing channel");
@@ -651,7 +650,7 @@ public abstract class SpdyConnection { /
             sch.onDataFrame(inFrame);
             synchronized (channels) {
                 if (sch.finRcvd && sch.finSent) {
-                    channels.remove(inFrame.streamId);
+                    channels.remove(Integer.valueOf(inFrame.streamId));
                 }
             }
             inFrame = null;
@@ -663,7 +662,7 @@ public abstract class SpdyConnection { /
         return spdyContext;
     }
 
-    public SpdyStream get(String host, String url) throws IOException {
+    public SpdyStream get(String host, String url) {
         SpdyStream sch = new SpdyStream(this);
         sch.getRequest().addHeader("host", host);
         sch.getRequest().addHeader("url", url);

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyContext.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyContext.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyContext.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyContext.java Wed Sep 12 18:51:20 2012
@@ -64,24 +64,17 @@ public final class SpdyContext {
             this.ctx = ctx;
         }
 
-        public abstract SpdyConnection getConnection(String host, int port) throws IOException;
+        public abstract SpdyConnection getConnection(String host, int port)
+                throws IOException;
 
-        public void onCreateEngine(Object engine) {
-        }
+        public abstract boolean isSpdy(Object socketW);
 
-        public boolean isSpdy(Object socketW) {
-            return false;
-        }
+        public abstract void onAccept(Object socket);
 
-        public void onAccept(Object socket) throws IOException {
-        }
-
-        public void listen(int port, String cert, String key)
-                throws IOException {
-        }
+        public abstract void listen(int port, String cert, String key)
+                throws IOException;
 
-        public void stop() throws IOException {
-        }
+        public abstract void stop() throws IOException;
     }
 
     public SpdyContext() {
@@ -99,9 +92,6 @@ public final class SpdyContext {
         return new SpdyFrame(defaultFrameSize);
     }
 
-    public void releaseFrame(SpdyFrame done) {
-    }
-
     /**
      * Set the max frame size.
      *
@@ -205,9 +195,6 @@ public final class SpdyContext {
         return netSupport.getConnection(host, port);
     }
 
-    public void releaseConnection(SpdyConnection con) {
-    }
-
     public final void listen(final int port, String cert, String key) throws IOException {
         netSupport.listen(port, cert, key);
     }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyStream.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyStream.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyStream.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/spdy/SpdyStream.java Wed Sep 12 18:51:20 2012
@@ -50,7 +50,7 @@ public class SpdyStream implements Runna
     /**
      * For blocking support.
      */
-    protected BlockingQueue<SpdyFrame> inData = new LinkedBlockingQueue<SpdyFrame>();
+    protected BlockingQueue<SpdyFrame> inData = new LinkedBlockingQueue<>();
 
     protected boolean finSent;
 
@@ -102,7 +102,7 @@ public class SpdyStream implements Runna
      * The base method is for client implementation - servers need to override
      * and process the frame as a request.
      */
-    public void onCtlFrame(SpdyFrame frame) throws IOException {
+    public void onCtlFrame(SpdyFrame frame) {
         // TODO: handle RST
         if (frame.type == SpdyConnection.TYPE_SYN_STREAM) {
             reqFrame = frame;
@@ -157,7 +157,7 @@ public class SpdyStream implements Runna
      *
      * First frame will be the control frame
      */
-    public SpdyFrame getFrame(long to) throws IOException {
+    public SpdyFrame getFrame(long to) {
         SpdyFrame in;
         try {
             synchronized (this) {
@@ -202,7 +202,7 @@ public class SpdyStream implements Runna
     }
 
     public synchronized void sendDataFrame(byte[] data, int start,
-            int length, boolean close) throws IOException {
+            int length, boolean close) {
 
         SpdyFrame oframe = spdy.getDataFrame();
 
@@ -222,24 +222,24 @@ public class SpdyStream implements Runna
         spdy.send(oframe, this);
     }
 
-    public void send() throws IOException {
+    public void send() {
         send("http", "GET");
     }
 
-    public void send(String host, String url, String scheme, String method) throws IOException {
+    public void send(String host, String url, String scheme, String method) {
         getRequest().addHeader("host", host);
         getRequest().addHeader("url", url);
 
         send(scheme, method);
     }
 
-    public void send(String scheme, String method) throws IOException {
+    public void send(String scheme, String method) {
         getRequest();
         if ("GET".equalsIgnoreCase(method)) {
             // TODO: add the others
             reqFrame.halfClose();
         }
-        getRequest().addHeader("scheme", "http"); // todo
+        getRequest().addHeader("scheme", scheme);
         getRequest().addHeader("method", method);
         getRequest().addHeader("version", "HTTP/1.1");
         if (reqFrame.isHalfClose()) {
@@ -268,11 +268,8 @@ public class SpdyStream implements Runna
         long to = 10000; // TODO
         int pos = 0;
 
-        private void fill() throws IOException {
+        private void fill() {
             if (current == null || current.off == current.endData) {
-                if (current != null) {
-                    spdy.spdyContext.releaseFrame(current);
-                }
                 current = getFrame(to);
             }
         }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/IntrospectionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/IntrospectionUtils.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/IntrospectionUtils.java Wed Sep 12 18:51:20 2012
@@ -296,8 +296,7 @@ public final class IntrospectionUtils {
         objectMethods.clear();
     }
 
-    static Hashtable<Class<?>,Method[]> objectMethods =
-        new Hashtable<Class<?>,Method[]>();
+    static Hashtable<Class<?>,Method[]> objectMethods = new Hashtable<>();
 
     public static Method[] findMethods(Class<?> c) {
         Method methods[] = objectMethods.get(c);

Propchange: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/
------------------------------------------------------------------------------
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1382517-1384080

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java Wed Sep 12 18:51:20 2012
@@ -32,7 +32,6 @@ import org.apache.tomcat.util.bcel.Const
 public class AnnotationDefault extends Attribute
 {
     private static final long serialVersionUID = 6715933396664171543L;
-    ElementValue default_value;
 
     /**
      * @param name_index
@@ -50,7 +49,8 @@ public class AnnotationDefault extends A
     {
         this(name_index, length, (ElementValue) null,
                 constant_pool);
-        default_value = ElementValue.readElementValue(file, constant_pool);
+        // Default value
+        ElementValue.readElementValue(file, constant_pool);
     }
 
     /**
@@ -67,16 +67,6 @@ public class AnnotationDefault extends A
             ElementValue defaultValue, ConstantPool constant_pool)
     {
         super(Constants.ATTR_ANNOTATION_DEFAULT, name_index, length, constant_pool);
-        setDefaultValue(defaultValue);
-    }
-
-    /**
-     * @param defaultValue
-     *            the default value of this methodinfo's annotation
-     */
-    public final void setDefaultValue(ElementValue defaultValue)
-    {
-        default_value = defaultValue;
     }
 
 

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java Wed Sep 12 18:51:20 2012
@@ -20,7 +20,6 @@ package org.apache.tomcat.util.bcel.clas
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -33,9 +32,7 @@ import org.apache.tomcat.util.bcel.Const
  * @author  <A HREF="mailto:dbrosius@mebigfatguy.com">D. Brosius</A>
  * @since 5.3
  */
-public class AnnotationEntry implements Constants, Serializable {
-
-    private static final long serialVersionUID = 1L;
+public class AnnotationEntry implements Constants {
 
     private final int type_index;
     private final ConstantPool constant_pool;

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Method.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Method.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Method.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Method.java Wed Sep 12 18:51:20 2012
@@ -20,7 +20,6 @@ package org.apache.tomcat.util.bcel.clas
 import java.io.DataInputStream;
 import java.io.IOException;
 
-import org.apache.tomcat.util.bcel.Constants;
 import org.apache.tomcat.util.bcel.util.BCELComparator;
 
 /**
@@ -113,43 +112,6 @@ public final class Method extends FieldO
 
 
     /**
-     * Return string representation close to declaration format,
-     * `public static void main(String[] args) throws IOException', e.g.
-     *
-     * @return String representation of the method.
-     */
-    @Override
-    public final String toString() {
-        ConstantUtf8 c;
-        String name, signature, access; // Short cuts to constant pool
-        StringBuilder buf;
-        access = Utility.accessToString(access_flags);
-        // Get name and signature from constant pool
-        c = (ConstantUtf8) constant_pool.getConstant(signature_index, Constants.CONSTANT_Utf8);
-        signature = c.getBytes();
-        c = (ConstantUtf8) constant_pool.getConstant(name_index, Constants.CONSTANT_Utf8);
-        name = c.getBytes();
-        signature = Utility.methodSignatureToString(signature, name, access, true,
-                getLocalVariableTable());
-        buf = new StringBuilder(signature);
-        for (int i = 0; i < attributes_count; i++) {
-            Attribute a = attributes[i];
-            if (!((a instanceof Code) || (a instanceof ExceptionTable))) {
-                buf.append(" [").append(a.toString()).append("]");
-            }
-        }
-        ExceptionTable e = getExceptionTable();
-        if (e != null) {
-            String str = e.toString();
-            if (!str.equals("")) {
-                buf.append("\n\t\tthrows ").append(str);
-            }
-        }
-        return buf.toString();
-    }
-
-
-    /**
      * Return value as defined by given BCELComparator strategy.
      * By default two method objects are said to be equal when
      * their names and signatures are equal.

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Utility.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/bcel/classfile/Utility.java Wed Sep 12 18:51:20 2012
@@ -458,80 +458,6 @@ public abstract class Utility {
         return compactClassName(str, "java.lang.", chopit);
     }
 
-    /**
-     * A returntype signature represents the return value from a method.
-     * It is a series of bytes in the following grammar:
-     *
-     * <return_signature> ::= <field_type> | V
-     *
-     * The character V indicates that the method returns no value. Otherwise, the
-     * signature indicates the type of the return value.
-     * An argument signature represents an argument passed to a method:
-     *
-     * <argument_signature> ::= <field_type>
-     *
-     * A method signature represents the arguments that the method expects, and
-     * the value that it returns.
-     * <method_signature> ::= (<arguments_signature>) <return_signature>
-     * <arguments_signature>::= <argument_signature>*
-     *
-     * This method converts such a string into a Java type declaration like
-     * `void main(String[])' and throws a `ClassFormatException' when the parsed
-     * type is invalid.
-     *
-     * @param  signature    Method signature
-     * @param  name         Method name
-     * @param  access       Method access rights
-     * @param chopit
-     * @param vars
-     * @return Java type declaration
-     * @throws  ClassFormatException
-     */
-    public static final String methodSignatureToString( String signature, String name,
-            String access, boolean chopit, LocalVariableTable vars ) throws ClassFormatException {
-        StringBuilder buf = new StringBuilder("(");
-        String type;
-        int index;
-        int var_index = (access.indexOf("static") >= 0) ? 0 : 1;
-        try { // Read all declarations between for `(' and `)'
-            if (signature.charAt(0) != '(') {
-                throw new ClassFormatException("Invalid method signature: " + signature);
-            }
-            index = 1; // current string position
-            while (signature.charAt(index) != ')') {
-                String param_type = signatureToString(signature.substring(index), chopit);
-                buf.append(param_type);
-                if (vars != null) {
-                    LocalVariable l = vars.getLocalVariable(var_index);
-                    if (l != null) {
-                        buf.append(" ").append(l.getName());
-                    }
-                } else {
-                    buf.append(" arg").append(var_index);
-                }
-                if ("double".equals(param_type) || "long".equals(param_type)) {
-                    var_index += 2;
-                } else {
-                    var_index++;
-                }
-                buf.append(", ");
-                //corrected concurrent private static field acess
-                index += unwrap(consumed_chars); // update position
-            }
-            index++; // update position
-            // Read return type after `)'
-            type = signatureToString(signature.substring(index), chopit);
-        } catch (StringIndexOutOfBoundsException e) { // Should never occur
-            throw new ClassFormatException("Invalid method signature: " + signature, e);
-        }
-        if (buf.length() > 1) {
-            buf.setLength(buf.length() - 2);
-        }
-        buf.append(")");
-        return access + ((access.length() > 0) ? " " : "") + // May be an empty string
-                type + " " + name + buf.toString();
-    }
-
 
     // Guess what this does
     private static final int pow2( int n ) {

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java Wed Sep 12 18:51:20 2012
@@ -48,7 +48,7 @@ public class B2CConverter {
         StringManager.getManager(Constants.Package);
 
     private static final Map<String, Charset> encodingToCharsetCache =
-        new HashMap<String, Charset>();
+            new HashMap<>();
 
     public static final Charset ISO_8859_1;
     public static final Charset UTF_8;

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/StringCache.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/StringCache.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/StringCache.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/StringCache.java Wed Sep 12 18:51:20 2012
@@ -65,7 +65,7 @@ public class StringCache {
      * Statistics hash map for byte chunk.
      */
     protected static final HashMap<ByteEntry,int[]> bcStats =
-        new HashMap<ByteEntry,int[]>(cacheSize);
+            new HashMap<>(cacheSize);
 
 
     /**
@@ -84,7 +84,7 @@ public class StringCache {
      * Statistics hash map for char chunk.
      */
     protected static final HashMap<CharEntry,int[]> ccStats =
-        new HashMap<CharEntry,int[]>(cacheSize);
+            new HashMap<>(cacheSize);
 
 
     /**
@@ -233,7 +233,7 @@ public class StringCache {
                         long t1 = System.currentTimeMillis();
                         // Sort the entries according to occurrence
                         TreeMap<Integer,ArrayList<ByteEntry>> tempMap =
-                            new TreeMap<Integer,ArrayList<ByteEntry>>();
+                                new TreeMap<>();
                         for (Entry<ByteEntry,int[]> item : bcStats.entrySet()) {
                             ByteEntry entry = item.getKey();
                             int[] countA = item.getValue();
@@ -242,7 +242,7 @@ public class StringCache {
                             ArrayList<ByteEntry> list = tempMap.get(count);
                             if (list == null) {
                                 // Create list
-                                list = new ArrayList<ByteEntry>();
+                                list = new ArrayList<>();
                                 tempMap.put(count, list);
                             }
                             list.add(entry);
@@ -350,7 +350,7 @@ public class StringCache {
                         long t1 = System.currentTimeMillis();
                         // Sort the entries according to occurrence
                         TreeMap<Integer,ArrayList<CharEntry>> tempMap =
-                            new TreeMap<Integer,ArrayList<CharEntry>>();
+                                new TreeMap<>();
                         for (Entry<CharEntry,int[]> item : ccStats.entrySet()) {
                             CharEntry entry = item.getKey();
                             int[] countA = item.getValue();
@@ -359,7 +359,7 @@ public class StringCache {
                             ArrayList<CharEntry> list = tempMap.get(count);
                             if (list == null) {
                                 // Create list
-                                list = new ArrayList<CharEntry>();
+                                list = new ArrayList<>();
                                 tempMap.put(count, list);
                             }
                             list.add(entry);

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/ManagedConcurrentWeakHashMap.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/ManagedConcurrentWeakHashMap.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/ManagedConcurrentWeakHashMap.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/collections/ManagedConcurrentWeakHashMap.java Wed Sep 12 18:51:20 2012
@@ -37,8 +37,8 @@ import java.util.concurrent.ConcurrentMa
 public class ManagedConcurrentWeakHashMap<K, V> extends AbstractMap<K, V> implements
         ConcurrentMap<K, V> {
 
-    private final ConcurrentMap<Key, V> map = new ConcurrentHashMap<Key, V>();
-    private final ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+    private final ConcurrentMap<Key, V> map = new ConcurrentHashMap<>();
+    private final ReferenceQueue<Object> queue = new ReferenceQueue<>();
 
     /**
      * Method, that has to be invoked periodically to clean dead keys from the
@@ -243,9 +243,6 @@ public class ManagedConcurrentWeakHashMa
                         return new Map.Entry<K, V>() {
                             private final Map.Entry<Key, V> en = it.next();
 
-                            // Warning suppressed, because Key stored in the map
-                            // always wraps a K
-                            @SuppressWarnings("unchecked")
                             @Override
                             public K getKey() {
                                 return (K) en.getKey().get();

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/CallParamRule.java Wed Sep 12 18:51:20 2012
@@ -201,7 +201,7 @@ public class CallParamRule extends Rule 
             // so that we can make sure that the right set of parameters
             // is at the top of the stack
             if (bodyTextStack == null) {
-                bodyTextStack = new ArrayStack<String>();
+                bodyTextStack = new ArrayStack<>();
             }
             bodyTextStack.push(bodyText.trim());
         }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/Digester.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/Digester.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/Digester.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/Digester.java Wed Sep 12 18:51:20 2012
@@ -168,8 +168,7 @@ public class Digester extends DefaultHan
     /**
      * The stack of body text string buffers for surrounding elements.
      */
-    protected ArrayStack<StringBuilder> bodyTexts =
-        new ArrayStack<StringBuilder>();
+    protected ArrayStack<StringBuilder> bodyTexts = new ArrayStack<>();
 
 
     /**
@@ -182,7 +181,7 @@ public class Digester extends DefaultHan
      *
      * @since 1.6
      */
-    protected ArrayStack<List<Rule>> matches = new ArrayStack<List<Rule>>(10);
+    protected ArrayStack<List<Rule>> matches = new ArrayStack<>(10);
 
     /**
      * The class loader to use for instantiating application objects.
@@ -208,8 +207,7 @@ public class Digester extends DefaultHan
      * The URLs of entityValidator that have been registered, keyed by the public
      * identifier that corresponds.
      */
-    protected HashMap<String,String> entityValidator =
-        new HashMap<String,String>();
+    protected HashMap<String,String> entityValidator = new HashMap<>();
 
 
     /**
@@ -250,16 +248,14 @@ public class Digester extends DefaultHan
      * is required because documents can declare nested uses of the same
      * prefix for different Namespace URIs).
      */
-    protected HashMap<String,ArrayStack<String>> namespaces =
-        new HashMap<String,ArrayStack<String>>();
+    protected HashMap<String,ArrayStack<String>> namespaces = new HashMap<>();
 
 
     /**
      * The parameters stack being utilized by CallMethodRule and
      * CallParamRule rules.
      */
-    protected ArrayStack<Object> params = new ArrayStack<Object>();
-
+    protected ArrayStack<Object> params = new ArrayStack<>();
 
     /**
      * The SAXParser we will use to parse the input stream.
@@ -298,7 +294,7 @@ public class Digester extends DefaultHan
     /**
      * The object stack being constructed.
      */
-    protected ArrayStack<Object> stack = new ArrayStack<Object>();
+    protected ArrayStack<Object> stack = new ArrayStack<>();
 
 
     /**
@@ -340,9 +336,9 @@ public class Digester extends DefaultHan
         LogFactory.getLog("org.apache.tomcat.util.digester.Digester.sax");
 
 
-    /** Stacks used for interrule communication, indexed by name String */
+    /** Stacks used for inter-rule communication, indexed by name String */
     private HashMap<String,ArrayStack<Object>> stacksByName =
-        new HashMap<String,ArrayStack<Object>>();
+            new HashMap<>();
 
     // ------------------------------------------------------------- Properties
 
@@ -1310,7 +1306,7 @@ public class Digester extends DefaultHan
         // Register this prefix mapping
         ArrayStack<String> stack = namespaces.get(prefix);
         if (stack == null) {
-            stack = new ArrayStack<String>();
+            stack = new ArrayStack<>();
             namespaces.put(prefix, stack);
         }
         stack.push(namespaceURI);
@@ -2406,7 +2402,7 @@ public class Digester extends DefaultHan
     public void push(String stackName, Object value) {
         ArrayStack<Object> namedStack = stacksByName.get(stackName);
         if (namedStack == null) {
-            namedStack = new ArrayStack<Object>();
+            namedStack = new ArrayStack<>();
             stacksByName.put(stackName, namedStack);
         }
         namedStack.push(value);

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/FactoryCreateRule.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/FactoryCreateRule.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/FactoryCreateRule.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/FactoryCreateRule.java Wed Sep 12 18:51:20 2012
@@ -262,7 +262,7 @@ public class FactoryCreateRule extends R
         if (ignoreCreateExceptions) {
 
             if (exceptionIgnoredStack == null) {
-                exceptionIgnoredStack = new ArrayStack<Boolean>();
+                exceptionIgnoredStack = new ArrayStack<>();
             }
 
             try {

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/RulesBase.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/RulesBase.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/RulesBase.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/RulesBase.java Wed Sep 12 18:51:20 2012
@@ -53,8 +53,7 @@ public class RulesBase implements Rules 
      * Each value is a List containing the Rules for that pattern, in the
      * order that they were originally registered.
      */
-    protected HashMap<String,List<Rule>> cache =
-        new HashMap<String,List<Rule>>();
+    protected HashMap<String,List<Rule>> cache = new HashMap<>();
 
 
     /**
@@ -75,7 +74,7 @@ public class RulesBase implements Rules 
      * The set of registered Rule instances, in the order that they were
      * originally registered.
      */
-    protected ArrayList<Rule> rules = new ArrayList<Rule>();
+    protected ArrayList<Rule> rules = new ArrayList<>();
 
 
     // ------------------------------------------------------------- Properties
@@ -159,7 +158,7 @@ public class RulesBase implements Rules 
 
         List<Rule> list = cache.get(pattern);
         if (list == null) {
-            list = new ArrayList<Rule>();
+            list = new ArrayList<>();
             cache.put(pattern, list);
         }
         list.add(rule);
@@ -221,7 +220,7 @@ public class RulesBase implements Rules 
             }
         }
         if (rulesList == null) {
-            rulesList = new ArrayList<Rule>();
+            rulesList = new ArrayList<>();
         }
         return (rulesList);
 
@@ -267,7 +266,7 @@ public class RulesBase implements Rules 
         }
 
         // Select only Rules that match on the specified namespace URI
-        ArrayList<Rule> results = new ArrayList<Rule>();
+        ArrayList<Rule> results = new ArrayList<>();
         Iterator<Rule> items = list.iterator();
         while (items.hasNext()) {
             Rule item = items.next();

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/WithDefaultsRulesWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/WithDefaultsRulesWrapper.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/WithDefaultsRulesWrapper.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/WithDefaultsRulesWrapper.java Wed Sep 12 18:51:20 2012
@@ -53,9 +53,9 @@ public class WithDefaultsRulesWrapper im
     /** The Rules implementation that this class wraps. */
     private Rules wrappedRules;
     /** Rules to be fired when the wrapped implementations returns none. */
-    private List<Rule> defaultRules = new ArrayList<Rule>();
+    private List<Rule> defaultRules = new ArrayList<>();
     /** All rules (preserves order in which they were originally added) */
-    private List<Rule> allRules = new ArrayList<Rule>();
+    private List<Rule> allRules = new ArrayList<>();
 
     // --------------------------------------------------------- Constructor
 
@@ -120,7 +120,7 @@ public class WithDefaultsRulesWrapper im
         List<Rule> matches = wrappedRules.match(namespaceURI, pattern);
         if (matches ==  null || matches.isEmpty()) {
             // a little bit of defensive programming
-            return new ArrayList<Rule>(defaultRules);
+            return new ArrayList<>(defaultRules);
         }
         // otherwise
         return matches;

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/XercesParser.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/XercesParser.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/XercesParser.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/digester/XercesParser.java Wed Sep 12 18:51:20 2012
@@ -153,8 +153,7 @@ public class XercesParser{
      */
     private static void configureOldXerces(SAXParser parser,
                                            Properties properties)
-            throws ParserConfigurationException,
-                   SAXNotSupportedException {
+            throws SAXNotSupportedException {
 
         String schemaLocation = (String)properties.get("schemaLocation");
         String schemaLanguage = (String)properties.get("schemaLanguage");

Modified: tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/FastHttpDateFormat.java?rev=1384085&r1=1384084&r2=1384085&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/FastHttpDateFormat.java (original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/http/FastHttpDateFormat.java Wed Sep 12 18:51:20 2012
@@ -92,14 +92,14 @@ public final class FastHttpDateFormat {
      * Formatter cache.
      */
     private static final ConcurrentHashMap<Long, String> formatCache =
-        new ConcurrentHashMap<Long, String>(CACHE_SIZE);
+            new ConcurrentHashMap<>(CACHE_SIZE);
 
 
     /**
      * Parser cache.
      */
     private static final ConcurrentHashMap<String, Long> parseCache =
-        new ConcurrentHashMap<String, Long>(CACHE_SIZE);
+            new ConcurrentHashMap<>(CACHE_SIZE);
 
 
     // --------------------------------------------------------- Public Methods



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


Mime
View raw message