myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: refactored
Date Wed, 26 Dec 2018 11:29:13 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bf3b18  refactored
7bf3b18 is described below

commit 7bf3b18a632cb40357b9275c738756494ec29c33
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Wed Dec 26 12:29:24 2018 +0100

    refactored
---
 .../component/_AttachedCollectionStateWrapper.java |  4 ++--
 .../faces/component/_ComponentAttributesMap.java   | 17 +---------------
 .../javax/faces/component/_ComponentFacetMap.java  |  3 +--
 .../javax/faces/component/_DeltaStateHelper.java   | 23 ++++------------------
 .../myfaces/application/NavigationHandlerImpl.java |  3 +--
 5 files changed, 9 insertions(+), 41 deletions(-)

diff --git a/api/src/main/java/javax/faces/component/_AttachedCollectionStateWrapper.java
b/api/src/main/java/javax/faces/component/_AttachedCollectionStateWrapper.java
index 069dec1..7f10fa7 100644
--- a/api/src/main/java/javax/faces/component/_AttachedCollectionStateWrapper.java
+++ b/api/src/main/java/javax/faces/component/_AttachedCollectionStateWrapper.java
@@ -21,10 +21,10 @@ package javax.faces.component;
 import java.io.Serializable;
 import java.util.List;
 
-class _AttachedCollectionStateWrapper
-        implements Serializable
+class _AttachedCollectionStateWrapper implements Serializable
 {
     private static final long serialVersionUID = -3958718149793179776L;
+
     private Class<?> _class;
     private List<Object> _wrappedStateList;
 
diff --git a/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java b/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
index 3d660ae..ef01196 100755
--- a/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
+++ b/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
@@ -106,22 +106,7 @@ class _ComponentAttributesMap implements Map<String, Object>, Serializable
     {
         _component = component;
     }
-    
-    /**
-     * Create a map backed by the specified component. Attributes already
-     * associated with the component are provided in the specified Map
-     * class. A reference to the provided map is kept; this object's contents
-     * are updated during put calls on this instance.
-     * <p/>
-     * This method is expected to be called during the "restore view" phase.
-     */
-    //JSF 2.0 removed because _attributes has been replaced with StateHelper attributesMap
-    //_ComponentAttributesMap(UIComponent component, Map<String, Object> attributes)
-    //{
-    //    _component = component;
-        //_attributes = new HashMap<String, Object>(attributes);
-    //}
-    
+
     /**
      * Return the number of <i>attributes</i> in this map. Properties of the
      * underlying UIComponent are not counted.
diff --git a/api/src/main/java/javax/faces/component/_ComponentFacetMap.java b/api/src/main/java/javax/faces/component/_ComponentFacetMap.java
index 1b190b6..71992c1 100755
--- a/api/src/main/java/javax/faces/component/_ComponentFacetMap.java
+++ b/api/src/main/java/javax/faces/component/_ComponentFacetMap.java
@@ -140,16 +140,15 @@ class _ComponentFacetMap<V extends UIComponent> implements Map<String,
V>, Seria
     @Override
     public V put(String key, V value)
     {
-        //checkKey(key);
         if (key == null)
         {
             throw new NullPointerException("key");
         }
-        //checkValue(value);
         if (value == null)
         {
             throw new NullPointerException("value");
         }
+
         setNewParent(key, value);
         V previousValue = _map.put(key, value);
         if (previousValue != null)
diff --git a/api/src/main/java/javax/faces/component/_DeltaStateHelper.java b/api/src/main/java/javax/faces/component/_DeltaStateHelper.java
index 2b8281f..1e7a699 100644
--- a/api/src/main/java/javax/faces/component/_DeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/_DeltaStateHelper.java
@@ -184,7 +184,6 @@ class _DeltaStateHelper implements StateHelper, TransientStateHelper,
TransientS
         _transientState = null;
         _initialFullState = null;
         _copyFullInitialState = false;
-        //_stateHolderKeys = new HashSet<Serializable>();
     }
 
     /**
@@ -225,13 +224,6 @@ class _DeltaStateHelper implements StateHelper, TransientStateHelper,
TransientS
                         // to skip resetState() if the view cannot be recycled.
                         _initialFullState = new HashMap<Serializable, Object>();
                         copyMap(_component.getFacesContext(), _fullState, _initialFullState);
-                        /*
-                        for (int i = 0; i < _initialState.length; i+=2)
-                        {
-                            Serializable key2 = (Serializable) _initialState[i];
-                            Object defaultValue = _initialState[i+1];
-                            _initialFullState.put(key2, defaultValue);
-                        }*/
                     }
                 }
             }
@@ -250,8 +242,7 @@ class _DeltaStateHelper implements StateHelper, TransientStateHelper,
TransientS
         _copyFullInitialState = value;
     }
     
-    private static void copyMap(FacesContext context, 
-            Map<Serializable, Object> sourceMap, 
+    private static void copyMap(FacesContext context, Map<Serializable, Object> sourceMap,
             Map<Serializable, Object> targetMap)
     {
         Map serializableMap = sourceMap;
@@ -267,9 +258,9 @@ class _DeltaStateHelper implements StateHelper, TransientStateHelper,
TransientS
             // The condition in which the call to saveAttachedState
             // is to handle List, StateHolder or non Serializable instances.
             // we check it here, to prevent unnecessary calls.
-            if (value instanceof StateHolder ||
-                value instanceof List ||
-                !(value instanceof Serializable))
+            if (value instanceof StateHolder
+                    || value instanceof List
+                    || !(value instanceof Serializable))
             {
                 Object savedValue = UIComponentBase.saveAttachedState(context, value);
 
@@ -392,12 +383,6 @@ class _DeltaStateHelper implements StateHelper, TransientStateHelper,
TransientS
         }
         else
         {
-            /*
-            if (value instanceof StateHolder)
-            {
-                _stateHolderKeys.add(key);
-            }
-            */
             returnValue = _fullState.put(key, value);
         }
         return returnValue;
diff --git a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
index e7e6e76..ffc8986 100755
--- a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
@@ -1004,7 +1004,7 @@ public class NavigationHandlerImpl extends ConfigurableNavigationHandler
      * 
      * TODO: cache results?
      */
-    private NavigationCase getOutcomeNavigationCase (FacesContext facesContext, String fromAction,
String outcome)
+    private NavigationCase getOutcomeNavigationCase(FacesContext facesContext, String fromAction,
String outcome)
     {
         String implicitViewId = null;
         boolean includeViewParams = false;
@@ -1013,7 +1013,6 @@ public class NavigationHandlerImpl extends ConfigurableNavigationHandler
         String queryString = null;
         NavigationCase result = null;
         String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId()
: null;
-        //String viewIdToTest = outcome;
         StringBuilder viewIdToTest = SharedStringBuilder.get(facesContext, OUTCOME_NAVIGATION_SB);
         viewIdToTest.append(outcome);
         


Mime
View raw message