You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2011/10/21 21:42:34 UTC
svn commit: r1187525 - in
/myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component:
UIComponentBase.java _ComponentUtils.java
Author: bommel
Date: Fri Oct 21 19:42:33 2011
New Revision: 1187525
URL: http://svn.apache.org/viewvc?rev=1187525&view=rev
Log:
suggested fix for (MYFACES-3364) and (MYFACES-3268)
Modified:
myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/UIComponentBase.java
myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/_ComponentUtils.java
Modified: myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/UIComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/UIComponentBase.java?rev=1187525&r1=1187524&r2=1187525&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/UIComponentBase.java (original)
+++ myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/UIComponentBase.java Fri Oct 21 19:42:33 2011
@@ -616,35 +616,8 @@ public abstract class UIComponentBase ex
throw new IllegalArgumentException("Intermediate identifier " + id + " in search expression " + expr
+ " identifies a UIComponent that is not a NamingContainer");
- if (id.equals(findBase.getId()))
- {
- // At this point, findBase has a NamingContainer that match with the id.
- // So we need to call findComponent over the rest of the expression without take
- // into account the base id, to allow use the same id on the inner component.
- //return findBase.findComponent(expr.substring(separator + 1));
- String innerExpr = expr.substring(separator + 1);
- separator = innerExpr.indexOf(separatorChar);
- //String innerExpr1 = null;
- //String nextId = null;
- if (separator == -1)
- {
- //innerExpr1 = null;
- //nextId= innerExpr;
- return _ComponentUtils.findComponentChildOrFacetFrom(findBase, innerExpr, null);
- }
- else
- {
- //innerExpr1 = innerExpr.substring(separator+1);
- //nextId = innerExpr.substring(0,separator);
- return _ComponentUtils.findComponentChildOrFacetFrom(findBase, innerExpr.substring(0,separator), innerExpr);
- }
- }
- else
- {
- //At this point, findBase has a NamingContainer that does not match with the id.
- //We need to scan from this component the full expression.
- return _ComponentUtils.findComponentChildOrFacetFrom(findBase, expr, null);
- }
+ return findBase.findComponent(expr.substring(separator + 1));
+
}
/**
Modified: myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/_ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/_ComponentUtils.java?rev=1187525&r1=1187524&r2=1187525&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/_ComponentUtils.java (original)
+++ myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/component/_ComponentUtils.java Fri Oct 21 19:42:33 2011
@@ -110,7 +110,8 @@ class _ComponentUtils
*/
static UIComponent findComponent(UIComponent findBase, String id, final char separatorChar)
{
- if (idsAreEqual(id, findBase, separatorChar))
+
+ if (!(findBase instanceof NamingContainer) && idsAreEqual(id, findBase, separatorChar))
{
return findBase;
}
@@ -148,6 +149,11 @@ class _ComponentUtils
}
}
+ if (findBase instanceof NamingContainer && idsAreEqual(id, findBase, separatorChar))
+ {
+ return findBase;
+ }
+
return null;
}