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: cosmetics
Date Sun, 06 Jan 2019 14:25:47 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 d12bcc1  cosmetics
d12bcc1 is described below

commit d12bcc19fa63b902aef2e0070c9ae6aa5061a903
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Sun Jan 6 15:26:05 2019 +0100

    cosmetics
---
 .../java/javax/faces/component/UIViewRoot.java     |   3 +-
 .../behavior/_AjaxBehaviorDeltaStateHelper.java    | 134 ++++++--------------
 .../javax/faces/component/behavior/_DeltaList.java |   3 +-
 .../component/behavior/_DeltaStateHelper.java      | 135 ++++++---------------
 .../faces/view/facelets/ComponentHandler.java      |   1 +
 .../view/facelets/tag/jsf/core/AjaxHandler.java    |  44 +++----
 .../view/facelets/tag/jsf/core/EventHandler.java   |   5 +-
 .../jsf/core/ResetValuesActionListenerHandler.java |  26 ++--
 .../facelets/tag/jsf/core/SelectItemHandler.java   |   7 +-
 .../jsf/core/SetPropertyActionListenerHandler.java |  10 +-
 .../tag/jsf/core/ValueChangeListenerHandler.java   |   7 +-
 11 files changed, 119 insertions(+), 256 deletions(-)

diff --git a/api/src/main/java/javax/faces/component/UIViewRoot.java b/api/src/main/java/javax/faces/component/UIViewRoot.java
index 95e5196..a47ec87 100644
--- a/api/src/main/java/javax/faces/component/UIViewRoot.java
+++ b/api/src/main/java/javax/faces/component/UIViewRoot.java
@@ -1461,8 +1461,7 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
      */
     public void resetValues(FacesContext context, java.util.Collection<java.lang.String>
clientIds)    
     {
-        VisitContext visitContext = (VisitContext) VisitContext.createVisitContext(
-            context, clientIds, null);
+        VisitContext visitContext = (VisitContext) VisitContext.createVisitContext(context,
clientIds, null);
         this.visitTree(visitContext, ResetValuesCallback.INSTANCE);
     }
 
diff --git a/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
b/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
index d2936aa..bacaab2 100644
--- a/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
@@ -95,17 +95,16 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         return _target.initialStateMarked();
     }
 
+    @Override
     public void add(Serializable key, Object value)
     {
         if (_createDeltas())
         {
             //Track delta case
-            Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>)
_deltas
-                    .get(key);
+            Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>)
_deltas.get(key);
             if (deltaListMapValues == null)
             {
-                deltaListMapValues = new InternalDeltaListMap<Object, Boolean>(
-                        3);
+                deltaListMapValues = new InternalDeltaListMap<Object, Boolean>(3);
                 _deltas.put(key, deltaListMapValues);
             }
             deltaListMapValues.put(value, Boolean.TRUE);
@@ -121,6 +120,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         fullListValues.add(value);
     }
 
+    @Override
     public Object eval(Serializable key)
     {
         Object returnValue = _fullState.get(key);
@@ -128,16 +128,15 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         {
             return returnValue;
         }
-        ValueExpression expression = _target.getValueExpression(key
-                .toString());
+        ValueExpression expression = _target.getValueExpression(key.toString());
         if (expression != null)
         {
-            return expression.getValue(FacesContext.getCurrentInstance()
-                    .getELContext());
+            return expression.getValue(FacesContext.getCurrentInstance().getELContext());
         }
         return null;
     }
 
+    @Override
     public Object eval(Serializable key, Object defaultValue)
     {
         Object returnValue = _fullState.get(key);
@@ -145,21 +144,21 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         {
             return returnValue;
         }
-        ValueExpression expression = _target.getValueExpression(key
-                .toString());
+        ValueExpression expression = _target.getValueExpression(key.toString());
         if (expression != null)
         {
-            return expression.getValue(FacesContext.getCurrentInstance()
-                    .getELContext());
+            return expression.getValue(FacesContext.getCurrentInstance().getELContext());
         }
         return defaultValue;
     }
 
+    @Override
     public Object get(Serializable key)
     {
         return _fullState.get(key);
     }
 
+    @Override
     public Object put(Serializable key, Object value)
     {
         Object returnValue = null;
@@ -178,17 +177,12 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         }
         else
         {
-            /*
-            if (value instanceof StateHolder)
-            {
-                _stateHolderKeys.add(key);
-            }
-            */
             returnValue = _fullState.put(key, value);
         }
         return returnValue;
     }
 
+    @Override
     public Object put(Serializable key, String mapKey, Object value)
     {
         boolean returnSet = false;
@@ -196,8 +190,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         if (_createDeltas())
         {
             //Track delta case
-            Map<String, Object> mapValues = (Map<String, Object>) _deltas
-                    .get(key);
+            Map<String, Object> mapValues = (Map<String, Object>) _deltas.get(key);
             if (mapValues == null)
             {
                 mapValues = new InternalMap<String, Object>();
@@ -215,8 +208,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         }
 
         //Handle change on full map
-        Map<String, Object> mapValues = (Map<String, Object>) _fullState
-                .get(key);
+        Map<String, Object> mapValues = (Map<String, Object>) _fullState.get(key);
         if (mapValues == null)
         {
             mapValues = new InternalMap<String, Object>();
@@ -233,6 +225,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         return returnValue;
     }
 
+    @Override
     public Object remove(Serializable key)
     {
         Object returnValue = null;
@@ -258,6 +251,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         return returnValue;
     }
 
+    @Override
     public Object remove(Serializable key, Object valueOrKey)
     {
         // Comment by lu4242 : The spec javadoc says if it is a Collection
@@ -272,36 +266,31 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         {
             if (_createDeltas())
             {
-                returnValue = _removeValueOrKeyFromMap(_deltas, key,
-                        valueOrKey, true);
+                returnValue = _removeValueOrKeyFromMap(_deltas, key, valueOrKey, true);
                 _removeValueOrKeyFromMap(_fullState, key, valueOrKey, false);
             }
             else
             {
-                returnValue = _removeValueOrKeyFromMap(_fullState, key,
-                        valueOrKey, false);
+                returnValue = _removeValueOrKeyFromMap(_fullState, key, valueOrKey, false);
             }
         }
         else if (collectionOrMap instanceof InternalList)
         {
             if (_createDeltas())
             {
-                returnValue = _removeValueOrKeyFromCollectionDelta(_deltas,
-                        key, valueOrKey);
+                returnValue = _removeValueOrKeyFromCollectionDelta(_deltas, key, valueOrKey);
                 _removeValueOrKeyFromCollection(_fullState, key, valueOrKey);
             }
             else
             {
-                returnValue = _removeValueOrKeyFromCollection(_fullState, key,
-                        valueOrKey);
+                returnValue = _removeValueOrKeyFromCollection(_fullState, key, valueOrKey);
             }
         }
         return returnValue;
     }
 
     private static Object _removeValueOrKeyFromCollectionDelta(
-            Map<Serializable, Object> stateMap, Serializable key,
-            Object valueOrKey)
+            Map<Serializable, Object> stateMap, Serializable key, Object valueOrKey)
     {
         Object returnValue = null;
         Map<Object, Boolean> c = (Map<Object, Boolean>) stateMap.get(key);
@@ -317,8 +306,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
     }
 
     private static Object _removeValueOrKeyFromCollection(
-            Map<Serializable, Object> stateMap, Serializable key,
-            Object valueOrKey)
+            Map<Serializable, Object> stateMap, Serializable key, Object valueOrKey)
     {
         Object returnValue = null;
         Collection c = (Collection) stateMap.get(key);
@@ -337,8 +325,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
     }
 
     private static Object _removeValueOrKeyFromMap(
-            Map<Serializable, Object> stateMap, Serializable key,
-            Object valueOrKey, boolean delta)
+            Map<Serializable, Object> stateMap, Serializable key, Object valueOrKey,
boolean delta)
     {
         if (valueOrKey == null)
         {
@@ -368,6 +355,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         return returnValue;
     }
 
+    @Override
     public boolean isTransient()
     {
         return _transient;
@@ -383,7 +371,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
      * <p/>
      * the internal Map again is then mapped to a map with key value pairs
      */
-
+    @Override
     public Object saveState(FacesContext context)
     {
         Map serializableMap = (isInitialStateMarked()) ? _deltas : _fullState;
@@ -393,24 +381,8 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
             return null;
         }
 
-        /*
-        int stateHolderKeyCount = 0;
-        if (isInitalStateMarked())
-        {
-            for (Iterator<Serializable> it = _stateHolderKeys.iterator(); it.hasNext();)
-            {
-                Serializable key = it.next();
-                if (!_deltas.containsKey(key))
-                {
-                    stateHolderKeyCount++;
-                }
-            }
-        }*/
-
         Map.Entry<Serializable, Object> entry;
-        //entry == key, value, key, value
         Object[] retArr = new Object[serializableMap.entrySet().size() * 2];
-        //Object[] retArr = new Object[serializableMap.entrySet().size() * 2 + stateHolderKeyCount];
 
         Iterator<Map.Entry<Serializable, Object>> it = serializableMap.entrySet().iterator();
         int cnt = 0;
@@ -428,8 +400,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
                     value instanceof List ||
                     !(value instanceof Serializable))
             {
-                Object savedValue = UIComponentBase.saveAttachedState(context,
-                        value);
+                Object savedValue = UIComponentBase.saveAttachedState(context, value);
                 retArr[cnt + 1] = savedValue;
             }
             else
@@ -439,43 +410,10 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
             cnt += 2;
         }
 
-        /*
-        if (isInitalStateMarked())
-        {
-            for (Iterator<Serializable> it2 = _stateHolderKeys.iterator(); it.hasNext();)
-            {
-                Serializable key = it2.next();
-                if (!_deltas.containsKey(key))
-                {
-                    retArr[cnt] = key;
-                    Object value = _fullState.get(key);
-                    if (value instanceof PartialStateHolder)
-                    {
-                        //Could contain delta, save it as _AttachedDeltaState
-                        PartialStateHolder holder = (PartialStateHolder) value;
-                        if (holder.isTransient())
-                        {
-                            retArr[cnt + 1] = null;
-                        }
-                        else
-                        {
-                            retArr[cnt + 1] = new _AttachedDeltaWrapper(value.getClass(),
holder.saveState(context));
-                        }
-                    }
-                    else
-                    {
-                        //Save everything
-                        retArr[cnt + 1] = UIComponentBase.saveAttachedState(context, _fullState.get(key));
-                    }
-                    cnt += 2;
-                }
-            }
-        }
-        */
         return retArr;
     }
 
-
+    @Override
     public void restoreState(FacesContext context, Object state)
     {
         if (state == null)
@@ -489,15 +427,13 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         {
             Serializable key = (Serializable) serializedState[cnt];
 
-            Object savedValue = UIComponentBase.restoreAttachedState(context,
-                    serializedState[cnt + 1]);
+            Object savedValue = UIComponentBase.restoreAttachedState(context, serializedState[cnt
+ 1]);
 
             if (isInitialStateMarked())
             {
                 if (savedValue instanceof InternalDeltaListMap)
                 {
-                    for (Map.Entry<Object, Boolean> mapEntry : ((Map<Object, Boolean>)
savedValue)
-                            .entrySet())
+                    for (Map.Entry<Object, Boolean> mapEntry : ((Map<Object, Boolean>)
savedValue).entrySet())
                     {
                         boolean addOrRemove = mapEntry.getValue();
                         if (addOrRemove)
@@ -542,6 +478,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
         }
     }
 
+    @Override
     public void setTransient(boolean transientValue)
     {
         _transient = transientValue;
@@ -571,26 +508,29 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
             super(initialSize);
         }
 
+        @Override
         public boolean isTransient()
         {
             return false;
         }
 
+        @Override
         public void setTransient(boolean newTransientValue)
         {
             // No op
         }
 
+        @Override
         public void restoreState(FacesContext context, Object state)
         {
             Object[] listAsMap = (Object[]) state;
             for (int cnt = 0; cnt < listAsMap.length; cnt += 2)
             {
-                this.put((K) listAsMap[cnt], (V) UIComponentBase
-                        .restoreAttachedState(context, listAsMap[cnt + 1]));
+                this.put((K) listAsMap[cnt], (V) UIComponentBase.restoreAttachedState(context,
listAsMap[cnt + 1]));
             }
         }
 
+        @Override
         public Object saveState(FacesContext context)
         {
             int cnt = 0;
@@ -660,15 +600,18 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
             super(initialSize);
         }
 
+        @Override
         public boolean isTransient()
         {
             return false;
         }
 
+        @Override
         public void setTransient(boolean newTransientValue)
         {
         }
 
+        @Override
         public void restoreState(FacesContext context, Object state)
         {
             Object[] listAsArr = (Object[]) state;
@@ -680,6 +623,7 @@ class _AjaxBehaviorDeltaStateHelper<A extends AjaxBehavior> implements
StateHelp
             }
         }
 
+        @Override
         public Object saveState(FacesContext context)
         {
             Object[] values = new Object[size()];
diff --git a/api/src/main/java/javax/faces/component/behavior/_DeltaList.java b/api/src/main/java/javax/faces/component/behavior/_DeltaList.java
index 6045fd7..700d47b 100644
--- a/api/src/main/java/javax/faces/component/behavior/_DeltaList.java
+++ b/api/src/main/java/javax/faces/component/behavior/_DeltaList.java
@@ -225,8 +225,7 @@ class _DeltaList<T> extends ArrayList<T> implements List<T>,
PartialStateHolder,
                             {
                                 nullDelta = false;
                             }
-                            lst[i] = new _AttachedDeltaWrapper(value.getClass(),
-                                attachedState);
+                            lst[i] = new _AttachedDeltaWrapper(value.getClass(), attachedState);
                         }
                     }
                     else
diff --git a/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java b/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
index 9ca9d1c..f4d148d 100644
--- a/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
@@ -190,6 +190,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         return _target.initialStateMarked();
     }
 
+    @Override
     public void add(Serializable key, Object value)
     {
         if (_createDeltas())
@@ -199,8 +200,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
                     .get(key);
             if (deltaListMapValues == null)
             {
-                deltaListMapValues = new InternalDeltaListMap<Object, Boolean>(
-                        3);
+                deltaListMapValues = new InternalDeltaListMap<Object, Boolean>(3);
                 _deltas.put(key, deltaListMapValues);
             }
             deltaListMapValues.put(value, Boolean.TRUE);
@@ -216,6 +216,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         fullListValues.add(value);
     }
 
+    @Override
     public Object eval(Serializable key)
     {
         Object returnValue = _fullState.get(key);
@@ -223,16 +224,15 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         {
             return returnValue;
         }
-        ValueExpression expression = _target.getValueExpression(key
-                .toString());
+        ValueExpression expression = _target.getValueExpression(key.toString());
         if (expression != null)
         {
-            return expression.getValue(_target.getFacesContext()
-                    .getELContext());
+            return expression.getValue(_target.getFacesContext().getELContext());
         }
         return null;
     }
 
+    @Override
     public Object eval(Serializable key, Object defaultValue)
     {
         Object returnValue = _fullState.get(key);
@@ -240,21 +240,21 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         {
             return returnValue;
         }
-        ValueExpression expression = _target.getValueExpression(key
-                .toString());
+        ValueExpression expression = _target.getValueExpression(key.toString());
         if (expression != null)
         {
-            return expression.getValue(_target.getFacesContext()
-                    .getELContext());
+            return expression.getValue(_target.getFacesContext().getELContext());
         }
         return defaultValue;
     }
 
+    @Override
     public Object get(Serializable key)
     {
         return _fullState.get(key);
     }
 
+    @Override
     public Object put(Serializable key, Object value)
     {
         Object returnValue = null;
@@ -277,12 +277,6 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         }
         else
         {
-            /*
-            if (value instanceof StateHolder)
-            {
-                _stateHolderKeys.add(key);
-            }
-            */
             returnValue = _fullState.put(key, value);
         }
         return returnValue;
@@ -295,8 +289,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         if (_createDeltas())
         {
             //Track delta case
-            Map<String, Object> mapValues = (Map<String, Object>) _deltas
-                    .get(key);
+            Map<String, Object> mapValues = (Map<String, Object>) _deltas.get(key);
             if (mapValues == null)
             {
                 mapValues = new InternalMap<String, Object>();
@@ -314,8 +307,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         }
 
         //Handle change on full map
-        Map<String, Object> mapValues = (Map<String, Object>) _fullState
-                .get(key);
+        Map<String, Object> mapValues = (Map<String, Object>) _fullState.get(key);
         if (mapValues == null)
         {
             mapValues = new InternalMap<String, Object>();
@@ -332,6 +324,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         return returnValue;
     }
 
+    @Override
     public Object remove(Serializable key)
     {
         Object returnValue = null;
@@ -357,6 +350,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         return returnValue;
     }
 
+    @Override
     public Object remove(Serializable key, Object valueOrKey)
     {
         // Comment by lu4242 : The spec javadoc says if it is a Collection 
@@ -371,36 +365,31 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         {
             if (_createDeltas())
             {
-                returnValue = _removeValueOrKeyFromMap(_deltas, key,
-                        valueOrKey, true);
+                returnValue = _removeValueOrKeyFromMap(_deltas, key, valueOrKey, true);
                 _removeValueOrKeyFromMap(_fullState, key, valueOrKey, false);
             }
             else
             {
-                returnValue = _removeValueOrKeyFromMap(_fullState, key,
-                        valueOrKey, false);
+                returnValue = _removeValueOrKeyFromMap(_fullState, key, valueOrKey, false);
             }
         }
         else if (collectionOrMap instanceof InternalList)
         {
             if (_createDeltas())
             {
-                returnValue = _removeValueOrKeyFromCollectionDelta(_deltas,
-                        key, valueOrKey);
+                returnValue = _removeValueOrKeyFromCollectionDelta(_deltas, key, valueOrKey);
                 _removeValueOrKeyFromCollection(_fullState, key, valueOrKey);
             }
             else
             {
-                returnValue = _removeValueOrKeyFromCollection(_fullState, key,
-                        valueOrKey);
+                returnValue = _removeValueOrKeyFromCollection(_fullState, key, valueOrKey);
             }
         }
         return returnValue;
     }
 
     private static Object _removeValueOrKeyFromCollectionDelta(
-            Map<Serializable, Object> stateMap, Serializable key,
-            Object valueOrKey)
+            Map<Serializable, Object> stateMap, Serializable key, Object valueOrKey)
     {
         Object returnValue = null;
         Map<Object, Boolean> c = (Map<Object, Boolean>) stateMap.get(key);
@@ -416,8 +405,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
     }
 
     private static Object _removeValueOrKeyFromCollection(
-            Map<Serializable, Object> stateMap, Serializable key,
-            Object valueOrKey)
+            Map<Serializable, Object> stateMap, Serializable key, Object valueOrKey)
     {
         Object returnValue = null;
         Collection c = (Collection) stateMap.get(key);
@@ -436,8 +424,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
     }
 
     private static Object _removeValueOrKeyFromMap(
-            Map<Serializable, Object> stateMap, Serializable key,
-            Object valueOrKey, boolean delta)
+            Map<Serializable, Object> stateMap, Serializable key, Object valueOrKey,
boolean delta)
     {
         if (valueOrKey == null)
         {
@@ -460,7 +447,6 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
 
             if (map.isEmpty())
             {
-                //stateMap.remove(key);
                 stateMap.put(key, null);
             }
         }
@@ -484,36 +470,19 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
      *
      *
      */
+    @Override
     public Object saveState(FacesContext context)
     {
         Map serializableMap = (isInitialStateMarked()) ? _deltas : _fullState;
-
         if (serializableMap == null || serializableMap.isEmpty())
         {
             return null;
         }
-        
-        /*
-        int stateHolderKeyCount = 0;
-        if (isInitalStateMarked())
-        {
-            for (Iterator<Serializable> it = _stateHolderKeys.iterator(); it.hasNext();)
-            {
-                Serializable key = it.next();
-                if (!_deltas.containsKey(key))
-                {
-                    stateHolderKeyCount++;
-                }
-            }
-        }*/
-        
+
         Map.Entry<Serializable, Object> entry;
-        //entry == key, value, key, value
         Object[] retArr = new Object[serializableMap.entrySet().size() * 2];
-        //Object[] retArr = new Object[serializableMap.entrySet().size() * 2 + stateHolderKeyCount];

 
-        Iterator<Map.Entry<Serializable, Object>> it = serializableMap
-                .entrySet().iterator();
+        Iterator<Map.Entry<Serializable, Object>> it = serializableMap.entrySet().iterator();
         int cnt = 0;
         while (it.hasNext())
         {
@@ -539,40 +508,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
             }
             cnt += 2;
         }
-        
-        /*
-        if (isInitalStateMarked())
-        {
-            for (Iterator<Serializable> it2 = _stateHolderKeys.iterator(); it.hasNext();)
-            {
-                Serializable key = it2.next();
-                if (!_deltas.containsKey(key))
-                {
-                    retArr[cnt] = key;
-                    Object value = _fullState.get(key);
-                    if (value instanceof PartialStateHolder)
-                    {
-                        //Could contain delta, save it as _AttachedDeltaState
-                        PartialStateHolder holder = (PartialStateHolder) value;
-                        if (holder.isTransient())
-                        {
-                            retArr[cnt + 1] = null;
-                        }
-                        else
-                        {
-                            retArr[cnt + 1] = new _AttachedDeltaWrapper(value.getClass(),
holder.saveState(context));
-                        }
-                    }
-                    else
-                    {
-                        //Save everything
-                        retArr[cnt + 1] = saveAttachedState(context, _fullState.get(key));
-                    }
-                    cnt += 2;
-                }
-            }
-        }
-        */       
+    
         return retArr;
     }
 
@@ -597,15 +533,13 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         for (int cnt = 0; cnt < serializedState.length; cnt += 2)
         {
             Serializable key = (Serializable) serializedState[cnt];
-            Object savedValue = restoreAttachedState(context,
-                    serializedState[cnt + 1]);
+            Object savedValue = restoreAttachedState(context, serializedState[cnt + 1]);
 
             if (isInitialStateMarked())
             {
                 if (savedValue instanceof InternalDeltaListMap)
                 {
-                    for (Map.Entry<Object, Boolean> mapEntry : ((Map<Object, Boolean>)
savedValue)
-                            .entrySet())
+                    for (Map.Entry<Object, Boolean> mapEntry : ((Map<Object, Boolean>)
savedValue).entrySet())
                     {
                         boolean addOrRemove = mapEntry.getValue();
                         if (addOrRemove)
@@ -622,8 +556,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
                 }
                 else if (savedValue instanceof InternalMap)
                 {
-                    for (Map.Entry<String, Object> mapEntry : ((Map<String, Object>)
savedValue)
-                            .entrySet())
+                    for (Map.Entry<String, Object> mapEntry : ((Map<String, Object>)
savedValue).entrySet())
                     {
                         this.put(key, mapEntry.getKey(), mapEntry.getValue());
                     }
@@ -650,6 +583,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
         }
     }
 
+    @Override
     public void setTransient(boolean transientValue)
     {
         _transient = transientValue;
@@ -679,26 +613,29 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
             super(initialSize);
         }
 
+        @Override
         public boolean isTransient()
         {
             return false;
         }
 
+        @Override
         public void setTransient(boolean newTransientValue)
         {
             // No op
         }
 
+        @Override
         public void restoreState(FacesContext context, Object state)
         {
             Object[] listAsMap = (Object[]) state;
             for (int cnt = 0; cnt < listAsMap.length; cnt += 2)
             {
-                this.put((K) listAsMap[cnt], (V) UIComponentBase
-                        .restoreAttachedState(context, listAsMap[cnt + 1]));
+                this.put((K) listAsMap[cnt], (V) UIComponentBase.restoreAttachedState(context,
listAsMap[cnt + 1]));
             }
         }
 
+        @Override
         public Object saveState(FacesContext context)
         {
             int cnt = 0;
@@ -768,15 +705,18 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
             super(initialSize);
         }
 
+        @Override
         public boolean isTransient()
         {
             return false;
         }
 
+        @Override
         public void setTransient(boolean newTransientValue)
         {
         }
 
+        @Override
         public void restoreState(FacesContext context, Object state)
         {
             Object[] listAsArr = (Object[]) state;
@@ -788,6 +728,7 @@ class _DeltaStateHelper <A extends AjaxBehavior> implements StateHelper
             }
         }
 
+        @Override
         public Object saveState(FacesContext context)
         {
             Object[] values = new Object[size()];
diff --git a/api/src/main/java/javax/faces/view/facelets/ComponentHandler.java b/api/src/main/java/javax/faces/view/facelets/ComponentHandler.java
index 85b5fac..1a12928 100644
--- a/api/src/main/java/javax/faces/view/facelets/ComponentHandler.java
+++ b/api/src/main/java/javax/faces/view/facelets/ComponentHandler.java
@@ -104,6 +104,7 @@ public class ComponentHandler extends DelegatingMetaTagHandler
         // no-op.
     }
 
+    @Override
     protected TagHandlerDelegate getTagHandlerDelegate()
     {
         if (helper == null)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
index 5e46391..62df5c9 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
@@ -259,8 +259,6 @@ public class AjaxHandler extends TagHandler implements
             outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
             outputScript.getAttributes().put(JSFAttr.TARGET_ATTR, "head");
 
-            //AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
-
             // Since this component will be relocated, we need a generated clientId from
the
             // viewRoot, so when this one is relocated, its parent will be this UIViewRoot
instance
             // and prevent a duplicate id exception.
@@ -319,8 +317,8 @@ public class AjaxHandler extends TagHandler implements
     public void applyAttachedObject(FacesContext context, UIComponent parent)
     {
         // Retrieve the current FaceletContext from FacesContext object
-        FaceletContext faceletContext = (FaceletContext) context
-                .getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
+        FaceletContext faceletContext = (FaceletContext) context.getAttributes()
+                .get(FaceletContext.FACELET_CONTEXT_KEY);
 
         // cast to a ClientBehaviorHolder
         ClientBehaviorHolder cvh = (ClientBehaviorHolder) parent;
@@ -403,26 +401,25 @@ public class AjaxHandler extends TagHandler implements
             }
             else
             {
-                ajaxBehavior.setValueExpression("disabled", _disabled
-                        .getValueExpression(faceletContext, Boolean.class));
+                ajaxBehavior.setValueExpression("disabled",
+                        _disabled.getValueExpression(faceletContext, Boolean.class));
             }
         }
         if (_execute != null)
         {
-            ajaxBehavior.setValueExpression("execute", _execute
-                    .getValueExpression(faceletContext, Object.class));
+            ajaxBehavior.setValueExpression("execute", 
+                    _execute.getValueExpression(faceletContext, Object.class));
         }
         if (_immediate != null)
         {
             if (_immediate.isLiteral())
             {
-                ajaxBehavior
-                        .setImmediate(_immediate.getBoolean(faceletContext));
+                ajaxBehavior.setImmediate(_immediate.getBoolean(faceletContext));
             }
             else
             {
-                ajaxBehavior.setValueExpression("immediate", _immediate
-                        .getValueExpression(faceletContext, Boolean.class));
+                ajaxBehavior.setValueExpression("immediate",
+                        _immediate.getValueExpression(faceletContext, Boolean.class));
             }
         }
         if (_listener != null)
@@ -440,8 +437,8 @@ public class AjaxHandler extends TagHandler implements
             }
             else
             {
-                ajaxBehavior.setValueExpression("onerror", _onerror
-                        .getValueExpression(faceletContext, String.class));
+                ajaxBehavior.setValueExpression("onerror",
+                        _onerror.getValueExpression(faceletContext, String.class));
             }
         }
         if (_onevent != null)
@@ -452,14 +449,14 @@ public class AjaxHandler extends TagHandler implements
             }
             else
             {
-                ajaxBehavior.setValueExpression("onevent", _onevent
-                        .getValueExpression(faceletContext, String.class));
+                ajaxBehavior.setValueExpression("onevent",
+                        _onevent.getValueExpression(faceletContext, String.class));
             }
         }
         if (_render != null)
         {
-            ajaxBehavior.setValueExpression("render", _render
-                    .getValueExpression(faceletContext, Object.class));
+            ajaxBehavior.setValueExpression("render",
+                    _render.getValueExpression(faceletContext, Object.class));
         }
         if (_delay != null)
         {
@@ -469,21 +466,20 @@ public class AjaxHandler extends TagHandler implements
             }
             else
             {
-                ajaxBehavior.setValueExpression("delay", _delay
-                    .getValueExpression(faceletContext, String.class));
+                ajaxBehavior.setValueExpression("delay",
+                        _delay.getValueExpression(faceletContext, String.class));
             }
         }
        if (_resetValues != null)
         {
             if (_resetValues.isLiteral())
             {
-                ajaxBehavior
-                        .setResetValues(_resetValues.getBoolean(faceletContext));
+                ajaxBehavior.setResetValues(_resetValues.getBoolean(faceletContext));
             }
             else
             {
-                ajaxBehavior.setValueExpression("resetValues", _resetValues
-                        .getValueExpression(faceletContext, Boolean.class));
+                ajaxBehavior.setValueExpression("resetValues",
+                        _resetValues.getValueExpression(faceletContext, Boolean.class));
             }
         }
         cvh.addClientBehavior(eventName, ajaxBehavior);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/EventHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/EventHandler.java
index 5fbee2b..108665f 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/EventHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/EventHandler.java
@@ -189,8 +189,8 @@ public final class EventHandler extends TagHandler
         }
         else
         {
-            value = (String) type.getValueExpression (context, String.class).
-                getValue (context.getFacesContext().getELContext());
+            value = (String) type.getValueExpression(context, String.class)
+                    .getValue(context.getFacesContext().getELContext());
         }
         
         Collection<Class<? extends ComponentSystemEvent>> events;
@@ -413,7 +413,6 @@ public final class EventHandler extends TagHandler
                 MethodExpression methodExpZeroArg,
                 UIComponent targetComponent)
         {
-            //_listener = listener;
             this.eventClass = eventClass;
             this.methodExpOneArg = methodExpOneArg;
             this.methodExpZeroArg = methodExpZeroArg;
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ResetValuesActionListenerHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ResetValuesActionListenerHandler.java
index 562d664..cd27639 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ResetValuesActionListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ResetValuesActionListenerHandler.java
@@ -161,17 +161,17 @@ public class ResetValuesActionListenerHandler extends TagHandler implements
Acti
         if (_render.isLiteral())
         {
             listener = new LiteralResetValuesActionListener(_clientIds,
-                topParentComponent != null ? 
-                (Location) topParentComponent.getAttributes().get(
-                    CompositeComponentELUtils.LOCATION_KEY) : null);
+                topParentComponent != null
+                        ? (Location) topParentComponent.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY)
+                        : null);
         }
         else
         {
-            listener = new ResetValuesActionListener(_render
-                .getValueExpression(faceletContext, Object.class) ,
-                topParentComponent != null ? 
-                (Location) topParentComponent.getAttributes().get(
-                    CompositeComponentELUtils.LOCATION_KEY) : null);
+            listener = new ResetValuesActionListener(
+                    _render.getValueExpression(faceletContext, Object.class),
+                    topParentComponent != null
+                            ? (Location) topParentComponent.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY)
+                            : null);
         }
         as.addActionListener(listener);
     }
@@ -181,15 +181,12 @@ public class ResetValuesActionListenerHandler extends TagHandler implements
Acti
     public String getFor()
     {
         TagAttribute forAttribute = getAttribute("for");
-        
         if (forAttribute == null)
         {
             return null;
         }
-        else
-        {
-            return forAttribute.getValue();
-        }
+
+        return forAttribute.getValue();
     }
     
     private final static class ResetValuesActionListener implements ActionListener, Serializable
@@ -340,8 +337,7 @@ public class ResetValuesActionListenerHandler extends TagHandler implements
Acti
         UIComponent target = contextComponent.findComponent(id);
         if (target == null)
         {
-            target = contextComponent.findComponent(
-                facesContext.getNamingContainerSeparatorChar() + id);
+            target = contextComponent.findComponent(facesContext.getNamingContainerSeparatorChar()
+ id);
         }
         if (target != null)
         {
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemHandler.java
index 70bf5c4..78423dc 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SelectItemHandler.java
@@ -26,7 +26,6 @@ import org.apache.myfaces.renderkit.html.util.JSFAttr;
 
 public class SelectItemHandler extends ComponentHandler
 {
-
     public SelectItemHandler(ComponentConfig config)
     {
         super(config);
@@ -35,11 +34,7 @@ public class SelectItemHandler extends ComponentHandler
     @Override
     protected MetaRuleset createMetaRuleset(Class type)
     {
-        return super.createMetaRuleset(type).alias("escapeItem",
-                JSFAttr.ITEM_ESCAPED_ATTR);
-        //return super.createMetaRuleset(type);
+        return super.createMetaRuleset(type).alias("escapeItem", JSFAttr.ITEM_ESCAPED_ATTR);
     }
-    
-    
 
 }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
index 2110853..d70737a 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
@@ -153,8 +153,7 @@ public class SetPropertyActionListenerHandler extends TagHandler
                         ContextAware contextAware = (ContextAware) _value;
                         location = contextAware.getLocation();
                     }
-                    throw new ContextAwareELException(location,
-                            _value.getExpressionString(), "value", e);
+                    throw new ContextAwareELException(location, _value.getExpressionString(),
"value", e);
                 }
             }
 
@@ -182,14 +181,11 @@ public class SetPropertyActionListenerHandler extends TagHandler
     public String getFor()
     {
         TagAttribute forAttribute = getAttribute("for");
-        
         if (forAttribute == null)
         {
             return null;
         }
-        else
-        {
-            return forAttribute.getValue();
-        }
+
+        return forAttribute.getValue();
     }
 }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
index cfc765f..b666cfa 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
@@ -196,15 +196,12 @@ public final class ValueChangeListenerHandler extends TagHandler
     public String getFor()
     {
         TagAttribute forAttribute = getAttribute("for");
-        
         if (forAttribute == null)
         {
             return null;
         }
-        else
-        {
-            return forAttribute.getValue();
-        }
+
+        return forAttribute.getValue();
     }
 
 }


Mime
View raw message