Author: markt Date: Fri Jun 1 17:42:59 2007 New Revision: 543681 URL: http://svn.apache.org/viewvc?view=rev&rev=543681 Log: Fix compiler warnings
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java?view=diff&rev=543681&r1=543680&r2=543681 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java Fri Jun 1 17:42:59 2007 @@ -267,7 +267,7 @@ static Object expandFileLock = new Object(); /** the shell environment variables to be passed to the CGI script */ - static Hashtable shellEnv = new Hashtable(); + static Hashtable<String,String> shellEnv = new Hashtable<String,String>(); /** * Sets instance variables. @@ -644,8 +644,8 @@ * See <a href="http://www.rgagnon.com/javadetails/java-0150.html">Read environment * variables from an application</a> for original source and article. */ - private Hashtable getShellEnvironment() throws IOException { - Hashtable envVars = new Hashtable(); + private Hashtable<String,String> getShellEnvironment() throws IOException { + Hashtable<String,String> envVars = new Hashtable<String,String>(); Process p = null; Runtime r = Runtime.getRuntime(); String OS = System.getProperty("os.name").toLowerCase(); @@ -729,7 +729,7 @@ private File workingDirectory = null; /** cgi command's command line parameters */ - private ArrayList cmdLineParameters = new ArrayList(); + private ArrayList<String> cmdLineParameters = new ArrayList<String>(); /** whether or not this object is valid or not */ private boolean valid = false; @@ -961,7 +961,7 @@ * (apologies to Marv Albert regarding MJ) */ - Hashtable envp = new Hashtable(); + Hashtable<String,String> envp = new Hashtable<String,String>(); // Add the shell environment variables (if any) envp.putAll(shellEnv); @@ -1539,7 +1539,7 @@ */ protected String[] hashToStringArray(Hashtable h) throws NullPointerException { - Vector v = new Vector(); + Vector<String> v = new Vector<String>(); Enumeration e = h.keys(); while (e.hasMoreElements()) { String k = e.nextElement().toString(); Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?view=diff&rev=543681&r1=543680&r2=543681 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Fri Jun 1 17:42:59 2007 @@ -174,7 +174,8 @@ * Key : path <br> * Value : LockInfo */ - private Hashtable resourceLocks = new Hashtable(); + private Hashtable<String,LockInfo> resourceLocks = + new Hashtable<String,LockInfo>(); /** @@ -185,7 +186,8 @@ * collection. Each element of the Vector is the path associated with * the lock-null resource. */ - private Hashtable lockNullResources = new Hashtable(); + private Hashtable<String,Vector<String>> lockNullResources = + new Hashtable<String,Vector<String>>(); /** @@ -194,7 +196,7 @@ * Key : path <br> * Value : LockInfo */ - private Vector collectionLocks = new Vector(); + private Vector<LockInfo> collectionLocks = new Vector<LockInfo>(); /** @@ -358,7 +360,7 @@ } // Properties which are to be displayed. - Vector properties = null; + Vector<String> properties = null; // Propfind depth int depth = INFINITY; // Propfind type @@ -416,7 +418,7 @@ } if (type == FIND_BY_PROPERTY) { - properties = new Vector(); + properties = new Vector<String>(); NodeList childList = propNode.getChildNodes(); for (int i=0; i < childList.getLength(); i++) { @@ -504,11 +506,11 @@ properties); } else { // The stack always contains the object of the current level - Stack stack = new Stack(); + Stack<String> stack = new Stack<String>(); stack.push(path); // Stack of the objects one level below - Stack stackBelow = new Stack(); + Stack<String> stackBelow = new Stack<String>(); while ((!stack.isEmpty()) && (depth >= 0)) { @@ -567,7 +569,7 @@ if (stack.isEmpty()) { depth--; stack = stackBelow; - stackBelow = new Stack(); + stackBelow = new Stack<String>(); } generatedXML.sendData(); @@ -1017,7 +1019,7 @@ // Checking if a child resource of this collection is // already locked - Vector lockPaths = new Vector(); + Vector<String> lockPaths = new Vector<String>(); locksList = collectionLocks.elements(); while (locksList.hasMoreElements()) { LockInfo currentLock = (LockInfo) locksList.nextElement(); @@ -1164,10 +1166,10 @@ int slash = lock.path.lastIndexOf('/'); String parentPath = lock.path.substring(0, slash); - Vector lockNulls = - (Vector) lockNullResources.get(parentPath); + Vector<String> lockNulls = + lockNullResources.get(parentPath); if (lockNulls == null) { - lockNulls = new Vector(); + lockNulls = new Vector<String>(); lockNullResources.put(parentPath, lockNulls); } @@ -1636,7 +1638,7 @@ // Copying source to destination - Hashtable errorList = new Hashtable(); + Hashtable<String,Integer> errorList = new Hashtable<String,Integer>(); boolean result = copyResource(resources, errorList, path, destinationPath); @@ -1666,8 +1668,8 @@ * @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<String,Integer> errorList, String source, String dest) { if (debug > 1) log("Copy: " + source + " To: " + dest); @@ -1807,7 +1809,8 @@ } } else { - Hashtable errorList = new Hashtable(); + Hashtable<String,Integer> errorList = + new Hashtable<String,Integer>(); deleteCollection(req, resources, path, errorList); try { @@ -1842,7 +1845,8 @@ */ private void deleteCollection(HttpServletRequest req, DirContext resources, - String path, Hashtable errorList) { + String path, + Hashtable<String,Integer> errorList) { if (debug > 1) log("Delete:" + path); @@ -1983,7 +1987,7 @@ private void parseProperties(HttpServletRequest req, XMLWriter generatedXML, String path, int type, - Vector propertiesVector) { + Vector<String> propertiesVector) { // Exclude any resource in the /WEB-INF and /META-INF subdirectories // (the "toUpperCase()" avoids problems on Windows systems) @@ -2119,14 +2123,14 @@ case FIND_BY_PROPERTY : - Vector propertiesNotFound = new Vector(); + Vector<String> propertiesNotFound = new Vector<String>(); // Parse the list of properties generatedXML.writeElement(null, "propstat", XMLWriter.OPENING); generatedXML.writeElement(null, "prop", XMLWriter.OPENING); - Enumeration properties = propertiesVector.elements(); + Enumeration<String> properties = propertiesVector.elements(); while (properties.hasMoreElements()) { @@ -2396,7 +2400,7 @@ case FIND_BY_PROPERTY : - Vector propertiesNotFound = new Vector(); + Vector<String> propertiesNotFound = new Vector<String>(); // Parse the list of properties @@ -2645,7 +2649,7 @@ String scope = "exclusive"; int depth = 0; String owner = ""; - Vector tokens = new Vector(); + Vector<String> tokens = new Vector<String>(); long expiresAt = 0; Date creationDate = new Date(); @@ -2742,20 +2746,6 @@ } - // --------------------------------------------------- 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 @@ * status codes to descriptive text. This is a static * variable. */ - private static Hashtable mapStatusCodes = new Hashtable(); + private static Hashtable<Integer,String> mapStatusCodes = + new Hashtable<Integer,String>(); // ------------------------------------------------------ HTTP Status Codes --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]