Hi,

IMO, this will not work if you are trying to avoid serializing attributes with the name "javax.security.auth.subject".

Daniel


From: [EMAIL PROTECTED]
Reply-To: "Tomcat Developers List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardSession.java
Date: 1 Apr 2004 17:39:53 -0000


jfarcand 2004/04/01 09:39:53

Modified: catalina/src/share/org/apache/catalina Globals.java
catalina/src/share/org/apache/catalina/session
StandardSession.java
Log:
Minor fixe. Instead of using an exclude list, make the variable transient.


Revision Changes Path
1.8 +2 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java


Index: Globals.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Globals.java 27 Feb 2004 14:58:38 -0000 1.7
+++ Globals.java 1 Apr 2004 17:39:53 -0000 1.8
@@ -287,7 +287,7 @@
/**
* The subject under which the AccessControlContext is running.
*/
- public static final String SUBJECT_ATTR =
+ public static transient final String SUBJECT_ATTR =
"javax.security.auth.subject";






1.42 +2 -26 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java

Index: StandardSession.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- StandardSession.java 25 Mar 2004 22:17:54 -0000 1.41
+++ StandardSession.java 1 Apr 2004 17:39:53 -0000 1.42
@@ -160,14 +160,6 @@



/** - * Set of attribute names which are not allowed to be persisted. - */ - private static final String[] excludedAttributes = { - Globals.SUBJECT_ATTR - }; - - - /** * We are currently processing a session expiration, so bypass * certain IllegalStateException tests. NOTE: This value is not * included in the serialized version of this object. @@ -1393,8 +1385,7 @@ } if (value == null) continue; - else if ( (value instanceof Serializable) - && (!exclude(keys[i]) )) { + else if ( (value instanceof Serializable) ) { saveNames.add(keys[i]); saveValues.add(value); } else { @@ -1422,21 +1413,6 @@ } }

  -    }
  -
  -
  -    /**
  -     * Exclude attribute that cannot be serialized.
  -     * @param name the attribute's name
  -     */
  -    protected boolean exclude(String name){
  -
  -        for (int i = 0; i < excludedAttributes.length; i++) {
  -            if (name.equalsIgnoreCase(excludedAttributes[i]))
  -                return true;
  -        }
  -
  -        return false;
       }






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Chat: Ha en fest på Habbo Hotel http://habbohotel.msn.se/habbo/sv/channelizer Checka in här!



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to