myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject svn commit: r1804696 - in /myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit: RendererUtils.java html/HtmlRadioRendererBase.java html/util/SelectItemsUtils.java
Date Thu, 10 Aug 2017 18:21:21 GMT
Author: tandraschko
Date: Thu Aug 10 18:21:21 2017
New Revision: 1804696

URL: http://svn.apache.org/viewvc?rev=1804696&view=rev
Log:
(MYFACES-3163) [perf] review working with SelectItem(s)

Modified:
    myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
    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/util/SelectItemsUtils.java

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?rev=1804696&r1=1804695&r2=1804696&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Thu Aug 10 18:21:21 2017
@@ -753,13 +753,13 @@ public final class RendererUtils
      * @param facesContext
      * @return List of SelectItem Objects
      */
-    public static List getSelectItemList(UISelectOne uiSelectOne,
+    public static List<SelectItem> getSelectItemList(UISelectOne uiSelectOne,
             FacesContext facesContext)
     {
         return internalGetSelectItemList(uiSelectOne, facesContext);
     }
 
-    public static List getSelectItemList(UISelectMany uiSelectMany)
+    public static List<SelectItem> getSelectItemList(UISelectMany uiSelectMany)
     {
         return internalGetSelectItemList(uiSelectMany,
                 FacesContext.getCurrentInstance());

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=1804696&r1=1804695&r2=1804696&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
Thu Aug 10 18:21:21 2017
@@ -21,7 +21,6 @@ package org.apache.myfaces.shared.render
 import java.io.IOException;
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -180,10 +179,9 @@ public class HtmlRadioRendererBase
                             facesContext, selectOne);
 
                 int itemNum = 0;
-
-                for (Iterator it = selectItemList.iterator(); it.hasNext(); )
+                for (int i = 0; i < selectItemList.size(); i++)
                 {
-                    SelectItem selectItem = (SelectItem)it.next();
+                    SelectItem selectItem = (SelectItem) selectItemList.get(i);
 
                     itemNum = renderGroupOrItemRadio(facesContext, selectOne,
                                                      selectItem, currentValue,
@@ -223,9 +221,9 @@ public class HtmlRadioRendererBase
 
             int itemNum = 0;
 
-            for (Iterator it = selectItemList.iterator(); it.hasNext(); )
+            for (int i = 0; i < selectItemList.size(); i++)
             {
-                SelectItem selectItem = (SelectItem)it.next();
+                SelectItem selectItem = (SelectItem) selectItemList.get(i);
 
                 itemNum = renderGroupOrItemRadio(facesContext, selectOne,
                                                  selectItem, currentValue,

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java?rev=1804696&r1=1804695&r2=1804696&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java
Thu Aug 10 18:21:21 2017
@@ -71,7 +71,7 @@ public class SelectItemsUtils
         return list;
     }
     
-public static void renderSelectOptions(FacesContext context,
+    public static void renderSelectOptions(FacesContext context,
             UIComponent component, Converter converter, Set lookupSet,
             List<SelectItemInfo> selectItemList) throws IOException
     {
@@ -81,9 +81,9 @@ public static void renderSelectOptions(F
         boolean componentDisabled = isTrue(component.getAttributes()
                 .get("disabled"));
 
-        for (Iterator<SelectItemInfo> it = selectItemList.iterator(); it.hasNext();)
+        for (int i = 0; i < selectItemList.size(); i++)
         {
-            SelectItemInfo selectItemInfo = it.next();
+            SelectItemInfo selectItemInfo = selectItemList.get(i);
             SelectItem selectItem = selectItemInfo.getItem();
             if (selectItem instanceof SelectItemGroup)
             {



Mime
View raw message