Fix some Eclipse warnings
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 30 Dec 2009 09:29:19 +0000 (09:29 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 30 Dec 2009 09:29:19 +0000 (09:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@894573 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/servlets/CGIServlet.java

index bd493cd..3e504e9 100644 (file)
@@ -244,6 +244,8 @@ public final class CGIServlet extends HttpServlet {
 
     /* some vars below copied from Craig R. McClanahan's InvokerServlet */
 
+    private static final long serialVersionUID = 1L;
+
     /** the debugging detail level for this servlet. */
     private int debug = 0;
 
@@ -327,7 +329,9 @@ public final class CGIServlet extends HttpServlet {
      *
      */
     protected void printServletEnvironment(ServletOutputStream out,
-        HttpServletRequest req, HttpServletResponse res) throws IOException {
+        HttpServletRequest req,
+        @SuppressWarnings("unused") HttpServletResponse res)
+    throws IOException {
 
         // Document the properties from ServletRequest
         out.println("<h1>ServletRequest Properties</h1>");
@@ -867,21 +871,21 @@ public final class CGIServlet extends HttpServlet {
             }
             if (!currentLocation.isFile()) {
                 return new String[] { null, null, null, null };
-            } else {
-                if (debug >= 2) {
-                    log("findCGI: FOUND cgi at " + currentLocation);
-                }
-                path = currentLocation.getAbsolutePath();
-                name = currentLocation.getName();
+            }
 
-                if (".".equals(contextPath)) {
-                    scriptname = servletPath;
-                } else {
-                    scriptname = contextPath + servletPath;
-                }
-                if (!servletPath.equals(cginame)) {
-                    scriptname = scriptname + cginame;
-                }
+            if (debug >= 2) {
+                log("findCGI: FOUND cgi at " + currentLocation);
+            }
+            path = currentLocation.getAbsolutePath();
+            name = currentLocation.getName();
+
+            if (".".equals(contextPath)) {
+                scriptname = servletPath;
+            } else {
+                scriptname = contextPath + servletPath;
+            }
+            if (!servletPath.equals(cginame)) {
+                scriptname = scriptname + cginame;
             }
 
             if (debug >= 1) {