From 9a297fce0929a427536458e4cab332c17a8c1989 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 9 Nov 2009 12:34:45 +0000 Subject: [PATCH] Cookie is now serializable in Servlet 3.0 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 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/java/javax/servlet/http/Cookie.java b/java/javax/servlet/http/Cookie.java index ac4b5ff75..3e3afd67e 100644 --- a/java/javax/servlet/http/Cookie.java +++ b/java/javax/servlet/http/Cookie.java @@ -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; false * 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)) { -- 2.11.0