tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r722589 - in /tomcat/trunk/java/org/apache/catalina/valves: AccessLogValve.java ExtendedAccessLogValve.java JDBCAccessLogValve.java RequestDumperValve.java RequestFilterValve.java SSLValve.java
Date Tue, 02 Dec 2008 19:54:06 GMT
Author: markt
Date: Tue Dec  2 11:54:06 2008
New Revision: 722589

URL: http://svn.apache.org/viewvc?rev=722589&view=rev
Log:
Generics for o.a.c.valves
Fix a couple of other Eclipse warnings as well

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
    tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
    tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java
    tomcat/trunk/java/org/apache/catalina/valves/RequestDumperValve.java
    tomcat/trunk/java/org/apache/catalina/valves/RequestFilterValve.java
    tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=722589&r1=722588&r2=722589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Tue Dec  2 11:54:06 2008
@@ -1412,7 +1412,7 @@
         if (buf.length() > 0) {
             list.add(new StringElement(buf.toString()));
         }
-        return (AccessLogElement[]) list.toArray(new AccessLogElement[0]);
+        return list.toArray(new AccessLogElement[0]);
     }
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java?rev=722589&r1=722588&r2=722589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java Tue Dec  2 11:54:06
2008
@@ -571,7 +571,7 @@
             if (log.isDebugEnabled()) {
                 log.debug("finished decoding with element size of: " + list.size());
             }
-            return (AccessLogElement[]) list.toArray(new AccessLogElement[0]);
+            return list.toArray(new AccessLogElement[0]);
         } catch (IOException e) {
             log.error("parse error", e);
             return null;

Modified: tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java?rev=722589&r1=722588&r2=722589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java Tue Dec  2 11:54:06
2008
@@ -579,7 +579,7 @@
         // Instantiate our database driver if necessary
         if (driver == null) {
             try {
-                Class clazz = Class.forName(driverName);
+                Class<?> clazz = Class.forName(driverName);
                 driver = (Driver) clazz.newInstance();
             } catch (Throwable e) {
                 throw new SQLException(e.getMessage());
@@ -627,7 +627,7 @@
         try {
             ps.close();
         } catch (Throwable f) {
-            ;
+            // Ignore
         }
         this.ps = null;
 

Modified: tomcat/trunk/java/org/apache/catalina/valves/RequestDumperValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/RequestDumperValve.java?rev=722589&r1=722588&r2=722589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/RequestDumperValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/RequestDumperValve.java Tue Dec  2 11:54:06
2008
@@ -109,20 +109,20 @@
                 log.info("            cookie=" + cookies[i].getName() + "=" +
                     cookies[i].getValue());
         }
-        Enumeration hnames = request.getHeaderNames();
+        Enumeration<String> hnames = request.getHeaderNames();
         while (hnames.hasMoreElements()) {
-            String hname = (String) hnames.nextElement();
-            Enumeration hvalues = request.getHeaders(hname);
+            String hname = hnames.nextElement();
+            Enumeration<String> hvalues = request.getHeaders(hname);
             while (hvalues.hasMoreElements()) {
-                String hvalue = (String) hvalues.nextElement();
+                String hvalue = hvalues.nextElement();
                 log.info("            header=" + hname + "=" + hvalue);
             }
         }
         log.info("            locale=" + request.getLocale());
         log.info("            method=" + request.getMethod());
-        Enumeration pnames = request.getParameterNames();
+        Enumeration<String> pnames = request.getParameterNames();
         while (pnames.hasMoreElements()) {
-            String pname = (String) pnames.nextElement();
+            String pname = pnames.nextElement();
             String pvalues[] = request.getParameterValues(pname);
             StringBuffer result = new StringBuffer(pname);
             result.append('=');

Modified: tomcat/trunk/java/org/apache/catalina/valves/RequestFilterValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/RequestFilterValve.java?rev=722589&r1=722588&r2=722589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/RequestFilterValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/RequestFilterValve.java Tue Dec  2 11:54:06
2008
@@ -217,7 +217,7 @@
             return (new Pattern[0]);
         list += ",";
 
-        ArrayList reList = new ArrayList();
+        ArrayList<Pattern> reList = new ArrayList<Pattern>();
         while (list.length() > 0) {
             int comma = list.indexOf(',');
             if (comma < 0)
@@ -235,7 +235,7 @@
         }
 
         Pattern reArray[] = new Pattern[reList.size()];
-        return ((Pattern[]) reList.toArray(reArray));
+        return reList.toArray(reArray);
 
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java?rev=722589&r1=722588&r2=722589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java Tue Dec  2 11:54:06 2008
@@ -28,7 +28,6 @@
 import org.apache.catalina.valves.ValveBase;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
-import org.apache.catalina.util.StringManager;
 
 /*
  * Valve to fill the SSL informations in the request
@@ -48,22 +47,7 @@
 
 public class SSLValve
     extends ValveBase {
-/*
-    private static final String info =
-        "SSLValve/1.0";
-    protected static StringManager sm =
-        StringManager.getManager(Constants.Package);
-    public String getInfo() {
-        return (info);
-    }
-    public String toString() {
-        StringBuffer sb = new StringBuffer("SSLValve[");
-                if (container != null)
-            sb.append(container.getName());
-        sb.append("]");
-        return (sb.toString());
-    }
- */
+
     public String mygetHeader(Request request, String header) {
         String strcert0 = request.getHeader(header);
         if (strcert0 == null)



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


Mime
View raw message