From: markt Date: Sat, 2 Jun 2007 00:42:59 +0000 (+0000) Subject: Fix compiler warnings X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7485ab879bcacc0df5b7264f756b67dc1e31bef8;p=tomcat7.0 Fix compiler warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@543681 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/servlets/CGIServlet.java b/java/org/apache/catalina/servlets/CGIServlet.java index 4219c8a52..586d9207f 100644 --- a/java/org/apache/catalina/servlets/CGIServlet.java +++ b/java/org/apache/catalina/servlets/CGIServlet.java @@ -267,7 +267,7 @@ public final class CGIServlet extends HttpServlet { static Object expandFileLock = new Object(); /** the shell environment variables to be passed to the CGI script */ - static Hashtable shellEnv = new Hashtable(); + static Hashtable shellEnv = new Hashtable(); /** * Sets instance variables. @@ -644,8 +644,8 @@ public final class CGIServlet extends HttpServlet { * See Read environment * variables from an application for original source and article. */ - private Hashtable getShellEnvironment() throws IOException { - Hashtable envVars = new Hashtable(); + private Hashtable getShellEnvironment() throws IOException { + Hashtable envVars = new Hashtable(); Process p = null; Runtime r = Runtime.getRuntime(); String OS = System.getProperty("os.name").toLowerCase(); @@ -729,7 +729,7 @@ public final class CGIServlet extends HttpServlet { private File workingDirectory = null; /** cgi command's command line parameters */ - private ArrayList cmdLineParameters = new ArrayList(); + private ArrayList cmdLineParameters = new ArrayList(); /** whether or not this object is valid or not */ private boolean valid = false; @@ -961,7 +961,7 @@ public final class CGIServlet extends HttpServlet { * (apologies to Marv Albert regarding MJ) */ - Hashtable envp = new Hashtable(); + Hashtable envp = new Hashtable(); // Add the shell environment variables (if any) envp.putAll(shellEnv); @@ -1539,7 +1539,7 @@ public final class CGIServlet extends HttpServlet { */ protected String[] hashToStringArray(Hashtable h) throws NullPointerException { - Vector v = new Vector(); + Vector v = new Vector(); Enumeration e = h.keys(); while (e.hasMoreElements()) { String k = e.nextElement().toString(); diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java index 0483a0805..6b30ab96b 100644 --- a/java/org/apache/catalina/servlets/WebdavServlet.java +++ b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -174,7 +174,8 @@ public class WebdavServlet * Key : path
* Value : LockInfo */ - private Hashtable resourceLocks = new Hashtable(); + private Hashtable resourceLocks = + new Hashtable(); /** @@ -185,7 +186,8 @@ public class WebdavServlet * collection. Each element of the Vector is the path associated with * the lock-null resource. */ - private Hashtable lockNullResources = new Hashtable(); + private Hashtable> lockNullResources = + new Hashtable>(); /** @@ -194,7 +196,7 @@ public class WebdavServlet * Key : path
* Value : LockInfo */ - private Vector collectionLocks = new Vector(); + private Vector collectionLocks = new Vector(); /** @@ -358,7 +360,7 @@ public class WebdavServlet } // Properties which are to be displayed. - Vector properties = null; + Vector properties = null; // Propfind depth int depth = INFINITY; // Propfind type @@ -416,7 +418,7 @@ public class WebdavServlet } if (type == FIND_BY_PROPERTY) { - properties = new Vector(); + properties = new Vector(); NodeList childList = propNode.getChildNodes(); for (int i=0; i < childList.getLength(); i++) { @@ -504,11 +506,11 @@ public class WebdavServlet properties); } else { // The stack always contains the object of the current level - Stack stack = new Stack(); + Stack stack = new Stack(); stack.push(path); // Stack of the objects one level below - Stack stackBelow = new Stack(); + Stack stackBelow = new Stack(); while ((!stack.isEmpty()) && (depth >= 0)) { @@ -567,7 +569,7 @@ public class WebdavServlet if (stack.isEmpty()) { depth--; stack = stackBelow; - stackBelow = new Stack(); + stackBelow = new Stack(); } generatedXML.sendData(); @@ -1017,7 +1019,7 @@ public class WebdavServlet // Checking if a child resource of this collection is // already locked - Vector lockPaths = new Vector(); + Vector lockPaths = new Vector(); locksList = collectionLocks.elements(); while (locksList.hasMoreElements()) { LockInfo currentLock = (LockInfo) locksList.nextElement(); @@ -1164,10 +1166,10 @@ public class WebdavServlet int slash = lock.path.lastIndexOf('/'); String parentPath = lock.path.substring(0, slash); - Vector lockNulls = - (Vector) lockNullResources.get(parentPath); + Vector lockNulls = + lockNullResources.get(parentPath); if (lockNulls == null) { - lockNulls = new Vector(); + lockNulls = new Vector(); lockNullResources.put(parentPath, lockNulls); } @@ -1636,7 +1638,7 @@ public class WebdavServlet // Copying source to destination - Hashtable errorList = new Hashtable(); + Hashtable errorList = new Hashtable(); boolean result = copyResource(resources, errorList, path, destinationPath); @@ -1666,8 +1668,8 @@ public class WebdavServlet * @param source Path of the resource to be copied * @param dest Destination path */ - private boolean copyResource(DirContext resources, Hashtable errorList, - String source, String dest) { + private boolean copyResource(DirContext resources, + Hashtable errorList, String source, String dest) { if (debug > 1) log("Copy: " + source + " To: " + dest); @@ -1807,7 +1809,8 @@ public class WebdavServlet } } else { - Hashtable errorList = new Hashtable(); + Hashtable errorList = + new Hashtable(); deleteCollection(req, resources, path, errorList); try { @@ -1842,7 +1845,8 @@ public class WebdavServlet */ private void deleteCollection(HttpServletRequest req, DirContext resources, - String path, Hashtable errorList) { + String path, + Hashtable errorList) { if (debug > 1) log("Delete:" + path); @@ -1983,7 +1987,7 @@ public class WebdavServlet private void parseProperties(HttpServletRequest req, XMLWriter generatedXML, String path, int type, - Vector propertiesVector) { + Vector propertiesVector) { // Exclude any resource in the /WEB-INF and /META-INF subdirectories // (the "toUpperCase()" avoids problems on Windows systems) @@ -2119,14 +2123,14 @@ public class WebdavServlet case FIND_BY_PROPERTY : - Vector propertiesNotFound = new Vector(); + Vector propertiesNotFound = new Vector(); // Parse the list of properties generatedXML.writeElement(null, "propstat", XMLWriter.OPENING); generatedXML.writeElement(null, "prop", XMLWriter.OPENING); - Enumeration properties = propertiesVector.elements(); + Enumeration properties = propertiesVector.elements(); while (properties.hasMoreElements()) { @@ -2396,7 +2400,7 @@ public class WebdavServlet case FIND_BY_PROPERTY : - Vector propertiesNotFound = new Vector(); + Vector propertiesNotFound = new Vector(); // Parse the list of properties @@ -2645,7 +2649,7 @@ public class WebdavServlet String scope = "exclusive"; int depth = 0; String owner = ""; - Vector tokens = new Vector(); + Vector tokens = new Vector(); long expiresAt = 0; Date creationDate = new Date(); @@ -2742,20 +2746,6 @@ public class WebdavServlet } - // --------------------------------------------------- Property Inner Class - - - private class Property { - - public String name; - public String value; - public String namespace; - public String namespaceAbbrev; - public int status = WebdavStatus.SC_OK; - - } - - }; @@ -2782,7 +2772,8 @@ class WebdavStatus { * status codes to descriptive text. This is a static * variable. */ - private static Hashtable mapStatusCodes = new Hashtable(); + private static Hashtable mapStatusCodes = + new Hashtable(); // ------------------------------------------------------ HTTP Status Codes