You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/04/27 05:06:29 UTC

svn commit: r938304 - /myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/component/UIData.java

Author: lu4242
Date: Tue Apr 27 03:06:28 2010
New Revision: 938304

URL: http://svn.apache.org/viewvc?rev=938304&view=rev
Log:
small improvement on UIData.invokeOnComponent reduce regex complexity

Modified:
    myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/component/UIData.java

Modified: myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/component/UIData.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/component/UIData.java?rev=938304&r1=938303&r2=938304&view=diff
==============================================================================
--- myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/component/UIData.java (original)
+++ myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/component/UIData.java Tue Apr 27 03:06:28 2010
@@ -329,10 +329,13 @@ public class UIData extends UIComponentB
         {
             // Check if the clientId for the component, which we 
             // are looking for, has a rowIndex attached
-            if (clientId.matches(baseClientId + ":[0-9]+:.*"))
+            String subId = clientId.substring(baseClientId.length() + 1);
+            //If the char next to baseClientId is the separator one and
+            //the subId matches the regular expression
+            if (clientId.charAt(baseClientId.length()) == NamingContainer.SEPARATOR_CHAR && 
+                    subId.matches("[0-9]+"+NamingContainer.SEPARATOR_CHAR+".*"))
             {
-                String subId = clientId.substring(baseClientId.length() + 1);
-                String clientRow = subId.substring(0, subId.indexOf(':'));
+                String clientRow = subId.substring(0, subId.indexOf(NamingContainer.SEPARATOR_CHAR));
     
                 //Now we save the current position
                 int oldRow = this.getRowIndex();