tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1360894 - /tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
Date Thu, 12 Jul 2012 19:58:38 GMT
Author: markt
Date: Thu Jul 12 19:58:38 2012
New Revision: 1360894

URL: http://svn.apache.org/viewvc?rev=1360894&view=rev
Log:
Fix Java 7 warnings

Modified:
    tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1360894&r1=1360893&r2=1360894&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Thu Jul 12 19:58:38 2012
@@ -64,7 +64,7 @@ public class AsyncContextImpl implements
 
     private ServletRequest servletRequest = null;
     private ServletResponse servletResponse = null;
-    private final List<AsyncListenerWrapper> listeners = new ArrayList<AsyncListenerWrapper>();
+    private final List<AsyncListenerWrapper> listeners = new ArrayList<>();
     private boolean hasOriginalRequestAndResponse = true;
     private volatile Runnable dispatch = null;
     private Context context = null;
@@ -92,8 +92,7 @@ public class AsyncContextImpl implements
 
     @Override
     public void fireOnComplete() {
-        List<AsyncListenerWrapper> listenersCopy =
-            new ArrayList<AsyncListenerWrapper>();
+        List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
         listenersCopy.addAll(listeners);
         for (AsyncListenerWrapper listener : listenersCopy) {
             try {
@@ -172,8 +171,7 @@ public class AsyncContextImpl implements
             try {
                 Thread.currentThread().setContextClassLoader(newCL);
                 boolean listenerInvoked = false;
-                List<AsyncListenerWrapper> listenersCopy =
-                    new ArrayList<AsyncListenerWrapper>();
+                List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
                 listenersCopy.addAll(listeners);
                 for (AsyncListenerWrapper listener : listenersCopy) {
                     listener.fireOnTimeout(event);
@@ -289,7 +287,6 @@ public class AsyncContextImpl implements
         listeners.add(wrapper);
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public <T extends AsyncListener> T createListener(Class<T> clazz)
             throws ServletException {
@@ -353,8 +350,7 @@ public class AsyncContextImpl implements
         this.hasOriginalRequestAndResponse = originalRequestResponse;
         this.event = new AsyncEvent(this, request, response);
 
-        List<AsyncListenerWrapper> listenersCopy =
-            new ArrayList<AsyncListenerWrapper>();
+        List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
         listenersCopy.addAll(listeners);
         for (AsyncListenerWrapper listener : listenersCopy) {
             try {
@@ -416,8 +412,7 @@ public class AsyncContextImpl implements
         request.getCoyoteRequest().action(ActionCode.ASYNC_ERROR, null);
         AsyncEvent errorEvent = new AsyncEvent(event.getAsyncContext(),
                 event.getSuppliedRequest(), event.getSuppliedResponse(), t);
-        List<AsyncListenerWrapper> listenersCopy =
-            new ArrayList<AsyncListenerWrapper>();
+        List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
         listenersCopy.addAll(listeners);
         for (AsyncListenerWrapper listener : listenersCopy) {
             try {



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


Mime
View raw message