myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject svn commit: r1815020 - in /myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html: HtmlRadioRendererBase.java HtmlRendererUtils.java
Date Sun, 12 Nov 2017 14:16:54 GMT
Author: tandraschko
Date: Sun Nov 12 14:16:54 2017
New Revision: 1815020

URL: http://svn.apache.org/viewvc?rev=1815020&view=rev
Log:
cosmetics

Modified:
    myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
    myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java?rev=1815020&r1=1815019&r2=1815020&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
Sun Nov 12 14:16:54 2017
@@ -391,12 +391,8 @@ public class HtmlRadioRendererBase
         }
         writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_RADIO, null);
         
-        String group = null;
-        if (uiComponent instanceof HtmlSelectOneRadio)
-        {
-            group = ((HtmlSelectOneRadio)uiComponent).getGroup();
-        }
-        if (group != null && group.length() > 0)
+        String group = uiComponent instanceof HtmlSelectOneRadio ? ((HtmlSelectOneRadio)
uiComponent).getGroup() : null;
+        if (group != null && !group.isEmpty())
         {
             FormInfo formInfo = RendererUtils.findNestingForm(uiComponent, facesContext);
             writer.writeAttribute(HTML.NAME_ATTR, formInfo.getFormName()+

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=1815020&r1=1815019&r2=1815020&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
Sun Nov 12 14:16:54 2017
@@ -267,7 +267,7 @@ public final class HtmlRendererUtils
         if (component instanceof UISelectOne)
         {
             String group = ((UISelectOne) component).getGroup();
-            if (group != null && group.length() > 0)
+            if (group != null && !group.isEmpty())
             {
                 FormInfo formInfo = RendererUtils.findNestingForm(component, facesContext);
                 String fullGroupId = formInfo.getFormName() +
@@ -275,14 +275,14 @@ public final class HtmlRendererUtils
                 if (paramMap.containsKey(fullGroupId))
                 {
                     String submittedValue = (String) paramMap.get(fullGroupId);
-                    String submittedValuePrefix = component.getClientId(facesContext) +
+                    String submittedValueNamespace = component.getClientId(facesContext)
+
                             facesContext.getNamingContainerSeparatorChar();
-                    if (submittedValue.startsWith(submittedValuePrefix))
+                    if (submittedValue.startsWith(submittedValueNamespace))
                     {
-                        String realSubmittedValue = submittedValue.substring(submittedValuePrefix.length());
+                        submittedValue = submittedValue.substring(submittedValueNamespace.length());
                         SelectOneGroupSetSubmittedValueCallback callback = 
                                 new SelectOneGroupSetSubmittedValueCallback(group,
-                                        realSubmittedValue,
+                                        submittedValue,
                                         component.getClientId(facesContext),
                                         component.getValueExpression("value") != null);
                         formInfo.getForm().visitTree(
@@ -292,6 +292,7 @@ public final class HtmlRendererUtils
                 return;
             }
         }
+        
         String clientId = component.getClientId(facesContext);
         if (paramMap.containsKey(clientId))
         {



Mime
View raw message