You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2021/02/16 11:31:00 UTC

[myfaces] branch master updated: cosmetics

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 3108b58  cosmetics
3108b58 is described below

commit 3108b58b2e65a5be0e052a8c1e646dd97f1db1d1
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Tue Feb 16 12:30:51 2021 +0100

    cosmetics
---
 .../renderkit/html/HtmlResponseStateManager.java   | 30 ++++++++++++++--------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
index 76ed7b7..a0e7537 100755
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
@@ -277,17 +277,21 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
         // multiple sections for update. In servlet case there is only one update section per
         // ajax request.
         
-        String id;
         char separator = facesContext.getNamingContainerSeparatorChar();
+
         Integer count = (Integer) facesContext.getAttributes().get(CLIENT_WINDOW_COUNTER);
         if (count == null)
         {
-            count = Integer.valueOf(0);
+            count = Integer.valueOf(1);
+        }
+        else
+        {
+            count += 1;
         }
-        count += 1;
-        id = facesContext.getViewRoot().getContainerClientId(facesContext) + 
-            separator + ResponseStateManager.CLIENT_WINDOW_PARAM + separator + count;
         facesContext.getAttributes().put(CLIENT_WINDOW_COUNTER, count);
+
+        String id = facesContext.getViewRoot().getContainerClientId(facesContext) + 
+            separator + ResponseStateManager.CLIENT_WINDOW_PARAM + separator + count;
         return id;
     }
     
@@ -304,18 +308,22 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
         // UNIQUE_PER_VIEW_NUMBER aim for portlet case. In that case it is possible to have
         // multiple sections for update. In servlet case there is only one update section per
         // ajax request.
-        
-        String id;
+
         char separator = facesContext.getNamingContainerSeparatorChar();
+
         Integer count = (Integer) facesContext.getAttributes().get(VIEW_STATE_COUNTER);
         if (count == null)
         {
-            count = Integer.valueOf(0);
+            count = Integer.valueOf(1);
+        }
+        else
+        {
+            count += 1;
         }
-        count += 1;
-        id = facesContext.getViewRoot().getContainerClientId(facesContext) + 
-            separator + ResponseStateManager.VIEW_STATE_PARAM + separator + count;
         facesContext.getAttributes().put(VIEW_STATE_COUNTER, count);
+
+        String id = facesContext.getViewRoot().getContainerClientId(facesContext) + 
+            separator + ResponseStateManager.VIEW_STATE_PARAM + separator + count;
         return id;
     }
 }