You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/08/08 20:38:34 UTC

svn commit: r1511932 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/filters/ java/org/apache/catalina/ha/context/ java/org/apache/catalina/ha/session/ java/org/apache/catalina/realm/ java/org/apache/catalina/trib...

Author: markt
Date: Thu Aug  8 18:38:34 2013
New Revision: 1511932

URL: http://svn.apache.org/r1511932
Log:
Switch from ignoring unavoidable generics warnings in Eclipse to explicitly using @SuppressWarnings
Fix a few other warnings (e.g. auto-boxing) also spotted

Modified:
    tomcat/tc7.0.x/trunk/build.xml
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/SessionIDMessage.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JAASRealm.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
    tomcat/tc7.0.x/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
    tomcat/tc7.0.x/trunk/test/javax/el/TestResourceBundleELResolver.java
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter.java

Modified: tomcat/tc7.0.x/trunk/build.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/build.xml?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/build.xml (original)
+++ tomcat/tc7.0.x/trunk/build.xml Thu Aug  8 18:38:34 2013
@@ -510,9 +510,7 @@
            excludes="**/.svn/**"
            encoding="ISO-8859-1"
            includeAntRuntime="true" >
-      <!-- Uncomment this to show unchecked warnings:
       <compilerarg value="-Xlint:unchecked"/>
-      -->
       <include name="org/apache/tomcat/buildutil/CheckEol*" />
     </javac>
 
@@ -564,9 +562,7 @@
            excludes="**/.svn/**"
            encoding="ISO-8859-1"
            includeAntRuntime="true" >
-      <!-- Uncomment this to show unchecked warnings:
       <compilerarg value="-Xlint:unchecked"/>
-      -->
       <classpath refid="compile.classpath" />
       <exclude name="org/apache/naming/factory/webservices/**" />
     </javac>

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationContext.java Thu Aug  8 18:38:34 2013
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -97,7 +97,7 @@ public class ApplicationContext
 
     static {
         STRICT_SERVLET_COMPLIANCE = Globals.STRICT_SERVLET_COMPLIANCE;
-        
+
         String requireSlash = System.getProperty(
                 "org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH");
         if (requireSlash == null) {
@@ -302,7 +302,7 @@ public class ApplicationContext
         }
     }
 
-    
+
     /**
      * Return the main path associated with this context.
      */
@@ -310,7 +310,7 @@ public class ApplicationContext
     public String getContextPath() {
         return context.getPath();
     }
-    
+
 
     /**
      * Return the value of the specified initialization parameter, or
@@ -395,7 +395,7 @@ public class ApplicationContext
         Wrapper wrapper = (Wrapper) context.findChild(name);
         if (wrapper == null)
             return (null);
-        
+
         return new ApplicationDispatcher(wrapper, null, null, null, null, name);
 
     }
@@ -444,7 +444,7 @@ public class ApplicationContext
         if (normalizedPath == null)
             return (null);
 
-        pos = normalizedPath.length(); 
+        pos = normalizedPath.length();
 
         // Use the thread local URI and mapping data
         DispatchData dd = dispatchData.get();
@@ -495,10 +495,10 @@ public class ApplicationContext
         String pathInfo = mappingData.pathInfo.toString();
 
         mappingData.recycle();
-        
+
         // Construct a RequestDispatcher to process this request
         return new ApplicationDispatcher
-            (wrapper, uriCC.toString(), wrapperPath, pathInfo, 
+            (wrapper, uriCC.toString(), wrapperPath, pathInfo,
              queryString, null);
 
     }
@@ -523,7 +523,7 @@ public class ApplicationContext
                 !path.startsWith("/") && GET_RESOURCE_REQUIRE_SLASH)
             throw new MalformedURLException(sm.getString(
                     "applicationContext.requestDispatcher.iae", path));
-        
+
         String normPath = RequestUtil.normalize(path);
         if (normPath == null)
             return (null);
@@ -724,7 +724,7 @@ public class ApplicationContext
     @Override
     @Deprecated
     public void log(Exception exception, String message) {
-        
+
         context.getLogger().error(message, exception);
 
     }
@@ -738,7 +738,7 @@ public class ApplicationContext
      */
     @Override
     public void log(String message, Throwable throwable) {
-        
+
         context.getLogger().error(message, throwable);
 
     }
@@ -893,11 +893,11 @@ public class ApplicationContext
     @Override
     public FilterRegistration.Dynamic addFilter(String filterName,
             String filterClass) throws IllegalStateException {
-        
+
         return addFilter(filterName, filterClass, null);
     }
 
-    
+
     /**
      * Add filter to context.
      * @param   filterName  Name of filter to add
@@ -915,11 +915,11 @@ public class ApplicationContext
     @Override
     public FilterRegistration.Dynamic addFilter(String filterName,
             Filter filter) throws IllegalStateException {
-        
+
         return addFilter(filterName, null, filter);
     }
 
-    
+
     /**
      * Add filter to context.
      * @param   filterName  Name of filter to add
@@ -937,13 +937,13 @@ public class ApplicationContext
     @Override
     public FilterRegistration.Dynamic addFilter(String filterName,
             Class<? extends Filter> filterClass) throws IllegalStateException {
-        
+
         return addFilter(filterName, filterClass.getName(), null);
     }
 
     private FilterRegistration.Dynamic addFilter(String filterName,
             String filterClass, Filter filter) throws IllegalStateException {
-        
+
         if (filterName == null || filterName.equals("")) {
             throw new IllegalArgumentException(sm.getString(
                     "applicationContext.invalidFilterName", filterName));
@@ -957,7 +957,7 @@ public class ApplicationContext
         }
 
         FilterDef filterDef = context.findFilterDef(filterName);
-        
+
         // Assume a 'complete' FilterRegistration is one that has a class and
         // a name
         if (filterDef == null) {
@@ -977,14 +977,15 @@ public class ApplicationContext
             filterDef.setFilterClass(filter.getClass().getName());
             filterDef.setFilter(filter);
         }
-        
+
         return new ApplicationFilterRegistration(filterDef, context);
-    } 
-    
+    }
+
     @Override
     public <T extends Filter> T createFilter(Class<T> c)
     throws ServletException {
         try {
+            @SuppressWarnings("unchecked")
             T filter = (T) context.getInstanceManager().newInstance(c.getName());
             return filter;
         } catch (IllegalAccessException e) {
@@ -1011,7 +1012,7 @@ public class ApplicationContext
         return new ApplicationFilterRegistration(filterDef, context);
     }
 
-    
+
     /**
      * Add servlet to context.
      * @param   servletName  Name of servlet to add
@@ -1029,7 +1030,7 @@ public class ApplicationContext
     @Override
     public ServletRegistration.Dynamic addServlet(String servletName,
             String servletClass) throws IllegalStateException {
-        
+
         return addServlet(servletName, servletClass, null);
     }
 
@@ -1055,7 +1056,7 @@ public class ApplicationContext
         return addServlet(servletName, null, servlet);
     }
 
-    
+
     /**
      * Add servlet to context.
      * @param   servletName  Name of servlet to add
@@ -1080,7 +1081,7 @@ public class ApplicationContext
 
     private ServletRegistration.Dynamic addServlet(String servletName,
             String servletClass, Servlet servlet) throws IllegalStateException {
-        
+
         if (servletName == null || servletName.equals("")) {
             throw new IllegalArgumentException(sm.getString(
                     "applicationContext.invalidServletName", servletName));
@@ -1092,9 +1093,9 @@ public class ApplicationContext
                     sm.getString("applicationContext.addServlet.ise",
                             getContextPath()));
         }
-        
+
         Wrapper wrapper = (Wrapper) context.findChild(servletName);
-        
+
         // Assume a 'complete' ServletRegistration is one that has a class and
         // a name
         if (wrapper == null) {
@@ -1127,6 +1128,7 @@ public class ApplicationContext
     public <T extends Servlet> T createServlet(Class<T> c)
     throws ServletException {
         try {
+            @SuppressWarnings("unchecked")
             T servlet = (T) context.getInstanceManager().newInstance(c.getName());
             context.dynamicServletCreated(servlet);
             return servlet;
@@ -1151,10 +1153,10 @@ public class ApplicationContext
         if (wrapper == null) {
             return null;
         }
-        
+
         return new ApplicationServletRegistration(wrapper, context);
     }
-    
+
 
     /**
      * By default {@link SessionTrackingMode#URL} is always supported, {@link
@@ -1171,15 +1173,15 @@ public class ApplicationContext
 
     private void populateSessionTrackingModes() {
         // URL re-writing is always enabled by default
-        defaultSessionTrackingModes = EnumSet.of(SessionTrackingMode.URL); 
+        defaultSessionTrackingModes = EnumSet.of(SessionTrackingMode.URL);
         supportedSessionTrackingModes = EnumSet.of(SessionTrackingMode.URL);
-        
+
         if (context.getCookies()) {
             defaultSessionTrackingModes.add(SessionTrackingMode.COOKIE);
             supportedSessionTrackingModes.add(SessionTrackingMode.COOKIE);
         }
 
-        // SSL not enabled by default as it can only used on its own 
+        // SSL not enabled by default as it can only used on its own
         // Context > Host > Engine > Service
         Service s = ((Engine) context.getParent().getParent()).getService();
         Connector[] connectors = s.findConnectors();
@@ -1189,7 +1191,7 @@ public class ApplicationContext
                 supportedSessionTrackingModes.add(SessionTrackingMode.SSL);
                 break;
             }
-        } 
+        }
     }
 
     /**
@@ -1226,7 +1228,7 @@ public class ApplicationContext
                     sm.getString("applicationContext.setSessionTracking.ise",
                             getContextPath()));
         }
-        
+
         // Check that only supported tracking modes have been requested
         for (SessionTrackingMode sessionTrackingMode : sessionTrackingModes) {
             if (!supportedSessionTrackingModes.contains(sessionTrackingMode)) {
@@ -1244,7 +1246,7 @@ public class ApplicationContext
                         getContextPath()));
             }
         }
-        
+
         this.sessionTrackingModes = sessionTrackingModes;
     }
 
@@ -1253,8 +1255,8 @@ public class ApplicationContext
     public boolean setInitParameter(String name, String value) {
         return parameters.putIfAbsent(name, value) == null;
     }
-    
-    
+
+
     @Override
     public void addListener(Class<? extends EventListener> listenerClass) {
         EventListener listener;
@@ -1271,7 +1273,7 @@ public class ApplicationContext
 
     @Override
     public void addListener(String className) {
-        
+
         try {
             Object obj = context.getInstanceManager().newInstance(className);
 
@@ -1305,7 +1307,7 @@ public class ApplicationContext
                     "applicationContext.addListener.iae.cnfe", className),
                     e);
         }
-        
+
     }
 
 
@@ -1325,7 +1327,7 @@ public class ApplicationContext
             context.addApplicationEventListener(t);
             match = true;
         }
-        
+
         if (t instanceof HttpSessionListener
                 || (t instanceof ServletContextListener &&
                         newServletContextListenerAllowed)) {
@@ -1334,9 +1336,9 @@ public class ApplicationContext
             context.addApplicationLifecycleListener(t);
             match = true;
         }
-        
+
         if (match) return;
-        
+
         if (t instanceof ServletContextListener) {
             throw new IllegalArgumentException(sm.getString(
                     "applicationContext.addListener.iae.sclNotAllowed",
@@ -1353,6 +1355,7 @@ public class ApplicationContext
     public <T extends EventListener> T createListener(Class<T> c)
             throws ServletException {
         try {
+            @SuppressWarnings("unchecked")
             T listener =
                 (T) context.getInstanceManager().newInstance(c.getName());
             if (listener instanceof ServletContextListener ||
@@ -1382,20 +1385,20 @@ public class ApplicationContext
 
     @Override
     public void declareRoles(String... roleNames) {
-        
+
         if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
             //TODO Spec breaking enhancement to ignore this restriction
             throw new IllegalStateException(
                     sm.getString("applicationContext.addRole.ise",
                             getContextPath()));
         }
-        
+
         if (roleNames == null) {
             throw new IllegalArgumentException(
                     sm.getString("applicationContext.roles.iae",
                             getContextPath()));
         }
-        
+
         for (String role : roleNames) {
             if (role == null || "".equals(role)) {
                 throw new IllegalArgumentException(
@@ -1424,7 +1427,7 @@ public class ApplicationContext
                         new RuntimePermission("getClassLoader"));
             }
         }
-        
+
         return result;
     }
 
@@ -1445,7 +1448,7 @@ public class ApplicationContext
     public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
         Map<String, ApplicationFilterRegistration> result =
             new HashMap<String, ApplicationFilterRegistration>();
-        
+
         FilterDef[] filterDefs = context.findFilterDefs();
         for (FilterDef filterDef : filterDefs) {
             result.put(filterDef.getFilterName(),
@@ -1473,7 +1476,7 @@ public class ApplicationContext
     public Map<String, ? extends ServletRegistration> getServletRegistrations() {
         Map<String, ApplicationServletRegistration> result =
             new HashMap<String, ApplicationServletRegistration>();
-        
+
         Container[] wrappers = context.findChildren();
         for (Container wrapper : wrappers) {
             result.put(((Wrapper) wrapper).getName(),
@@ -1484,12 +1487,12 @@ public class ApplicationContext
         return result;
     }
 
-    
+
     // -------------------------------------------------------- Package Methods
     protected StandardContext getContext() {
         return this.context;
     }
-    
+
     @Deprecated
     protected Map<String,String> getReadonlyAttributes() {
         return this.readOnlyAttributes;
@@ -1513,10 +1516,10 @@ public class ApplicationContext
             String key = keys.next();
             removeAttribute(key);
         }
-        
+
     }
-    
-    
+
+
     /**
      * Return the facade associated with this ApplicationContext.
      */
@@ -1541,7 +1544,7 @@ public class ApplicationContext
     protected void setNewServletContextListenerAllowed(boolean allowed) {
         this.newServletContextListenerAllowed = allowed;
     }
-    
+
     /**
      * List resource paths (recursively), and store all of them in the given
      * Set.
@@ -1572,13 +1575,13 @@ public class ApplicationContext
      */
     private static String getJNDIUri(String hostName, String path) {
         String result;
-        
+
         if (path.startsWith("/")) {
             result = "/" + hostName + path;
         } else {
             result = "/" + hostName + "/" + path;
         }
-        
+
         return result;
     }
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Thu Aug  8 18:38:34 2013
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,14 +53,14 @@ import org.apache.tomcat.InstanceManager
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 /**
- * 
+ *
  * @author fhanik
  *
  */
 public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
-    
+
     private static final Log log = LogFactory.getLog(AsyncContextImpl.class);
-    
+
     protected static final StringManager sm =
         StringManager.getManager(Constants.Package);
 
@@ -74,7 +74,7 @@ public class AsyncContextImpl implements
     private AsyncEvent event = null;
     private Request request;
     private volatile InstanceManager instanceManager;
-    
+
     public AsyncContextImpl(Request request) {
         if (log.isDebugEnabled()) {
             logDebug("Constructor");
@@ -132,11 +132,11 @@ public class AsyncContextImpl implements
             }
         }
     }
-    
+
     public boolean timeout() {
         AtomicBoolean result = new AtomicBoolean();
         request.getCoyoteRequest().action(ActionCode.ASYNC_TIMEOUT, result);
-        
+
         if (result.get()) {
 
             ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
@@ -229,7 +229,7 @@ public class AsyncContextImpl implements
                 }
             }
         };
-        
+
         this.dispatch = run;
         this.request.getCoyoteRequest().action(ActionCode.ASYNC_DISPATCH, null);
     }
@@ -255,7 +255,7 @@ public class AsyncContextImpl implements
         Runnable wrapper = new RunnableWrapper(run, context);
         this.request.getCoyoteRequest().action(ActionCode.ASYNC_RUN, wrapper);
     }
-    
+
     @Override
     public void addListener(AsyncListener listener) {
         check();
@@ -273,6 +273,7 @@ public class AsyncContextImpl implements
         listeners.add(wrapper);
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public <T extends AsyncListener> T createListener(Class<T> clazz)
             throws ServletException {
@@ -300,7 +301,7 @@ public class AsyncContextImpl implements
         }
         return listener;
     }
-    
+
     public void recycle() {
         if (log.isDebugEnabled()) {
             logDebug("recycle    ");
@@ -326,7 +327,7 @@ public class AsyncContextImpl implements
 
     public void setStarted(Context context, ServletRequest request,
             ServletResponse response, boolean originalRequestResponse) {
-        
+
         this.request.getCoyoteRequest().action(
                 ActionCode.ASYNC_START, this);
 
@@ -335,7 +336,7 @@ public class AsyncContextImpl implements
         this.servletResponse = response;
         this.hasOriginalRequestAndResponse = originalRequestResponse;
         this.event = new AsyncEvent(this, request, response);
-        
+
         List<AsyncListenerWrapper> listenersCopy =
             new ArrayList<AsyncListenerWrapper>();
         listenersCopy.addAll(listeners);
@@ -380,7 +381,7 @@ public class AsyncContextImpl implements
         }
     }
 
-    
+
     @Override
     public long getTimeout() {
         check();
@@ -446,7 +447,7 @@ public class AsyncContextImpl implements
         }
     }
 
-    
+
     private void logDebug(String method) {
         String rHashCode;
         String crHashCode;
@@ -508,7 +509,7 @@ public class AsyncContextImpl implements
                 instanceManager = new DefaultInstanceManager(null,
                         new HashMap<String, Map<String, String>>(),
                         context,
-                        getClass().getClassLoader()); 
+                        getClass().getClassLoader());
             }
         }
         return instanceManager;
@@ -524,12 +525,12 @@ public class AsyncContextImpl implements
     private static class DebugException extends Exception {
         private static final long serialVersionUID = 1L;
     }
-    
+
     private static class RunnableWrapper implements Runnable {
 
         private Runnable wrapped = null;
         private Context context = null;
-        
+
         public RunnableWrapper(Runnable wrapped, Context ctxt) {
             this.wrapped = wrapped;
             this.context = ctxt;
@@ -544,7 +545,7 @@ public class AsyncContextImpl implements
             } else {
                 oldCL = Thread.currentThread().getContextClassLoader();
             }
-            
+
             try {
                 if (Globals.IS_SECURITY_ENABLED) {
                     PrivilegedAction<Void> pa = new PrivilegedSetTccl(
@@ -564,7 +565,7 @@ public class AsyncContextImpl implements
                 }
             }
         }
-        
+
     }
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/filters/CsrfPreventionFilter.java Thu Aug  8 18:38:34 2013
@@ -176,6 +176,7 @@ public class CsrfPreventionFilter extend
 
             HttpSession session = req.getSession(false);
 
+            @SuppressWarnings("unchecked")
             LruCache<String> nonceCache = (session == null) ? null
                     : (LruCache<String>) session.getAttribute(
                             Constants.CSRF_NONCE_SESSION_ATTR_NAME);

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java Thu Aug  8 18:38:34 2013
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public class ReplicatedContext extends S
     private int mapSendOptions = Channel.SEND_OPTIONS_DEFAULT;
     private static final Log log = LogFactory.getLog( ReplicatedContext.class );
     protected static long DEFAULT_REPL_TIMEOUT = 15000;//15 seconds
-    
+
     /**
      * Start this component and implement the requirements
      * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
@@ -53,6 +53,7 @@ public class ReplicatedContext extends S
      * @exception LifecycleException if this component detects a fatal error
      *  that prevents this component from being used
      */
+    @SuppressWarnings("unchecked")
     @Override
     protected synchronized void startInternal() throws LifecycleException {
 
@@ -72,7 +73,7 @@ public class ReplicatedContext extends S
             throw new LifecycleException("Failed to start ReplicatedContext",x);
         }
     }
-    
+
     /**
      * Stop this component and implement the requirements
      * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
@@ -82,7 +83,7 @@ public class ReplicatedContext extends S
      */
     @Override
     protected synchronized void stopInternal() throws LifecycleException {
-        
+
         super.stopInternal();
 
         AbstractMap<String,Object> map =
@@ -100,7 +101,7 @@ public class ReplicatedContext extends S
     public int getMapSendOptions() {
         return mapSendOptions;
     }
-    
+
     public ClassLoader[] getClassLoaders() {
         Loader loader = null;
         ClassLoader classLoader = null;
@@ -113,7 +114,7 @@ public class ReplicatedContext extends S
             return new ClassLoader[] {classLoader,Thread.currentThread().getContextClassLoader()};
         }
     }
-    
+
     @Override
     public ServletContext getServletContext() {
         if (context == null) {
@@ -126,38 +127,38 @@ public class ReplicatedContext extends S
 
     }
 
-    
+
     protected static class ReplApplContext extends ApplicationContext {
         protected ConcurrentHashMap<String, Object> tomcatAttributes =
             new ConcurrentHashMap<String, Object>();
-        
+
         public ReplApplContext(ReplicatedContext context) {
             super(context);
         }
-        
+
         protected ReplicatedContext getParent() {
             return (ReplicatedContext)getContext();
         }
-        
+
         @Override
         protected ServletContext getFacade() {
              return super.getFacade();
         }
-        
+
         public AbstractMap<String,Object> getAttributeMap() {
             return (AbstractMap<String,Object>)this.attributes;
         }
         public void setAttributeMap(AbstractMap<String,Object> map) {
             this.attributes = map;
         }
-        
+
         @Override
         public void removeAttribute(String name) {
             tomcatAttributes.remove(name);
             //do nothing
             super.removeAttribute(name);
         }
-        
+
         @Override
         public void setAttribute(String name, Object value) {
             if ( (!getParent().getState().isAvailable()) || "org.apache.jasper.runtime.JspApplicationContextImpl".equals(name) ){
@@ -165,7 +166,7 @@ public class ReplicatedContext extends S
             } else
                 super.setAttribute(name,value);
         }
-        
+
         @Override
         public Object getAttribute(String name) {
             Object obj = tomcatAttributes.get(name);
@@ -175,7 +176,7 @@ public class ReplicatedContext extends S
                 return obj;
             }
         }
-        
+
         @SuppressWarnings("unchecked")
         @Override
         public Enumeration<String> getAttributeNames() {
@@ -209,7 +210,7 @@ public class ReplicatedContext extends S
 
         }
     }
-    
+
     @Override
     public void objectMadePrimay(Object key, Object value) {
         //noop

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java Thu Aug  8 18:38:34 2013
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,14 +53,14 @@ public class BackupManager extends Clust
 
     /** Set to true if we don't want the sessions to expire on shutdown */
     protected boolean mExpireSessionsOnShutdown = true;
-    
+
     /**
      * The name of this manager
      */
     protected String name;
 
     /**
-     * 
+     *
      */
     private int mapSendOptions = Channel.SEND_OPTIONS_SYNCHRONIZED_ACK|Channel.SEND_OPTIONS_USE_ACK;
 
@@ -84,7 +84,7 @@ public class BackupManager extends Clust
 
 
 //******************************************************************************/
-//      ClusterManager Interface     
+//      ClusterManager Interface
 //******************************************************************************/
 
     @Override
@@ -130,7 +130,7 @@ public class BackupManager extends Clust
     public Session createEmptySession() {
         return new DeltaSession(this);
     }
-    
+
 
     @Override
     public String getName() {
@@ -145,13 +145,14 @@ public class BackupManager extends Clust
      * Starts the cluster communication channel, this will connect with the
      * other nodes in the cluster, and request the current session state to be
      * transferred to this node.
-     * 
+     *
      * @exception LifecycleException if this component detects a fatal error
      *  that prevents this component from being used
      */
+    @SuppressWarnings("unchecked")
     @Override
     protected synchronized void startInternal() throws LifecycleException {
-        
+
         super.startInternal();
 
         try {
@@ -179,7 +180,7 @@ public class BackupManager extends Clust
         }
         setState(LifecycleState.STARTING);
     }
-    
+
     public String getMapName() {
         String name = cluster.getManagerName(getName(),this)+"-"+"map";
         if ( log.isDebugEnabled() ) log.debug("Backup manager, Setting map name to:"+name);
@@ -190,7 +191,7 @@ public class BackupManager extends Clust
     /**
      * Stop this component and implement the requirements
      * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
-     * 
+     *
      * This will disconnect the cluster communication channel and stop the
      * listener thread.
      *
@@ -252,7 +253,7 @@ public class BackupManager extends Clust
     public String[] getInvalidatedSessions() {
         return new String[0];
     }
-    
+
     @Override
     public ClusterManager cloneFromTemplate() {
         BackupManager result = new BackupManager();

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/SessionIDMessage.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/SessionIDMessage.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/SessionIDMessage.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/SessionIDMessage.java Thu Aug  8 18:38:34 2013
@@ -20,12 +20,13 @@ import org.apache.catalina.ha.ClusterMes
 
 /**
  * Session id change cluster message
- * 
+ *
  * @author Peter Rossbach
- * 
+ *
  * @version $Id$
  * @deprecated Will be removed in Tomcat 8.0.x
  */
+@Deprecated
 public class SessionIDMessage extends ClusterMessageBase {
 
     private static final long serialVersionUID = 1L;
@@ -66,7 +67,7 @@ public class SessionIDMessage extends Cl
     public void setHost(String host) {
         this.host = host;
     }
-    
+
     /**
      * @return Returns the context name.
      */
@@ -94,7 +95,7 @@ public class SessionIDMessage extends Cl
         this.messageNumber = messageNumber;
     }
 
-    
+
     /**
      * @return Returns the backupSessionID.
      */

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JAASRealm.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JAASRealm.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JAASRealm.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JAASRealm.java Thu Aug  8 18:38:34 2013
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -95,7 +95,7 @@ import org.apache.tomcat.util.ExceptionU
  *     application name used to obtain the JAAS LoginContext ("Catalina" in
  *     a default installation). Tomcat must be able to find an application
  *     with this name in the JAAS configuration file. Here is a hypothetical
- *     JAAS configuration file entry for a database-oriented login module that uses 
+ *     JAAS configuration file entry for a database-oriented login module that uses
  *     a Tomcat-managed JNDI database resource:
  *     <blockquote><pre>Catalina {
 org.foobar.auth.DatabaseLoginModule REQUIRED
@@ -114,12 +114,12 @@ org.foobar.auth.DatabaseLoginModule REQU
 <blockquote><code>CATALINA_OPTS="-Djava.security.auth.login.config=$CATALINA_HOME/conf/jaas.config"</code></blockquote>
  * </li>
  * <li>As part of the login process, JAASRealm registers its own <code>CallbackHandler</code>,
- *     called (unsurprisingly) <code>JAASCallbackHandler</code>. This handler supplies the 
+ *     called (unsurprisingly) <code>JAASCallbackHandler</code>. This handler supplies the
  *     HTTP requests's username and credentials to the user-supplied <code>LoginModule</code></li>
  * <li>As with other <code>Realm</code> implementations, digested passwords are supported if
- *     the <code>&lt;Realm&gt;</code> element in <code>server.xml</code> contains a 
+ *     the <code>&lt;Realm&gt;</code> element in <code>server.xml</code> contains a
  *     <code>digest</code> attribute; <code>JAASCallbackHandler</code> will digest the password
- *     prior to passing it back to the <code>LoginModule</code></li>  
+ *     prior to passing it back to the <code>LoginModule</code></li>
 * </ul>
 *
 * @author Craig R. McClanahan
@@ -206,7 +206,7 @@ public class JAASRealm extends RealmBase
     public void setAppName(String name) {
         appName = name;
     }
-    
+
     /**
      * getter for the <code>appName</code> member variable
      */
@@ -233,7 +233,7 @@ public class JAASRealm extends RealmBase
      */
     public boolean isUseContextClassLoader() {
         return useContextClassLoader;
-    } 
+    }
 
     @Override
     public void setContainer(Container container) {
@@ -257,11 +257,11 @@ public class JAASRealm extends RealmBase
       * that represent security roles.
       */
      protected String roleClassNames = null;
-     
+
      public String getRoleClassNames() {
          return (this.roleClassNames);
      }
-     
+
      /**
       * Sets the list of comma-delimited classes that represent roles. The
       * classes in the list must implement <code>java.security.Principal</code>.
@@ -271,15 +271,15 @@ public class JAASRealm extends RealmBase
      public void setRoleClassNames(String roleClassNames) {
          this.roleClassNames = roleClassNames;
      }
-     
+
      /**
       * Parses a comma-delimited list of class names, and store the class names
       * in the provided List. Each class must implement
       * <code>java.security.Principal</code>.
-      * 
+      *
       * @param classNamesString a comma-delimited list of fully qualified class names.
       * @param classNamesList the list in which the class names will be stored.
-      *        The list is cleared before being populated. 
+      *        The list is cleared before being populated.
       */
      protected void parseClassNames(String classNamesString, List<String> classNamesList) {
          classNamesList.clear();
@@ -291,7 +291,7 @@ public class JAASRealm extends RealmBase
 
          String[] classNames = classNamesString.split("[ ]*,[ ]*");
          for (int i=0; i<classNames.length; i++) {
-             if (classNames[i].length()==0) continue;        
+             if (classNames[i].length()==0) continue;
              try {
                  Class<?> principalClass = Class.forName(classNames[i], false,
                          loader);
@@ -305,18 +305,18 @@ public class JAASRealm extends RealmBase
                  log.error("Class "+classNames[i]+" not found! Class not added.");
              }
          }
-     }     
-     
+     }
+
      /**
       * Comma-delimited list of <code>java.security.Principal</code> classes
       * that represent individual users.
       */
      protected String userClassNames = null;
-     
+
      public String getUserClassNames() {
          return (this.userClassNames);
      }
-     
+
      /**
       * Sets the list of comma-delimited classes that represent individual
       * users. The classes in the list must implement
@@ -339,7 +339,7 @@ public class JAASRealm extends RealmBase
 
     }
 
-    
+
     // --------------------------------------------------------- Public Methods
 
 
@@ -356,7 +356,7 @@ public class JAASRealm extends RealmBase
         return authenticate(username,
                 new JAASCallbackHandler(this, username, credentials));
     }
-     
+
 
     /**
      * Return the <code>Principal</code> associated with the specified username
@@ -524,8 +524,8 @@ public class JAASRealm extends RealmBase
      * by the JAASLoginModule. The first <code>Principal</code> object that matches
      * one of the class names supplied as a "user class" is the user Principal.
      * This object is returned to the caller.
-     * Any remaining principal objects returned by the LoginModules are mapped to  
-     * roles, but only if their respective classes match one of the "role class" classes. 
+     * Any remaining principal objects returned by the LoginModules are mapped to
+     * roles, but only if their respective classes match one of the "role class" classes.
      * If a user Principal cannot be constructed, return <code>null</code>.
      * @param subject The <code>Subject</code> representing the logged-in user
      * @param loginContext Associated with the Principal so
@@ -555,7 +555,7 @@ public class JAASRealm extends RealmBase
                     log.debug(sm.getString("jaasRealm.userPrincipalSuccess", principal.getName()));
                 }
             }
-            
+
             if (roleClasses.contains(principalClass)) {
                 roles.add(principal.getName());
                 if( log.isDebugEnabled() ) {
@@ -594,7 +594,7 @@ public class JAASRealm extends RealmBase
       */
      protected String makeLegalForJAAS(final String src) {
          String result = src;
-         
+
          // Default name is "other" per JAAS spec
          if(result == null) {
              result = "other";
@@ -649,6 +649,7 @@ public class JAASRealm extends RealmBase
                 URL resource = Thread.currentThread().getContextClassLoader().
                         getResource(configFile);
                 URI uri = resource.toURI();
+                @SuppressWarnings("unchecked")
                 Class<Configuration> sunConfigFile = (Class<Configuration>)
                         Class.forName("com.sun.security.auth.login.ConfigFile");
                 Constructor<Configuration> constructor =

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java Thu Aug  8 18:38:34 2013
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,37 +52,37 @@ import org.apache.catalina.tribes.member
  * <p>
  * The TcpFailureDetector works in two ways. <br>
  * 1. It intercepts memberDisappeared events
- * 2. It catches send errors 
+ * 2. It catches send errors
  * </p>
  *
  * @author Filip Hanik
  * @version 1.0
  */
 public class TcpFailureDetector extends ChannelInterceptorBase {
-    
+
     private static final org.apache.juli.logging.Log log = org.apache.juli.logging.LogFactory.getLog( TcpFailureDetector.class );
-    
+
     protected static byte[] TCP_FAIL_DETECT = new byte[] {
         79, -89, 115, 72, 121, -126, 67, -55, -97, 111, -119, -128, -95, 91, 7, 20,
         125, -39, 82, 91, -21, -15, 67, -102, -73, 126, -66, -113, -127, 103, 30, -74,
         55, 21, -66, -121, 69, 126, 76, -88, -65, 10, 77, 19, 83, 56, 21, 50,
-        85, -10, -108, -73, 58, -6, 64, 120, -111, 4, 125, -41, 114, -124, -64, -43};      
+        85, -10, -108, -73, 58, -6, 64, 120, -111, 4, 125, -41, 114, -124, -64, -43};
 
     @Deprecated
     protected boolean performConnectTest = true;//Unused - will be removed in Tomcat 8.0.x
 
     protected long connectTimeout = 1000;//1 second default
-    
+
     protected boolean performSendTest = true;
 
     protected boolean performReadTest = false;
-    
+
     protected long readTestTimeout = 5000;//5 seconds
-    
+
     protected Membership membership = null;
-    
+
     protected HashMap<Member, Long> removeSuspects = new HashMap<Member, Long>();
-    
+
     protected HashMap<Member, Long> addSuspects = new HashMap<Member, Long>();
 
     protected int removeSuspectsTimeout = 300; // 5 minutes
@@ -94,7 +94,7 @@ public class TcpFailureDetector extends 
         }catch ( ChannelException cx ) {
             FaultyMember[] mbrs = cx.getFaultyMembers();
             for ( int i=0; i<mbrs.length; i++ ) {
-                if ( mbrs[i].getCause()!=null &&  
+                if ( mbrs[i].getCause()!=null &&
                      (!(mbrs[i].getCause() instanceof RemoteProcessException)) ) {//RemoteProcessException's are ok
                     this.memberDisappeared(mbrs[i].getMember());
                 }//end if
@@ -105,20 +105,20 @@ public class TcpFailureDetector extends 
 
     @Override
     public void messageReceived(ChannelMessage msg) {
-        //catch incoming 
+        //catch incoming
         boolean process = true;
         if ( okToProcess(msg.getOptions()) ) {
             //check to see if it is a testMessage, if so, process = false
             process = ( (msg.getMessage().getLength() != TCP_FAIL_DETECT.length) ||
                         (!Arrays.equals(TCP_FAIL_DETECT,msg.getMessage().getBytes()) ) );
         }//end if
-            
+
         //ignore the message, it doesnt have the flag set
         if ( process ) super.messageReceived(msg);
         else if ( log.isDebugEnabled() ) log.debug("Received a failure detector packet:"+msg);
     }//messageReceived
-    
-    
+
+
     @Override
     public void memberAdded(Member member) {
         if ( membership == null ) setupMembership();
@@ -146,7 +146,7 @@ public class TcpFailureDetector extends 
         if ( membership == null ) setupMembership();
         boolean notify = false;
         boolean shutdown = Arrays.equals(member.getCommand(),Member.SHUTDOWN_PAYLOAD);
-        if ( !shutdown ) 
+        if ( !shutdown )
             if(log.isInfoEnabled())
                 log.info("Received memberDisappeared["+member+"] message. Will verify.");
         synchronized (membership) {
@@ -180,7 +180,7 @@ public class TcpFailureDetector extends 
 
         }
     }
-    
+
     @Override
     public boolean hasMembers() {
         if ( membership == null ) setupMembership();
@@ -203,14 +203,14 @@ public class TcpFailureDetector extends 
     public Member getLocalMember(boolean incAlive) {
         return super.getLocalMember(incAlive);
     }
-    
+
     @Override
     public void heartbeat() {
         super.heartbeat();
         checkMembers(false);
     }
     public void checkMembers(boolean checkAll) {
-        
+
         try {
             if (membership == null) setupMembership();
             synchronized (membership) {
@@ -220,10 +220,10 @@ public class TcpFailureDetector extends 
         }catch ( Exception x ) {
             log.warn("Unable to perform heartbeat on the TcpFailureDetector.",x);
         } finally {
-            
+
         }
     }
-    
+
     protected void performForcedCheck() {
         //update all alive times
         Member[] members = super.getMembers();
@@ -278,9 +278,9 @@ public class TcpFailureDetector extends 
             } else {
                 if (removeSuspectsTimeout > 0) {
                     long timeNow = System.currentTimeMillis();
-                    int timeIdle = (int) ((timeNow - removeSuspects.get(m)) / 1000L);
+                    int timeIdle = (int) ((timeNow - removeSuspects.get(m).longValue()) / 1000L);
                     if (timeIdle > removeSuspectsTimeout) {
-                        removeSuspects.remove(m); // remove suspect member 
+                        removeSuspects.remove(m); // remove suspect member
                     }
                 }
             }
@@ -300,26 +300,26 @@ public class TcpFailureDetector extends 
             } //end if
         }
     }
-    
+
     protected synchronized void setupMembership() {
         if ( membership == null ) {
             membership = new Membership((MemberImpl)super.getLocalMember(true));
         }
-        
+
     }
-    
+
     protected boolean memberAlive(Member mbr) {
         return memberAlive(mbr,TCP_FAIL_DETECT,performSendTest,performReadTest,readTestTimeout,connectTimeout,getOptionFlag());
     }
-    
-    protected static boolean memberAlive(Member mbr, byte[] msgData, 
+
+    protected static boolean memberAlive(Member mbr, byte[] msgData,
                                          boolean sendTest, boolean readTest,
                                          long readTimeout, long conTimeout,
                                          int optionFlag) {
         //could be a shutdown notification
         if ( Arrays.equals(mbr.getCommand(),Member.SHUTDOWN_PAYLOAD) ) return false;
-        
-        Socket socket = new Socket();        
+
+        Socket socket = new Socket();
         try {
             InetAddress ia = InetAddress.getByAddress(mbr.getHost());
             InetSocketAddress addr = new InetSocketAddress(ia, mbr.getPort());

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java Thu Aug  8 18:38:34 2013
@@ -111,11 +111,12 @@ public class TwoPhaseCommitInterceptor e
     public void setExpire(long expire) {
         this.expire = expire;
     }
-    
+
     @Override
     public void heartbeat() {
         try {
             long now = System.currentTimeMillis();
+            @SuppressWarnings("unchecked")
             Map.Entry<UniqueId,MapEntry>[] entries = messages.entrySet().toArray(new Map.Entry[messages.size()]);
             for (int i=0; i<entries.length; i++ ) {
                 MapEntry entry = entries[i].getValue();
@@ -131,12 +132,12 @@ public class TwoPhaseCommitInterceptor e
             super.heartbeat();
         }
     }
-    
+
     public static class MapEntry {
         public ChannelMessage msg;
         public UniqueId id;
         public long timestamp;
-        
+
         public MapEntry(ChannelMessage msg, UniqueId id, long timestamp) {
             this.msg = msg;
             this.id = id;

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Thu Aug  8 18:38:34 2013
@@ -53,6 +53,7 @@ import org.apache.juli.logging.LogFactor
  * @author Filip Hanik
  * @version 1.0
  */
+@SuppressWarnings("rawtypes")
 public abstract class AbstractReplicatedMap extends ConcurrentHashMap implements RpcCallback, ChannelListener, MembershipListener, Heartbeat {
     private static final long serialVersionUID = 1L;
 
@@ -467,6 +468,7 @@ public abstract class AbstractReplicated
      * @param complete boolean
      */
     public void replicate(boolean complete) {
+        @SuppressWarnings("unchecked")
         Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
         while (i.hasNext()) {
             Map.Entry<?,?> e = i.next();
@@ -541,6 +543,7 @@ public abstract class AbstractReplicated
         if (mapmsg.getMsgType() == MapMessage.MSG_STATE || mapmsg.getMsgType() == MapMessage.MSG_STATE_COPY) {
             synchronized (stateMutex) { //make sure we dont do two things at the same time
                 ArrayList<MapMessage> list = new ArrayList<MapMessage>();
+                @SuppressWarnings("unchecked")
                 Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
                 while (i.hasNext()) {
                     Map.Entry<?,?> e = i.next();
@@ -589,6 +592,7 @@ public abstract class AbstractReplicated
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void messageReceived(Serializable msg, Member sender) {
         if (! (msg instanceof MapMessage)) return;
@@ -715,6 +719,7 @@ public abstract class AbstractReplicated
         }
         if ( memberAdded ) {
             synchronized (stateMutex) {
+                @SuppressWarnings("unchecked")
                 Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
                 while (i.hasNext()) {
                     Map.Entry<?,?> e = i.next();
@@ -769,6 +774,7 @@ public abstract class AbstractReplicated
             }
         }
 
+        @SuppressWarnings("unchecked")
         Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
         while (i.hasNext()) {
             Map.Entry<?,?> e = i.next();
@@ -949,6 +955,7 @@ public abstract class AbstractReplicated
             for ( int i=0; i<mbrs.length;i++ ) {
                 System.out.println("Mbr["+(i+1)+"="+mbrs[i].getName());
             }
+            @SuppressWarnings("unchecked")
             Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
             int cnt = 0;
 
@@ -979,6 +986,7 @@ public abstract class AbstractReplicated
             return put(key,value,true);
         }
 
+        @SuppressWarnings("unchecked")
         public Object put(Object key, Object value, boolean notify) {
             MapEntry entry = new MapEntry(key,value);
             entry.setBackup(false);
@@ -1008,6 +1016,7 @@ public abstract class AbstractReplicated
          */
         @Override
         public void putAll(Map m) {
+            @SuppressWarnings("unchecked")
             Iterator<Map.Entry<?,?>> i = m.entrySet().iterator();
             while ( i.hasNext() ) {
                 Map.Entry<?,?> entry = i.next();
@@ -1036,6 +1045,7 @@ public abstract class AbstractReplicated
             if ( value == null ) {
                 return super.containsValue(value);
             } else {
+                @SuppressWarnings("unchecked")
                 Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
                 while (i.hasNext()) {
                     Map.Entry<?,?> e = i.next();
@@ -1072,6 +1082,7 @@ public abstract class AbstractReplicated
         @Override
         public Set<MapEntry> entrySet() {
             LinkedHashSet<MapEntry> set = new LinkedHashSet<MapEntry>(super.size());
+            @SuppressWarnings("unchecked")
             Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
             while ( i.hasNext() ) {
                 Map.Entry<?,?> e = i.next();
@@ -1089,6 +1100,7 @@ public abstract class AbstractReplicated
             //todo implement
             //should only return keys where this is active.
             LinkedHashSet<Object> set = new LinkedHashSet<Object>(super.size());
+            @SuppressWarnings("unchecked")
             Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
             while ( i.hasNext() ) {
                 Map.Entry<?,?> e = i.next();
@@ -1106,6 +1118,7 @@ public abstract class AbstractReplicated
             //todo, implement a counter variable instead
             //only count active members in this node
             int counter = 0;
+            @SuppressWarnings("unchecked")
             Iterator<Map.Entry<?,?>> it = super.entrySet().iterator();
             while (it!=null && it.hasNext() ) {
                 Map.Entry<?,?> e = it.next();
@@ -1125,6 +1138,7 @@ public abstract class AbstractReplicated
         @Override
         public Collection<Object> values() {
             ArrayList<Object> values = new ArrayList<Object>();
+            @SuppressWarnings("unchecked")
             Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
             while ( i.hasNext() ) {
                 Map.Entry<?,?> e = i.next();

Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu Aug  8 18:38:34 2013
@@ -819,6 +819,7 @@ public abstract class AbstractHttp11Proc
             InputFilter savedBody = new SavedRequestInputFilter(body);
             savedBody.setRequest(request);
 
+            @SuppressWarnings("unchecked")
             AbstractInputBuffer<S> internalBuffer = (AbstractInputBuffer<S>)
                 request.getInputBuffer();
             internalBuffer.addActiveFilter(savedBody);

Modified: tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/DirContextURLConnection.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/DirContextURLConnection.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/DirContextURLConnection.java Thu Aug  8 18:38:34 2013
@@ -362,7 +362,7 @@ public class DirContextURLConnection ext
      * Get object content.
      */
     @Override
-    public Object getContent(Class[] classes)
+    public Object getContent(@SuppressWarnings("rawtypes") Class[] classes)
         throws IOException {
 
         Object obj = getContent();

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DisposableConnectionFacade.java Thu Aug  8 18:38:34 2013
@@ -61,9 +61,9 @@ public class DisposableConnectionFacade 
     public Object invoke(Object proxy, Method method, Object[] args)
             throws Throwable {
         if (compare(EQUALS_VAL, method)) {
-            return this.equals(Proxy.getInvocationHandler(args[0]));
+            return Boolean.valueOf(this.equals(Proxy.getInvocationHandler(args[0])));
         } else if (compare(HASHCODE_VAL, method)) {
-            return this.hashCode();
+            return Integer.valueOf(this.hashCode());
         } else if (getNext()==null) {
             if (compare(ISCLOSED_VAL, method)) {
                 return Boolean.TRUE;

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java Thu Aug  8 18:38:34 2013
@@ -754,6 +754,7 @@ public class PoolProperties implements P
         }
 
         try {
+            @SuppressWarnings("unchecked")
             Class<Validator> validatorClass = (Class<Validator>)Class.forName(className);
             validator = validatorClass.newInstance();
         } catch (ClassNotFoundException e) {
@@ -936,6 +937,7 @@ public class PoolProperties implements P
             return properties;
         }
 
+        @SuppressWarnings("unchecked")
         public Class<? extends JdbcInterceptor> getInterceptorClass() throws ClassNotFoundException {
             if (clazz==null) {
                 if (getClassName().indexOf(".")<0) {

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java Thu Aug  8 18:38:34 2013
@@ -250,6 +250,7 @@ public class SlowQueryReport extends Abs
             "The date and time of the last invocation"
         };
 
+        @SuppressWarnings("rawtypes")
         static final OpenType[] FIELD_TYPES = new OpenType[] {
             SimpleType.STRING,
             SimpleType.INTEGER,
@@ -284,6 +285,7 @@ public class SlowQueryReport extends Abs
             return FIELD_DESCRIPTIONS;
         }
 
+        @SuppressWarnings("rawtypes")
         public static OpenType[] getFieldTypes() {
             return FIELD_TYPES;
         }

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java Thu Aug  8 18:38:34 2013
@@ -127,6 +127,7 @@ public class StatementCache extends Stat
 
     @Override
     public void disconnected(ConnectionPool parent, PooledConnection con, boolean finalizing) {
+        @SuppressWarnings("unchecked")
         ConcurrentHashMap<String,CachedStatement> statements =
             (ConcurrentHashMap<String,CachedStatement>)con.getAttributes().get(STATEMENT_CACHE_ATTR);
 
@@ -181,12 +182,14 @@ public class StatementCache extends Stat
     }
 
     public CachedStatement isCached(String sql) {
+        @SuppressWarnings("unchecked")
         ConcurrentHashMap<String,CachedStatement> cache =
             (ConcurrentHashMap<String,CachedStatement>)pcon.getAttributes().get(STATEMENT_CACHE_ATTR);
         return cache.get(sql);
     }
 
     public boolean cacheStatement(CachedStatement proxy) {
+        @SuppressWarnings("unchecked")
         ConcurrentHashMap<String,CachedStatement> cache =
             (ConcurrentHashMap<String,CachedStatement>)pcon.getAttributes().get(STATEMENT_CACHE_ATTR);
         if (proxy.getSql()==null) {
@@ -206,6 +209,7 @@ public class StatementCache extends Stat
     }
 
     public boolean removeStatement(CachedStatement proxy) {
+        @SuppressWarnings("unchecked")
         ConcurrentHashMap<String,CachedStatement> cache =
             (ConcurrentHashMap<String,CachedStatement>)pcon.getAttributes().get(STATEMENT_CACHE_ATTR);
         if (cache.remove(proxy.getSql()) != null) {

Modified: tomcat/tc7.0.x/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt (original)
+++ tomcat/tc7.0.x/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt Thu Aug  8 18:38:34 2013
@@ -52,7 +52,7 @@ Unnecessary code
    (all additional check boxes)
 Generic types
  - All                                  - W
-   (ignore unavoidable generics warnings)   (Eclipse 3.7+)
+   [ ] Ignore unavoidable generic type problems
 Annotations
  - All                                  - W
    (all additional check boxes)

Modified: tomcat/tc7.0.x/trunk/test/javax/el/TestResourceBundleELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/javax/el/TestResourceBundleELResolver.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/javax/el/TestResourceBundleELResolver.java (original)
+++ tomcat/tc7.0.x/trunk/test/javax/el/TestResourceBundleELResolver.java Thu Aug  8 18:38:34 2013
@@ -222,6 +222,7 @@ public class TestResourceBundleELResolve
         ResourceBundleELResolver resolver = new ResourceBundleELResolver();
         ELContext context = new ELContextImpl();
 
+        @SuppressWarnings("unchecked")
         Iterator<FeatureDescriptor> result = resolver.getFeatureDescriptors(
                 context, new Object());
 
@@ -238,6 +239,7 @@ public class TestResourceBundleELResolve
 
         ResourceBundle resourceBundle = new TesterResourceBundle(
                 new Object[][] { { "key", "value" } });
+        @SuppressWarnings("unchecked")
         Iterator<FeatureDescriptor> result = resolver.getFeatureDescriptors(
                 context, resourceBundle);
 

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java Thu Aug  8 18:38:34 2013
@@ -91,6 +91,7 @@ public class TestStandardContextResource
 
         // For BZ 54391. Relative ordering is specified in resources2.jar.
         // It is not absolute-ordering, so there may be other jars in the list
+        @SuppressWarnings("unchecked")
         List<String> orderedLibs = (List<String>) ctx.getServletContext()
                 .getAttribute(ServletContext.ORDERED_LIBS);
         if (orderedLibs.size() > 2) {

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter.java?rev=1511932&r1=1511931&r2=1511932&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter.java Thu Aug  8 18:38:34 2013
@@ -83,6 +83,7 @@ public class TestCsrfPreventionFilter ex
         ByteArrayInputStream bais =
             new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStream ois = new ObjectInputStream(bais);
+        @SuppressWarnings("unchecked")
         LruCache<String> cache2 = (LruCache<String>) ois.readObject();
 
         cache2.add("key7");



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