Cookie is now serializable in Servlet 3.0
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Nov 2009 12:34:45 +0000 (12:34 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Nov 2009 12:34:45 +0000 (12:34 +0000)
Fix some Eclipse warnings

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@834034 13f79535-47bb-0310-9956-ffa450edef68

java/javax/servlet/http/Cookie.java

index ac4b5ff..3e3afd6 100644 (file)
@@ -16,6 +16,7 @@
 */
 package javax.servlet.http;
 
+import java.io.Serializable;
 import java.text.MessageFormat;
 import java.util.ResourceBundle;
 
@@ -58,12 +59,9 @@ import java.util.ResourceBundle;
  * @version    $Version$
  *
  */
+public class Cookie implements Cloneable, Serializable {
 
-// XXX would implement java.io.Serializable too, but can't do that
-// so long as sun.servlet.* must run on older JDK 1.02 JVMs which
-// don't include that support.
-
-public class Cookie implements Cloneable {
+    private static final long serialVersionUID = 1L;
 
     private static final String LSTRING_FILE =
        "javax.servlet.http.LocalStrings";
@@ -560,11 +558,11 @@ public class Cookie implements Cloneable {
      *                         a reserved token; <code>false</code>
      *                         if it is not                    
      */
-    private boolean isToken(String value) {
-        int len = value.length();
+    private boolean isToken(String possibleToken) {
+        int len = possibleToken.length();
 
         for (int i = 0; i < len; i++) {
-            char c = value.charAt(i);
+            char c = possibleToken.charAt(i);
 
             if (c < 0x20 || c >= 0x7f || tspecials.indexOf(c) != -1 ||
                     (STRICT_NAMING && tspecials2.indexOf(c) != -1)) {