You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2010/12/04 01:58:14 UTC

svn commit: r1042078 - in /myfaces/trinidad/branches/1.2.12.3-branch: ./ trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/ trinidad-sand...

Author: arobinson74
Date: Sat Dec  4 00:58:13 2010
New Revision: 1042078

URL: http://svn.apache.org/viewvc?rev=1042078&view=rev
Log:
TRINIDAD-1956 - merge to 1.2.12.3 branch

Modified:
    myfaces/trinidad/branches/1.2.12.3-branch/   (props changed)
    myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/StateUtils.java
    myfaces/trinidad/branches/1.2.12.3-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/   (props changed)
    myfaces/trinidad/branches/1.2.12.3-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/   (props changed)

Propchange: myfaces/trinidad/branches/1.2.12.3-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec  4 00:58:13 2010
@@ -4,4 +4,4 @@
 /myfaces/trinidad/branches/1.2.9.1-branch:697924,699406,699496
 /myfaces/trinidad/branches/TRINIDAD-1402:745675
 /myfaces/trinidad/branches/jwaldman_StyleMap:754977-770778
-/myfaces/trinidad/trunk:894885,915962,962582,1002826
+/myfaces/trinidad/trunk:894885,915962,962582,1002826,1031716

Modified: myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/StateUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/StateUtils.java?rev=1042078&r1=1042077&r2=1042078&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/StateUtils.java (original)
+++ myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/StateUtils.java Sat Dec  4 00:58:13 2010
@@ -30,7 +30,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import java.util.concurrent.ConcurrentMap;
 
 import javax.faces.component.StateHolder;
@@ -65,7 +64,7 @@ public final class StateUtils
     // we wrap the check in a try/catch in case of weird ecurity managers
     try
     {
-      checkSerializationProperty = 
+      checkSerializationProperty =
                        System.getProperty("org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION");
     }
     catch (Throwable t)
@@ -76,12 +75,12 @@ public final class StateUtils
     if (checkSerializationProperty != null)
     {
       checkSerializationProperty = checkSerializationProperty.toUpperCase();
-      
+
       // comma-separated list with allowed whitespace
       String[] paramArray = checkSerializationProperty.split(",");
-      
+
       Set<String> serializationFlags = new HashSet<String>(Arrays.asList(paramArray));
-      
+
       if (!serializationFlags.contains("NONE"))
       {
         if (serializationFlags.contains("ALL"))
@@ -97,7 +96,7 @@ public final class StateUtils
         {
           checkPropertyStateSerialization = serializationFlags.contains("PROPERTY");
           checkComponentStateSerialization = serializationFlags.contains("COMPONENT");
-          checkComponentTreeStateSerialization = serializationFlags.contains("TREE");       
+          checkComponentTreeStateSerialization = serializationFlags.contains("TREE");
           checkSessionSerialization = serializationFlags.contains("SESSION");
           checkApplicationSerialization = serializationFlags.contains("APPLICATION");
           checkMangedBeanMutation = serializationFlags.contains("BEANS");
@@ -179,7 +178,7 @@ public final class StateUtils
    * check for serializability when testing applications.  While component
    * tree state serializability checking isn't cheap, it is much faster to
    * initially only enable checking of the component tree and then switch
-   * to <code>all</code> testing to determine the problem component and 
+   * to <code>all</code> testing to determine the problem component and
    * property when the component tree testing determines a problem.
    * @return
    * @see #checkComponentStateSerialization
@@ -249,8 +248,8 @@ public final class StateUtils
   {
     return _CHECK_MANAGED_BEAN_MUTATATION;
   }
-  
-    
+
+
   /**
    * Persists a property key.
    */
@@ -308,7 +307,13 @@ public final class StateUtils
     {
       PropertyKey key = entry.getKey();
       if (key.isTransient())
+      {
+        // TRINIDAD-1956: due to the view root caching functionality, the transient properties
+        // may be retained too long. By removing the value here we can ensure that the next
+        // request will not have the transient values.
+        entry.setValue(null);
         continue;
+      }
 
       Object value = entry.getValue();
 
@@ -319,7 +324,7 @@ public final class StateUtils
       }
 
       Object saveValue;
-      
+
       if (useStateHolder)
         saveValue = saveStateHolder(context, value);
       else
@@ -333,15 +338,15 @@ public final class StateUtils
           new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(saveValue);
         }
         catch (IOException e)
-        {          
+        {
           throw new RuntimeException(_LOG.getMessage("UNSERIALIZABLE_PROPERTY_VALUE",
                                                      new Object[]{saveValue, key, map}),
                                      e);
         }
       }
-      
+
       values[i + 1] = saveValue;
-      
+
       i+=2;
     }
 
@@ -514,26 +519,26 @@ public final class StateUtils
       // we don't need to use concurrent map methods like putIfAbsent. If someone happens to
       // add a name/value pair again it's fine because as the doc for put in HashMap says
       // "If the map previously contained a mapping for this key, the old value is replaced."
-      ConcurrentMap<String, Object> appMap = 
+      ConcurrentMap<String, Object> appMap =
                            RequestContext.getCurrentInstance().getApplicationScopedConcurrentMap();
-      
+
 
       Map<String, Class> classMap = (Map<String, Class>) appMap.get(_CLASS_MAP_KEY);
-      
+
       if (classMap == null)
-      {    
-        // the classMap doesn't need to worry about synchronization, 
-        // if the Class is loaded twice that's fine. 
+      {
+        // the classMap doesn't need to worry about synchronization,
+        // if the Class is loaded twice that's fine.
         Map<String, Class> newClassMap = new HashMap<String, Class>();
-        Map<String, Class> oldClassMap = 
+        Map<String, Class> oldClassMap =
                               (Map<String, Class>) appMap.putIfAbsent(_CLASS_MAP_KEY, newClassMap);
-        
+
         if (oldClassMap != null)
           classMap = oldClassMap;
         else
           classMap = newClassMap;
       }
-            
+
       Class clazz = classMap.get(_name);
 
       if (clazz == null)
@@ -608,7 +613,7 @@ public final class StateUtils
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(StateUtils.class);
 
-  private static final String _CLASS_MAP_KEY = 
+  private static final String _CLASS_MAP_KEY =
                                            "org.apache.myfaces.trinidad.bean.util.CLASS_MAP_KEY";
 
 

Propchange: myfaces/trinidad/branches/1.2.12.3-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec  4 00:58:13 2010
@@ -3,4 +3,4 @@
 /myfaces/trinidad/branches/1.2.12.2-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:895708
 /myfaces/trinidad/branches/1.2.9.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:699406,699496
 /myfaces/trinidad/branches/TRINIDAD-1402/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:745675
-/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:894885,915962,962582,1002826
+/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:894885,915962,962582,1002826,1031716

Propchange: myfaces/trinidad/branches/1.2.12.3-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec  4 00:58:13 2010
@@ -3,4 +3,4 @@
 /myfaces/trinidad/branches/1.2.12.2-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:895708
 /myfaces/trinidad/branches/1.2.9.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:699406,699496
 /myfaces/trinidad/branches/TRINIDAD-1402/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:745675
-/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:894885,915962,962582,1002826
+/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:894885,915962,962582,1002826,1031716