myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1768832 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/ tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/to...
Date Wed, 09 Nov 2016 06:26:37 GMT
Author: lofwyr
Date: Wed Nov  9 06:26:37 2016
New Revision: 1768832

URL: http://svn.apache.org/viewvc?rev=1768832&view=rev
Log:
checkstyle

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/EventHandler.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedListStateWrapper.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedStateWrapper.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/RowRenderer.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/EventHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/EventHandler.java?rev=1768832&r1=1768831&r2=1768832&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/EventHandler.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/EventHandler.java Wed Nov  9 06:26:37 2016
@@ -68,20 +68,19 @@ import java.util.Map;
  * to define a target for a behavior. See comment inside apply() method.</li>
  * </ul>
  *
- * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
- * @version $Revision: 1177714 $ $Date: 2011-09-30 15:51:51 +0000 (Fri, 30 Sep 2011) $
+ * @since 3.0.0
  */
 public class EventHandler extends TobagoComponentHandler implements BehaviorHolderAttachedObjectHandler {
 
-  public final static Class<?>[] AJAX_BEHAVIOR_LISTENER_SIG = new Class<?>[]{AjaxBehaviorEvent.class};
+  public static final Class<?>[] AJAX_BEHAVIOR_LISTENER_SIG = new Class<?>[]{AjaxBehaviorEvent.class};
 
-  private final TagAttribute _event;
+  private final TagAttribute event;
 
 // todo (see original AjaxHandler impl)  private final boolean _wrapMode;
 
   public EventHandler(ComponentConfig config) {
     super(config);
-    _event = getAttribute(Attributes.event.getName());
+    event = getAttribute(Attributes.event.getName());
   }
 
   public void apply(FaceletContext ctx, UIComponent parent)
@@ -119,10 +118,10 @@ public class EventHandler extends Tobago
    * if the the target to be processed is applicable for this handler
    */
   public String getEventName() {
-    if (_event == null) {
+    if (event == null) {
       return null;
     } else {
-      return _event.getValue();
+      return event.getValue();
     }
   }
 
@@ -146,10 +145,10 @@ public class EventHandler extends Tobago
     if (eventName == null) {
       eventName = cvh.getDefaultEventName();
       if (eventName == null) {
-        throw new TagAttributeException(_event, "eventName could not be defined for f:ajax tag with no wrap mode.");
+        throw new TagAttributeException(event, "eventName could not be defined for f:ajax tag with no wrap mode.");
       }
     } else if (!cvh.getEventNames().contains(eventName)) {
-      throw new TagAttributeException(_event, "event it is not a valid eventName defined for this component");
+      throw new TagAttributeException(event, "event it is not a valid eventName defined for this component");
     }
 
     Map<String, List<ClientBehavior>> clientBehaviors = cvh.getClientBehaviors();
@@ -199,57 +198,57 @@ public class EventHandler extends Tobago
   /**
    * Wraps a method expression in a AjaxBehaviorListener
    */
-  public final static class AjaxBehaviorListenerImpl implements
+  public static final class AjaxBehaviorListenerImpl implements
       AjaxBehaviorListener, PartialStateHolder {
-    private MethodExpression _expr;
-    private boolean _transient;
-    private boolean _initialStateMarked;
+    private MethodExpression expression;
+    private boolean transientBoolean;
+    private boolean initialStateMarked;
 
     public AjaxBehaviorListenerImpl() {
     }
 
     public AjaxBehaviorListenerImpl(MethodExpression expr) {
-      _expr = expr;
+      expression = expr;
     }
 
     public void processAjaxBehavior(AjaxBehaviorEvent event)
         throws AbortProcessingException {
-      _expr.invoke(FacesContext.getCurrentInstance().getELContext(),
+      expression.invoke(FacesContext.getCurrentInstance().getELContext(),
           new Object[]{event});
     }
 
     public boolean isTransient() {
-      return _transient;
+      return transientBoolean;
     }
 
     public void restoreState(FacesContext context, Object state) {
       if (state == null) {
         return;
       }
-      _expr = (MethodExpression) state;
+      expression = (MethodExpression) state;
     }
 
     public Object saveState(FacesContext context) {
       if (initialStateMarked()) {
         return null;
       }
-      return _expr;
+      return expression;
     }
 
     public void setTransient(boolean newTransientValue) {
-      _transient = newTransientValue;
+      transientBoolean = newTransientValue;
     }
 
     public void clearInitialState() {
-      _initialStateMarked = false;
+      initialStateMarked = false;
     }
 
     public boolean initialStateMarked() {
-      return _initialStateMarked;
+      return initialStateMarked;
     }
 
     public void markInitialState() {
-      _initialStateMarked = true;
+      initialStateMarked = true;
     }
   }
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedListStateWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedListStateWrapper.java?rev=1768832&r1=1768831&r2=1768832&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedListStateWrapper.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedListStateWrapper.java Wed Nov  9 06:26:37 2016
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.myfaces.tobago.internal.behavior;
 
 import java.io.Serializable;
@@ -5,19 +24,20 @@ import java.util.List;
 
 // todo: clean up (is a copy of MyFaces, but not all stuff is refactored)
 
-class AttachedListStateWrapper
-    implements Serializable
-{
+/**
+ * @since 3.0.0
+ */
+class AttachedListStateWrapper implements Serializable {
+
   private static final long serialVersionUID = -3958718149793179776L;
-  private List<Object> _wrappedStateList;
 
-  public AttachedListStateWrapper(List<Object> wrappedStateList)
-  {
-    _wrappedStateList = wrappedStateList;
+  private List<Object> wrappedStateList;
+
+  public AttachedListStateWrapper(List<Object> wrappedStateList) {
+    this.wrappedStateList = wrappedStateList;
   }
 
-  public List<Object> getWrappedStateList()
-  {
-    return _wrappedStateList;
+  public List<Object> getWrappedStateList() {
+    return wrappedStateList;
   }
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedStateWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedStateWrapper.java?rev=1768832&r1=1768831&r2=1768832&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedStateWrapper.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/AttachedStateWrapper.java Wed Nov  9 06:26:37 2016
@@ -1,38 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.myfaces.tobago.internal.behavior;
 
 import java.io.Serializable;
 
 // todo: clean up (is a copy of MyFaces, but not all stuff is refactored)
 
-class AttachedStateWrapper implements Serializable
-{
+class AttachedStateWrapper implements Serializable {
+
   private static final long serialVersionUID = 4948301780259917764L;
-  private Class<?> _class;
-  private Object _wrappedStateObject;
+
+  private Class<?> clazz;
+  private Object wrappedStateObject;
 
   /**
-   * @param clazz
-   *            null means wrappedStateObject is a List of state objects
-   * @param wrappedStateObject
+   * @param clazz              null means wrappedStateObject is a List of state objects
    */
-  public AttachedStateWrapper(Class<?> clazz, Object wrappedStateObject)
-  {
-    if (wrappedStateObject != null && !(wrappedStateObject instanceof Serializable))
-    {
+  public AttachedStateWrapper(Class<?> clazz, Object wrappedStateObject) {
+    if (wrappedStateObject != null && !(wrappedStateObject instanceof Serializable)) {
       throw new IllegalArgumentException("Attached state for Object of type " + clazz + " (Class "
           + wrappedStateObject.getClass().getName() + ") is not serializable");
     }
-    _class = clazz;
-    _wrappedStateObject = wrappedStateObject;
+    this.clazz = clazz;
+    this.wrappedStateObject = wrappedStateObject;
   }
 
-  public Class<?> getClazz()
-  {
-    return _class;
+  public Class<?> getClazz() {
+    return clazz;
   }
 
-  public Object getWrappedStateObject()
-  {
-    return _wrappedStateObject;
+  public Object getWrappedStateObject() {
+    return wrappedStateObject;
   }
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java?rev=1768832&r1=1768831&r2=1768832&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java Wed Nov  9 06:26:37 2016
@@ -76,59 +76,59 @@ import java.util.Map;
  * First request:
  * </p>
  * <ul>
- *   <li> A new template is created (using
- *   javax.faces.view.ViewDeclarationLanguage.buildView method)
- *   and component.markInitialState is called from its related TagHandler classes
- *  (see javax.faces.view.facelets.ComponentHandler ).
- *   When this method is executed, the component tree was populated from the values
- *   set in the facelet abstract syntax tree (or in other words composition of
- *   facelets templates). </li>
- *   <li> From this point all updates on the variables are considered "delta". </li>
- *   <li> SaveState, if initialStateMarked is true, only delta is saved. </li>
+ * <li> A new template is created (using
+ * javax.faces.view.ViewDeclarationLanguage.buildView method)
+ * and component.markInitialState is called from its related TagHandler classes
+ * (see javax.faces.view.facelets.ComponentHandler ).
+ * When this method is executed, the component tree was populated from the values
+ * set in the facelet abstract syntax tree (or in other words composition of
+ * facelets templates). </li>
+ * <li> From this point all updates on the variables are considered "delta". </li>
+ * <li> SaveState, if initialStateMarked is true, only delta is saved. </li>
  * </ul>
  * <p>
  * Second request (and next ones)
  * </p>
  * <ul>
- *   <li> A new template is created and component.markInitialState is called from
- *   its related TagHandler classes again. In this way, components like c:forEach
- *   or c:if, that add or remove components could notify about this and handle
- *   them properly (see javax.faces.view.StateManagementStrategy). Note that a
- *   component restored using this method is no different as the same component
- *   at the first request at the same time. </li>
- *   <li> A call for restoreState is done, passing the delta as object value. If no
- *   delta, the state is complete and no call is triggered. </li>
- *   <li> Lifecycle occur, changing the necessary stuff. </li>
- *   <li> SaveState, if initialStateMarked is true, only delta is saved. </li>
+ * <li> A new template is created and component.markInitialState is called from
+ * its related TagHandler classes again. In this way, components like c:forEach
+ * or c:if, that add or remove components could notify about this and handle
+ * them properly (see javax.faces.view.StateManagementStrategy). Note that a
+ * component restored using this method is no different as the same component
+ * at the first request at the same time. </li>
+ * <li> A call for restoreState is done, passing the delta as object value. If no
+ * delta, the state is complete and no call is triggered. </li>
+ * <li> Lifecycle occur, changing the necessary stuff. </li>
+ * <li> SaveState, if initialStateMarked is true, only delta is saved. </li>
  * </ul>
  * <p>
  * From the previous analysis, the following conclusions arise:
  * <ul>
- *   <li>This class only needs to keep track of delta changes, so when
- *   restoreState/saveState is called, the right objects are passed.</li>
- *   <li>UIComponent.clearInitialState is used to reset the partial
- *   state holder to a non delta state, so the state to be saved by
- *   saveState is no longer a delta instead is a full state. If a call
- *   to clearInitialState occur it is not expected a call for
- *   UIComponent.markInitialState occur on the current request.</li>
- *   <li>The state is handled in the same way on UIData, so components
- *   inside UIData share its state on all rows. There is no way to save
- *   delta per row.</li>
- *   <li>The map backed by method put(Serializable,String,Object) is
- *   a replacement of UIComponentBase.attributesMap and UIComponent.bindings map.
- *   Note that on jsf 1.2, instances saved on attributesMap should not be
- *   StateHolder, but on jsf 2.0 it is possible to have it. PartialStateHolder
- *   instances are not handled in this map, or in other words delta state is not
- *   handled in this classes (markInitialState and clearInitialState is not propagated).</li>
- *   <li>The list backed by method add(Serializable,Object) should be (is not) a
- *   replacement of UIComponentBase.facesListeners, but note that StateHelper
- *   does not implement PartialStateHolder, and facesListener could have instances
- *   of that class that needs to be notified when UIComponent.markInitialState or
- *   UIComponent.clearInitialState is called, or in other words facesListeners
- *   should deal with PartialStateHolder instances.</li>
- *   <li>The list backed by method add(Serializable,Object) is
- *   a replacement of UIViewRoot.phaseListeners list. Note that instances of
- *   PhaseListener are not expected to implement StateHolder or PartialStateHolder.</li>
+ * <li>This class only needs to keep track of delta changes, so when
+ * restoreState/saveState is called, the right objects are passed.</li>
+ * <li>UIComponent.clearInitialState is used to reset the partial
+ * state holder to a non delta state, so the state to be saved by
+ * saveState is no longer a delta instead is a full state. If a call
+ * to clearInitialState occur it is not expected a call for
+ * UIComponent.markInitialState occur on the current request.</li>
+ * <li>The state is handled in the same way on UIData, so components
+ * inside UIData share its state on all rows. There is no way to save
+ * delta per row.</li>
+ * <li>The map backed by method put(Serializable,String,Object) is
+ * a replacement of UIComponentBase.attributesMap and UIComponent.bindings map.
+ * Note that on jsf 1.2, instances saved on attributesMap should not be
+ * StateHolder, but on jsf 2.0 it is possible to have it. PartialStateHolder
+ * instances are not handled in this map, or in other words delta state is not
+ * handled in this classes (markInitialState and clearInitialState is not propagated).</li>
+ * <li>The list backed by method add(Serializable,Object) should be (is not) a
+ * replacement of UIComponentBase.facesListeners, but note that StateHelper
+ * does not implement PartialStateHolder, and facesListener could have instances
+ * of that class that needs to be notified when UIComponent.markInitialState or
+ * UIComponent.clearInitialState is called, or in other words facesListeners
+ * should deal with PartialStateHolder instances.</li>
+ * <li>The list backed by method add(Serializable,Object) is
+ * a replacement of UIViewRoot.phaseListeners list. Note that instances of
+ * PhaseListener are not expected to implement StateHolder or PartialStateHolder.</li>
  * </ul>
  * </p>
  * <p>
@@ -139,33 +139,30 @@ import java.util.Map;
  * is provided. Note than stateHolder aware properties like converter,
  * validator or listeners should deal with StateHolder or PartialStateHolder
  * on component classes.
- *
+ * <p>
  * </p>
  *
- * @author Werner Punz
- * @author Leonardo Uribe (latest modification by $Author: bommel $)
- * @version $Rev: 1187700 $ $Date: 2011-10-22 12:19:37 +0000 (Sat, 22 Oct 2011) $
+ * @since 3.0.0
  */
-class DeltaStateHelper<A extends EventBehavior> implements StateHelper
-{
+class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
 
   /**
    * We need to hold a component instance because:
-   *
+   * <p>
    * - The component is the one who knows if we are on initial or delta mode
    * - eval assume calls to component.ValueExpression
    */
-  private A _target;
+  private A target;
 
   /**
    * This map holds the full current state
    */
-  private Map<Serializable, Object> _fullState;
+  private Map<Serializable, Object> fullState;
 
   /**
    * This map only keep track of delta changes to be saved
    */
-  private Map<Serializable, Object> _deltas;
+  private Map<Serializable, Object> deltas;
 
   /**
    * This map keep track of StateHolder keys, to be saved when
@@ -173,14 +170,13 @@ class DeltaStateHelper<A extends EventBe
    */
   //private Set<Serializable> _stateHolderKeys;
 
-  private boolean _transient = false;
+  private boolean transientBoolean = false;
 
-  public DeltaStateHelper(A target)
-  {
+  public DeltaStateHelper(A target) {
     super();
-    this._target = target;
-    _fullState = new HashMap<Serializable, Object>();
-    _deltas = null;
+    this.target = target;
+    fullState = new HashMap<Serializable, Object>();
+    deltas = null;
     //_stateHolderKeys = new HashSet<Serializable>();
   }
 
@@ -189,13 +185,10 @@ class DeltaStateHelper<A extends EventBe
    *
    * @return
    */
-  private boolean _createDeltas()
-  {
-    if (isInitialStateMarked())
-    {
-      if (_deltas == null)
-      {
-        _deltas = new HashMap<Serializable, Object>(2);
+  private boolean createDeltas() {
+    if (isInitialStateMarked()) {
+      if (deltas == null) {
+        deltas = new HashMap<Serializable, Object>(2);
       }
       return true;
     }
@@ -203,229 +196,178 @@ class DeltaStateHelper<A extends EventBe
     return false;
   }
 
-  protected boolean isInitialStateMarked()
-  {
-    return _target.initialStateMarked();
+  protected boolean isInitialStateMarked() {
+    return target.initialStateMarked();
   }
 
-  public void add(Serializable key, Object value)
-  {
-    if (_createDeltas())
-    {
+  public void add(Serializable key, Object value) {
+    if (createDeltas()) {
       //Track delta case
-      Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>) _deltas
+      Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>) deltas
           .get(key);
-      if (deltaListMapValues == null)
-      {
+      if (deltaListMapValues == null) {
         deltaListMapValues = new DeltaStateHelper.InternalDeltaListMap<Object, Boolean>(
             3);
-        _deltas.put(key, deltaListMapValues);
+        deltas.put(key, deltaListMapValues);
       }
       deltaListMapValues.put(value, Boolean.TRUE);
     }
 
     //Handle change on full map
-    List<Object> fullListValues = (List<Object>) _fullState.get(key);
-    if (fullListValues == null)
-    {
+    List<Object> fullListValues = (List<Object>) fullState.get(key);
+    if (fullListValues == null) {
       fullListValues = new DeltaStateHelper.InternalList<Object>(3);
-      _fullState.put(key, fullListValues);
+      fullState.put(key, fullListValues);
     }
     fullListValues.add(value);
   }
 
-  public Object eval(Serializable key)
-  {
-    Object returnValue = _fullState.get(key);
-    if (returnValue != null)
-    {
+  public Object eval(Serializable key) {
+    Object returnValue = fullState.get(key);
+    if (returnValue != null) {
       return returnValue;
     }
-    ValueExpression expression = _target.getValueExpression(key
+    ValueExpression expression = target.getValueExpression(key
         .toString());
-    if (expression != null)
-    {
+    if (expression != null) {
       return expression.getValue(FacesContext.getCurrentInstance()
           .getELContext());
     }
     return null;
   }
 
-  public Object eval(Serializable key, Object defaultValue)
-  {
-    Object returnValue = _fullState.get(key);
-    if (returnValue != null)
-    {
+  public Object eval(Serializable key, Object defaultValue) {
+    Object returnValue = fullState.get(key);
+    if (returnValue != null) {
       return returnValue;
     }
-    ValueExpression expression = _target.getValueExpression(key
+    ValueExpression expression = target.getValueExpression(key
         .toString());
-    if (expression != null)
-    {
+    if (expression != null) {
       return expression.getValue(FacesContext.getCurrentInstance()
           .getELContext());
     }
     return defaultValue;
   }
 
-  public Object get(Serializable key)
-  {
-    return _fullState.get(key);
+  public Object get(Serializable key) {
+    return fullState.get(key);
   }
 
-  public Object put(Serializable key, Object value)
-  {
+  public Object put(Serializable key, Object value) {
     Object returnValue = null;
-    if (_createDeltas())
-    {
-      if (_deltas.containsKey(key))
-      {
-        returnValue = _deltas.put(key, value);
-        _fullState.put(key, value);
-      }
-      else if (value == null && !_fullState.containsKey(key))
-      {
+    if (createDeltas()) {
+      if (deltas.containsKey(key)) {
+        returnValue = deltas.put(key, value);
+        fullState.put(key, value);
+      } else if (value == null && !fullState.containsKey(key)) {
         returnValue = null;
+      } else {
+        deltas.put(key, value);
+        returnValue = fullState.put(key, value);
       }
-      else
-      {
-        _deltas.put(key, value);
-        returnValue = _fullState.put(key, value);
-      }
-    }
-    else
-    {
+    } else {
             /*
             if (value instanceof StateHolder)
             {
                 _stateHolderKeys.add(key);
             }
             */
-      returnValue = _fullState.put(key, value);
+      returnValue = fullState.put(key, value);
     }
     return returnValue;
   }
 
-  public Object put(Serializable key, String mapKey, Object value)
-  {
+  public Object put(Serializable key, String mapKey, Object value) {
     boolean returnSet = false;
     Object returnValue = null;
-    if (_createDeltas())
-    {
+    if (createDeltas()) {
       //Track delta case
-      Map<String, Object> mapValues = (Map<String, Object>) _deltas
+      Map<String, Object> mapValues = (Map<String, Object>) deltas
           .get(key);
-      if (mapValues == null)
-      {
+      if (mapValues == null) {
         mapValues = new DeltaStateHelper.InternalMap<String, Object>();
-        _deltas.put(key, mapValues);
+        deltas.put(key, mapValues);
       }
-      if (mapValues.containsKey(mapKey))
-      {
+      if (mapValues.containsKey(mapKey)) {
         returnValue = mapValues.put(mapKey, value);
         returnSet = true;
-      }
-      else
-      {
+      } else {
         mapValues.put(mapKey, value);
       }
     }
 
     //Handle change on full map
-    Map<String, Object> mapValues = (Map<String, Object>) _fullState
+    Map<String, Object> mapValues = (Map<String, Object>) fullState
         .get(key);
-    if (mapValues == null)
-    {
+    if (mapValues == null) {
       mapValues = new DeltaStateHelper.InternalMap<String, Object>();
-      _fullState.put(key, mapValues);
+      fullState.put(key, mapValues);
     }
-    if (returnSet)
-    {
+    if (returnSet) {
       mapValues.put(mapKey, value);
-    }
-    else
-    {
+    } else {
       returnValue = mapValues.put(mapKey, value);
     }
     return returnValue;
   }
 
-  public Object remove(Serializable key)
-  {
+  public Object remove(Serializable key) {
     Object returnValue = null;
-    if (_createDeltas())
-    {
-      if (_deltas.containsKey(key))
-      {
+    if (createDeltas()) {
+      if (deltas.containsKey(key)) {
         // Keep track of the removed values using key/null pair on the delta map
-        returnValue = _deltas.put(key, null);
-        _fullState.remove(key);
-      }
-      else
-      {
+        returnValue = deltas.put(key, null);
+        fullState.remove(key);
+      } else {
         // Keep track of the removed values using key/null pair on the delta map
-        _deltas.put(key, null);
-        returnValue = _fullState.remove(key);
+        deltas.put(key, null);
+        returnValue = fullState.remove(key);
       }
-    }
-    else
-    {
-      returnValue = _fullState.remove(key);
+    } else {
+      returnValue = fullState.remove(key);
     }
     return returnValue;
   }
 
-  public Object remove(Serializable key, Object valueOrKey)
-  {
+  public Object remove(Serializable key, Object valueOrKey) {
     // Comment by lu4242 : The spec javadoc says if it is a Collection
     // or Map deal with it. But the intention of this method is work
     // with add(?,?) and put(?,?,?), this ones return instances of
     // InternalMap and InternalList to prevent mixing, so to be
     // consistent we'll cast to those classes here.
 
-    Object collectionOrMap = _fullState.get(key);
+    Object collectionOrMap = fullState.get(key);
     Object returnValue = null;
-    if (collectionOrMap instanceof DeltaStateHelper.InternalMap)
-    {
-      if (_createDeltas())
-      {
-        returnValue = _removeValueOrKeyFromMap(_deltas, key,
+    if (collectionOrMap instanceof DeltaStateHelper.InternalMap) {
+      if (createDeltas()) {
+        returnValue = removeValueOrKeyFromMap(deltas, key,
             valueOrKey, true);
-        _removeValueOrKeyFromMap(_fullState, key, valueOrKey, false);
-      }
-      else
-      {
-        returnValue = _removeValueOrKeyFromMap(_fullState, key,
+        removeValueOrKeyFromMap(fullState, key, valueOrKey, false);
+      } else {
+        returnValue = removeValueOrKeyFromMap(fullState, key,
             valueOrKey, false);
       }
-    }
-    else if (collectionOrMap instanceof DeltaStateHelper.InternalList)
-    {
-      if (_createDeltas())
-      {
-        returnValue = _removeValueOrKeyFromCollectionDelta(_deltas,
+    } else if (collectionOrMap instanceof DeltaStateHelper.InternalList) {
+      if (createDeltas()) {
+        returnValue = removeValueOrKeyFromCollectionDelta(deltas,
             key, valueOrKey);
-        _removeValueOrKeyFromCollection(_fullState, key, valueOrKey);
-      }
-      else
-      {
-        returnValue = _removeValueOrKeyFromCollection(_fullState, key,
+        removeValueOrKeyFromCollection(fullState, key, valueOrKey);
+      } else {
+        returnValue = removeValueOrKeyFromCollection(fullState, key,
             valueOrKey);
       }
     }
     return returnValue;
   }
 
-  private static Object _removeValueOrKeyFromCollectionDelta(
+  private static Object removeValueOrKeyFromCollectionDelta(
       Map<Serializable, Object> stateMap, Serializable key,
-      Object valueOrKey)
-  {
+      Object valueOrKey) {
     Object returnValue = null;
     Map<Object, Boolean> c = (Map<Object, Boolean>) stateMap.get(key);
-    if (c != null)
-    {
-      if (c.containsKey(valueOrKey))
-      {
+    if (c != null) {
+      if (c.containsKey(valueOrKey)) {
         returnValue = valueOrKey;
       }
       c.put(valueOrKey, Boolean.FALSE);
@@ -433,51 +375,40 @@ class DeltaStateHelper<A extends EventBe
     return returnValue;
   }
 
-  private static Object _removeValueOrKeyFromCollection(
+  private static Object removeValueOrKeyFromCollection(
       Map<Serializable, Object> stateMap, Serializable key,
-      Object valueOrKey)
-  {
+      Object valueOrKey) {
     Object returnValue = null;
     Collection c = (Collection) stateMap.get(key);
-    if (c != null)
-    {
-      if (c.remove(valueOrKey))
-      {
+    if (c != null) {
+      if (c.remove(valueOrKey)) {
         returnValue = valueOrKey;
       }
-      if (c.isEmpty())
-      {
+      if (c.isEmpty()) {
         stateMap.remove(key);
       }
     }
     return returnValue;
   }
 
-  private static Object _removeValueOrKeyFromMap(
+  private static Object removeValueOrKeyFromMap(
       Map<Serializable, Object> stateMap, Serializable key,
-      Object valueOrKey, boolean delta)
-  {
-    if (valueOrKey == null)
-    {
+      Object valueOrKey, boolean delta) {
+    if (valueOrKey == null) {
       return null;
     }
 
     Object returnValue = null;
     Map<String, Object> map = (Map<String, Object>) stateMap.get(key);
-    if (map != null)
-    {
-      if (delta)
-      {
+    if (map != null) {
+      if (delta) {
         // Keep track of the removed values using key/null pair on the delta map
         returnValue = map.put((String) valueOrKey, null);
-      }
-      else
-      {
+      } else {
         returnValue = map.remove(valueOrKey);
       }
 
-      if (map.isEmpty())
-      {
+      if (map.isEmpty()) {
         //stateMap.remove(key);
         stateMap.put(key, null);
       }
@@ -485,9 +416,8 @@ class DeltaStateHelper<A extends EventBe
     return returnValue;
   }
 
-  public boolean isTransient()
-  {
-    return _transient;
+  public boolean isTransient() {
+    return transientBoolean;
   }
 
   /**
@@ -495,19 +425,15 @@ class DeltaStateHelper<A extends EventBe
    * the serialized data structure consists of key value pairs unless the value itself is an internal array
    * or a map in case of an internal array or map the value itself is another array with its initial value
    * myfaces.InternalArray, myfaces.internalMap
-   *
+   * <p>
    * the internal Array is then mapped to another array
-   *
+   * <p>
    * the internal Map again is then mapped to a map with key value pairs
-   *
-   *
    */
-  public Object saveState(FacesContext context)
-  {
-    Map serializableMap = (isInitialStateMarked()) ? _deltas : _fullState;
+  public Object saveState(FacesContext context) {
+    Map serializableMap = (isInitialStateMarked()) ? deltas : fullState;
 
-    if (serializableMap == null || serializableMap.size() == 0)
-    {
+    if (serializableMap == null || serializableMap.size() == 0) {
       return null;
     }
 
@@ -518,7 +444,7 @@ class DeltaStateHelper<A extends EventBe
             for (Iterator<Serializable> it = _stateHolderKeys.iterator(); it.hasNext();)
             {
                 Serializable key = it.next();
-                if (!_deltas.containsKey(key))
+                if (!deltas.containsKey(key))
                 {
                     stateHolderKeyCount++;
                 }
@@ -530,11 +456,9 @@ class DeltaStateHelper<A extends EventBe
     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())
-    {
+    while (it.hasNext()) {
       entry = it.next();
       retArr[cnt] = entry.getKey();
 
@@ -543,16 +467,10 @@ class DeltaStateHelper<A extends EventBe
       // 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))
-      {
-        Object savedValue = saveAttachedState(context,
-            value);
+      if (value instanceof StateHolder || value instanceof List || !(value instanceof Serializable)) {
+        Object savedValue = saveAttachedState(context, value);
         retArr[cnt + 1] = savedValue;
-      }
-      else
-      {
+      } else {
         retArr[cnt + 1] = value;
       }
       cnt += 2;
@@ -564,10 +482,10 @@ class DeltaStateHelper<A extends EventBe
             for (Iterator<Serializable> it2 = _stateHolderKeys.iterator(); it.hasNext();)
             {
                 Serializable key = it2.next();
-                if (!_deltas.containsKey(key))
+                if (!deltas.containsKey(key))
                 {
                     retArr[cnt] = key;
-                    Object value = _fullState.get(key);
+                    Object value = fullState.get(key);
                     if (value instanceof PartialStateHolder)
                     {
                         //Could contain delta, save it as _AttachedDeltaState
@@ -584,7 +502,7 @@ class DeltaStateHelper<A extends EventBe
                     else
                     {
                         //Save everything
-                        retArr[cnt + 1] = saveAttachedState(context, _fullState.get(key));
+                        retArr[cnt + 1] = saveAttachedState(context, fullState.get(key));
                     }
                     cnt += 2;
                 }
@@ -594,144 +512,110 @@ class DeltaStateHelper<A extends EventBe
     return retArr;
   }
 
-  public void restoreState(FacesContext context, Object state)
-  {
-    if (state == null)
+  public void restoreState(FacesContext context, Object state) {
+    if (state == null) {
       return;
+    }
 
     Object[] serializedState = (Object[]) state;
 
-    if (!isInitialStateMarked() && !_fullState.isEmpty())
-    {
-      _fullState.clear();
-      if(_deltas != null)
-      {
-        _deltas.clear();
+    if (!isInitialStateMarked() && !fullState.isEmpty()) {
+      fullState.clear();
+      if (deltas != null) {
+        deltas.clear();
       }
     }
 
-    for (int cnt = 0; cnt < serializedState.length; cnt += 2)
-    {
+    for (int cnt = 0; cnt < serializedState.length; cnt += 2) {
       Serializable key = (Serializable) serializedState[cnt];
       Object savedValue = restoreAttachedState(context,
           serializedState[cnt + 1]);
 
-      if (isInitialStateMarked())
-      {
-        if (savedValue instanceof DeltaStateHelper.InternalDeltaListMap)
-        {
+      if (isInitialStateMarked()) {
+        if (savedValue instanceof DeltaStateHelper.InternalDeltaListMap) {
           for (Map.Entry<Object, Boolean> mapEntry : ((Map<Object, Boolean>) savedValue)
-              .entrySet())
-          {
+              .entrySet()) {
             boolean addOrRemove = mapEntry.getValue();
-            if (addOrRemove)
-            {
+            if (addOrRemove) {
               //add
               this.add(key, mapEntry.getKey());
-            }
-            else
-            {
+            } else {
               //remove
               this.remove(key, mapEntry.getKey());
             }
           }
-        }
-        else if (savedValue instanceof DeltaStateHelper.InternalMap)
-        {
+        } else if (savedValue instanceof DeltaStateHelper.InternalMap) {
           for (Map.Entry<String, Object> mapEntry : ((Map<String, Object>) savedValue)
-              .entrySet())
-          {
+              .entrySet()) {
             this.put(key, mapEntry.getKey(), mapEntry.getValue());
           }
-        }
                 /*
                 else if (savedValue instanceof _AttachedDeltaWrapper)
                 {
                     AttachedStateWrapper wrapper = (AttachedStateWrapper) savedValue;
                     //Restore delta state
-                    ((PartialStateHolder)_fullState.get(key)).restoreState(context, wrapper.getWrappedStateObject());
+                    ((PartialStateHolder)fullState.get(key)).restoreState(context, wrapper.getWrappedStateObject());
                     //Add this key as StateHolder key
                     _stateHolderKeys.add(key);
                 }
                 */
-        else
-        {
+        } else {
           put(key, savedValue);
         }
-      }
-      else
-      {
+      } else {
         put(key, savedValue);
       }
     }
   }
 
-  public void setTransient(boolean transientValue)
-  {
-    _transient = transientValue;
+  public void setTransient(boolean transientValue) {
+    transientBoolean = transientValue;
   }
 
   //We use our own data structures just to make sure
   //nothing gets mixed up internally
-  static class InternalMap<K, V> extends HashMap<K, V> implements StateHolder
-  {
-    public InternalMap()
-    {
+  static class InternalMap<K, V> extends HashMap<K, V> implements StateHolder {
+    public InternalMap() {
       super();
     }
 
-    public InternalMap(int initialCapacity, float loadFactor)
-    {
+    public InternalMap(int initialCapacity, float loadFactor) {
       super(initialCapacity, loadFactor);
     }
 
-    public InternalMap(Map<? extends K, ? extends V> m)
-    {
+    public InternalMap(Map<? extends K, ? extends V> m) {
       super(m);
     }
 
-    public InternalMap(int initialSize)
-    {
+    public InternalMap(int initialSize) {
       super(initialSize);
     }
 
-    public boolean isTransient()
-    {
+    public boolean isTransient() {
       return false;
     }
 
-    public void setTransient(boolean newTransientValue)
-    {
+    public void setTransient(boolean newTransientValue) {
       // No op
     }
 
-    public void restoreState(FacesContext context, Object state)
-    {
+    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]));
+      for (int cnt = 0; cnt < listAsMap.length; cnt += 2) {
+        this.put((K) listAsMap[cnt], (V) UIComponentBase.restoreAttachedState(context, listAsMap[cnt + 1]));
       }
     }
 
-    public Object saveState(FacesContext context)
-    {
+    public Object saveState(FacesContext context) {
       int cnt = 0;
       Object[] mapArr = new Object[this.size() * 2];
-      for (Map.Entry<K, V> entry : this.entrySet())
-      {
+      for (Map.Entry<K, V> entry : this.entrySet()) {
         mapArr[cnt] = entry.getKey();
         Object value = entry.getValue();
 
-        if (value instanceof StateHolder ||
-            value instanceof List ||
-            !(value instanceof Serializable))
-        {
+        if (value instanceof StateHolder || value instanceof List || !(value instanceof Serializable)) {
           mapArr[cnt + 1] = saveAttachedState(context, value);
-        }
-        else
-        {
+        } else {
           mapArr[cnt + 1] = value;
         }
         cnt += 2;
@@ -743,82 +627,62 @@ class DeltaStateHelper<A extends EventBe
   /**
    * Map used to keep track of list changes
    */
-  static class InternalDeltaListMap<K, V> extends DeltaStateHelper.InternalMap<K, V>
-  {
+  static class InternalDeltaListMap<K, V> extends DeltaStateHelper.InternalMap<K, V> {
 
-    public InternalDeltaListMap()
-    {
+    public InternalDeltaListMap() {
       super();
     }
 
-    public InternalDeltaListMap(int initialCapacity, float loadFactor)
-    {
+    public InternalDeltaListMap(int initialCapacity, float loadFactor) {
       super(initialCapacity, loadFactor);
     }
 
-    public InternalDeltaListMap(int initialSize)
-    {
+    public InternalDeltaListMap(int initialSize) {
       super(initialSize);
     }
 
-    public InternalDeltaListMap(Map<? extends K, ? extends V> m)
-    {
+    public InternalDeltaListMap(Map<? extends K, ? extends V> m) {
       super(m);
     }
   }
 
-  static class InternalList<T> extends ArrayList<T> implements StateHolder
-  {
-    public InternalList()
-    {
+  static class InternalList<T> extends ArrayList<T> implements StateHolder {
+    public InternalList() {
       super();
     }
 
-    public InternalList(Collection<? extends T> c)
-    {
+    public InternalList(Collection<? extends T> c) {
       super(c);
     }
 
-    public InternalList(int initialSize)
-    {
+    public InternalList(int initialSize) {
       super(initialSize);
     }
 
-    public boolean isTransient()
-    {
+    public boolean isTransient() {
       return false;
     }
 
-    public void setTransient(boolean newTransientValue)
-    {
+    public void setTransient(boolean newTransientValue) {
     }
 
-    public void restoreState(FacesContext context, Object state)
-    {
+    public void restoreState(FacesContext context, Object state) {
       Object[] listAsArr = (Object[]) state;
       //since all other options would mean dual iteration
       //we have to do it the hard way
-      for (Object elem : listAsArr)
-      {
+      for (Object elem : listAsArr) {
         add((T) restoreAttachedState(context, elem));
       }
     }
 
-    public Object saveState(FacesContext context)
-    {
+    public Object saveState(FacesContext context) {
       Object[] values = new Object[size()];
-      for (int i = 0; i < size(); i++)
-      {
+      for (int i = 0; i < size(); i++) {
         Object value = get(i);
 
-        if (value instanceof StateHolder ||
-            value instanceof List ||
-            !(value instanceof Serializable))
-        {
+        if (value instanceof StateHolder || value instanceof List || !(value instanceof Serializable)) {
           values[i] = saveAttachedState(context, value);
-        }
-        else
-        {
+        } else {
           values[i] = value;
         }
       }
@@ -826,85 +690,65 @@ class DeltaStateHelper<A extends EventBe
     }
   }
 
-  private static Object saveAttachedState(FacesContext context, Object attachedObject)
-  {
-    if (context == null)
-    {
-      throw new NullPointerException ("context");
+  private static Object saveAttachedState(FacesContext context, Object attachedObject) {
+    if (context == null) {
+      throw new NullPointerException("context");
     }
 
-    if (attachedObject == null)
+    if (attachedObject == null) {
       return null;
+    }
     // StateHolder interface should take precedence over
     // List children
-    if (attachedObject instanceof StateHolder)
-    {
+    if (attachedObject instanceof StateHolder) {
       StateHolder holder = (StateHolder) attachedObject;
-      if (holder.isTransient())
-      {
+      if (holder.isTransient()) {
         return null;
       }
 
       return new AttachedStateWrapper(attachedObject.getClass(), holder.saveState(context));
-    }
-    else if (attachedObject instanceof List)
-    {
+    } else if (attachedObject instanceof List) {
       List<Object> lst = new ArrayList<Object>(((List<?>) attachedObject).size());
-      for (Object item : (List<?>) attachedObject)
-      {
-        if (item != null)
-        {
+      for (Object item : (List<?>) attachedObject) {
+        if (item != null) {
           lst.add(saveAttachedState(context, item));
         }
       }
 
       return new AttachedListStateWrapper(lst);
-    }
-    else if (attachedObject instanceof Serializable)
-    {
+    } else if (attachedObject instanceof Serializable) {
       return attachedObject;
-    }
-    else
-    {
+    } else {
       return new AttachedStateWrapper(attachedObject.getClass(), null);
     }
   }
 
-  private static Object restoreAttachedState(FacesContext context, Object stateObj) throws IllegalStateException
-  {
-    if (context == null)
+  private static Object restoreAttachedState(FacesContext context, Object stateObj) throws IllegalStateException {
+    if (context == null) {
       throw new NullPointerException("context");
-    if (stateObj == null)
+    }
+    if (stateObj == null) {
       return null;
-    if (stateObj instanceof AttachedListStateWrapper)
-    {
+    }
+    if (stateObj instanceof AttachedListStateWrapper) {
       List<Object> lst = ((AttachedListStateWrapper) stateObj).getWrappedStateList();
       List<Object> restoredList = new ArrayList<Object>(lst.size());
-      for (Object item : lst)
-      {
+      for (Object item : lst) {
         restoredList.add(restoreAttachedState(context, item));
       }
       return restoredList;
-    }
-    else if (stateObj instanceof AttachedStateWrapper)
-    {
+    } else if (stateObj instanceof AttachedStateWrapper) {
       Class<?> clazz = ((AttachedStateWrapper) stateObj).getClazz();
       Object restoredObject;
-      try
-      {
+      try {
         restoredObject = clazz.newInstance();
-      }
-      catch (InstantiationException e)
-      {
+      } catch (InstantiationException e) {
         throw new RuntimeException("Could not restore StateHolder of type " + clazz.getName()
             + " (missing no-args constructor?)", e);
-      }
-      catch (IllegalAccessException e)
-      {
+      } catch (IllegalAccessException e) {
         throw new RuntimeException(e);
       }
-      if (restoredObject instanceof StateHolder)
-      {
+      if (restoredObject instanceof StateHolder) {
         AttachedStateWrapper wrapper = (AttachedStateWrapper) stateObj;
         Object wrappedState = wrapper.getWrappedStateObject();
 
@@ -912,9 +756,7 @@ class DeltaStateHelper<A extends EventBe
         holder.restoreState(context, wrappedState);
       }
       return restoredObject;
-    }
-    else
-    {
+    } else {
       return stateObj;
     }
   }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java?rev=1768832&r1=1768831&r2=1768832&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java Wed Nov  9 06:26:37 2016
@@ -37,13 +37,16 @@ import static org.apache.myfaces.tobago.
 
 // todo: clean up (is a copy of MyFaces, but not all stuff is refactored)
 
+/**
+ * @since 3.0.0
+ */
 @FacesBehavior(value = BEHAVIOR_ID)
-public class EventBehavior extends ClientBehaviorBase
-{
+public class EventBehavior extends ClientBehaviorBase {
 
   /**
    * not needed anymore but enforced by the spec
    * theoretically a
+   *
    * @FacesBehavior(value = "javax.faces.behavior.Ajax")
    * could do it
    */
@@ -70,95 +73,78 @@ public class EventBehavior extends Clien
   private static final Collection<String> VAL_NONE_LIST = Collections.singletonList(VAL_NONE);
 
   //To enable delta state saving we need this one
-  private DeltaStateHelper<EventBehavior> _stateHelper = null;
+  private DeltaStateHelper<EventBehavior> stateHelper = null;
 
   //private Map<String, ValueExpression> _valueExpressions
   //        = new HashMap<String, ValueExpression>();
 
-  public EventBehavior()
-  {
+  public EventBehavior() {
     super();
   }
 
-  public void addAjaxBehaviorListener(AjaxBehaviorListener listener)
-  {
+  public void addAjaxBehaviorListener(AjaxBehaviorListener listener) {
     super.addBehaviorListener(listener);
   }
 
-  public void removeAjaxBehaviorListener(AjaxBehaviorListener listener)
-  {
+  public void removeAjaxBehaviorListener(AjaxBehaviorListener listener) {
     removeBehaviorListener(listener);
   }
 
-  public Collection<String> getExecute()
-  {
+  public Collection<String> getExecute() {
     // we have to evaluate the real value in this method,
     // because the value of the ValueExpression might
     // change (almost sure it does!)
     return evalForCollection(ATTR_EXECUTE);
   }
 
-  public void setExecute(Collection<String> execute)
-  {
+  public void setExecute(Collection<String> execute) {
     getStateHelper().put(ATTR_EXECUTE, execute);
   }
 
-  public String getOnerror()
-  {
+  public String getOnerror() {
     return (String) getStateHelper().eval(ATTR_ON_ERROR);
   }
 
-  public void setOnerror(String onError)
-  {
+  public void setOnerror(String onError) {
     getStateHelper().put(ATTR_ON_ERROR, onError);
   }
 
-  public String getOnevent()
-  {
+  public String getOnevent() {
     return (String) getStateHelper().eval(ATTR_ON_EVENT);
   }
 
-  public void setOnevent(String onEvent)
-  {
+  public void setOnevent(String onEvent) {
     getStateHelper().put(ATTR_ON_EVENT, onEvent);
   }
 
-  public Collection<String> getRender()
-  {
+  public Collection<String> getRender() {
     // we have to evaluate the real value in this method,
     // because the value of the ValueExpression might
     // change (almost sure it does!)
     return evalForCollection(ATTR_RENDER);
   }
 
-  public void setRender(Collection<String> render)
-  {
+  public void setRender(Collection<String> render) {
     getStateHelper().put(ATTR_RENDER, render);
   }
 
   @SuppressWarnings("unchecked")
-  public ValueExpression getValueExpression(String name)
-  {
+  public ValueExpression getValueExpression(String name) {
     //return getValueExpressionMap().get(name);
-    if (name == null)
-    {
+    if (name == null) {
       throw new NullPointerException("name can not be null");
     }
 
-    Map<String,Object> bindings = (Map<String,Object>) getStateHelper().
+    Map<String, Object> bindings = (Map<String, Object>) getStateHelper().
         get(EventBehavior.PropertyKeys.bindings);
-    if (bindings != null)
-    {
+    if (bindings != null) {
       return (ValueExpression) bindings.get(name);
-    }
-    else
-    {
+    } else {
       return null;
     }
   }
 
-  public void setValueExpression(String name, ValueExpression expression)
-  {
+  public void setValueExpression(String name, ValueExpression expression) {
         /*
         if (item == null)
         {
@@ -170,129 +156,104 @@ public class EventBehavior extends Clien
             getValueExpressionMap().put(name, item);
         }
         */
-    if (name == null)
-    {
+    if (name == null) {
       throw new NullPointerException("name");
     }
 
-    if (expression == null)
-    {
+    if (expression == null) {
       getStateHelper().remove(EventBehavior.PropertyKeys.bindings, name);
-    }
-    else
-    {
+    } else {
       getStateHelper().put(EventBehavior.PropertyKeys.bindings, name, expression);
     }
   }
 
-  public boolean isDisabled()
-  {
+  public boolean isDisabled() {
     Boolean retVal = (Boolean) getStateHelper().eval(ATTR_DISABLED);
     retVal = (retVal == null) ? false : retVal;
     return retVal;
   }
 
-  public void setDisabled(boolean disabled)
-  {
+  public void setDisabled(boolean disabled) {
     getStateHelper().put(ATTR_DISABLED, disabled);
   }
 
-  public boolean isImmediate()
-  {
+  public boolean isImmediate() {
     Boolean retVal = (Boolean) getStateHelper().eval(ATTR_IMMEDIATE);
     retVal = (retVal == null) ? false : retVal;
     return retVal;
   }
 
-  public void setImmediate(boolean immediate)
-  {
+  public void setImmediate(boolean immediate) {
     getStateHelper().put(ATTR_IMMEDIATE, immediate);
   }
 
-  public boolean isImmediateSet()
-  {
-    return (getStateHelper().get(ATTR_IMMEDIATE) != null) ||
-        (getValueExpression(ATTR_IMMEDIATE) != null);
+  public boolean isImmediateSet() {
+    return (getStateHelper().get(ATTR_IMMEDIATE) != null) || (getValueExpression(ATTR_IMMEDIATE) != null);
   }
 
   @Override
-  public Set<ClientBehaviorHint> getHints()
-  {
+  public Set<ClientBehaviorHint> getHints() {
     return EnumSet.of(ClientBehaviorHint.SUBMITTING);
   }
 
   @Override
-  public String getRendererType()
-  {
+  public String getRendererType() {
     return BEHAVIOR_ID;
   }
 
   @Override
-  public void restoreState(FacesContext facesContext, Object o)
-  {
-    if (o == null)
-    {
+  public void restoreState(FacesContext facesContext, Object o) {
+    if (o == null) {
       return;
     }
     Object[] values = (Object[]) o;
-    if (values[0] != null)
-    {
+    if (values[0] != null) {
       super.restoreState(facesContext, values[0]);
     }
     getStateHelper().restoreState(facesContext, values[1]);
   }
 
-  private StateHelper getStateHelper()
-  {
+  private StateHelper getStateHelper() {
     return getStateHelper(true);
   }
 
   /**
    * returns a delta state saving enabled state helper
    * for the current component
+   *
    * @param create if true a state helper is created if not already existing
    * @return an implementation of the StateHelper interface or null if none exists and create is set to false
    */
-  private StateHelper getStateHelper(boolean create)
-  {
-    if(_stateHelper != null)
-    {
-      return _stateHelper;
-    }
-    if(create)
-    {
-      _stateHelper = new DeltaStateHelper<EventBehavior>(this);
+  private StateHelper getStateHelper(boolean create) {
+    if (stateHelper != null) {
+      return stateHelper;
+    }
+    if (create) {
+      stateHelper = new DeltaStateHelper<EventBehavior>(this);
     }
-    return _stateHelper;
+    return stateHelper;
   }
 
   @Override
-  public Object saveState(FacesContext facesContext)
-  {
-    if (initialStateMarked())
-    {
+  public Object saveState(FacesContext facesContext) {
+    if (initialStateMarked()) {
       Object parentSaved = super.saveState(facesContext);
       Object stateHelperSaved = null;
       StateHelper stateHelper = getStateHelper(false);
-      if (stateHelper != null)
-      {
+      if (stateHelper != null) {
         stateHelperSaved = stateHelper.saveState(facesContext);
       }
 
-      if (parentSaved == null && stateHelperSaved == null)
-      {
+      if (parentSaved == null && stateHelperSaved == null) {
         //No values
         return null;
       }
       return new Object[]{parentSaved, stateHelperSaved};
-    }
-    else
-    {
+    } else {
       Object[] values = new Object[2];
       values[0] = super.saveState(facesContext);
       StateHelper stateHelper = getStateHelper(false);
-      if (stateHelper != null)
-      {
+      if (stateHelper != null) {
         values[1] = stateHelper.saveState(facesContext);
       }
       return values;
@@ -307,27 +268,20 @@ public class EventBehavior extends Clien
   /**
    * Invokes eval on the getStateHelper() and tries to get a
    * Collection out of the result.
+   *
    * @param attributeName
    * @return
    */
   @SuppressWarnings("unchecked")
-  private Collection<String> evalForCollection(String attributeName)
-  {
+  private Collection<String> evalForCollection(String attributeName) {
     Object value = getStateHelper().eval(attributeName);
-    if (value == null)
-    {
+    if (value == null) {
       return Collections.<String>emptyList();
-    }
-    else if (value instanceof Collection)
-    {
+    } else if (value instanceof Collection) {
       return (Collection<String>) value;
-    }
-    else if (value instanceof String)
-    {
+    } else if (value instanceof String) {
       return getCollectionFromSpaceSplitString((String) value);
-    }
-    else
-    {
+    } else {
       throw new IllegalArgumentException("Type " + value.getClass()
           + " not supported for attribute " + attributeName);
     }
@@ -336,26 +290,19 @@ public class EventBehavior extends Clien
   /**
    * Splits the String based on spaces and returns the
    * resulting Strings as Collection.
+   *
    * @param stringValue
    * @return
    */
-  private Collection<String> getCollectionFromSpaceSplitString(String stringValue)
-  {
+  private Collection<String> getCollectionFromSpaceSplitString(String stringValue) {
     //@special handling for @all, @none, @form and @this
-    if (stringValue.equals(VAL_FORM))
-    {
+    if (stringValue.equals(VAL_FORM)) {
       return VAL_FORM_LIST;
-    }
-    else if (stringValue.equals(VAL_ALL))
-    {
+    } else if (stringValue.equals(VAL_ALL)) {
       return VAL_ALL_LIST;
-    }
-    else if (stringValue.equals(VAL_NONE))
-    {
+    } else if (stringValue.equals(VAL_NONE)) {
       return VAL_NONE_LIST;
-    }
-    else if (stringValue.equals(VAL_THIS))
-    {
+    } else if (stringValue.equals(VAL_THIS)) {
       return VAL_THIS_LIST;
     }
 
@@ -364,8 +311,7 @@ public class EventBehavior extends Clien
     return Arrays.asList(arrValue);
   }
 
-  private enum PropertyKeys
-  {
+  private enum PropertyKeys {
     bindings,
   }
 }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/RowRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/RowRenderer.java?rev=1768832&r1=1768831&r2=1768832&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/RowRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/RowRenderer.java Wed Nov  9 06:26:37 2016
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
 
 public class RowRenderer extends DecodingCommandRendererBase {



Mime
View raw message