[ 
https://issues.apache.org/jira/browse/TRINIDAD-2048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006083#comment-13006083
 ] 

Max Starets commented on TRINIDAD-2048:
---------------------------------------

Minor modification on top of the deltas to handle null _insertBeforeId:

  @Override
  public boolean equals(Object o)
  {
    if (o == this)
      return true;
    
    if (!(o instanceof MoveChildComponentChange))
      return false;
    
    MoveChildComponentChange other = (MoveChildComponentChange)o;
    
    return getSourceLogicalScopedId().equals(other.getSourceLogicalScopedId()) 
&&
           
getDestinationLogicalScopedId().equals(other.getDestinationLogicalScopedId()) &&
           _equalsOrNull(_insertBeforeId, other._insertBeforeId);
  }
  
  @Override
  public int hashCode()
  {
    int hashCode = getSourceLogicalScopedId().hashCode() + 37 * 
getDestinationLogicalScopedId().hashCode();
    if (_insertBeforeId != null)
    {
      hashCode = hashCode + 1369 * _insertBeforeId.hashCode();
    }
    return hashCode;
  }

  private boolean _equalsOrNull(Object obj1, Object obj2)
  {
    return (obj1 == null) ? (obj2 == null) : obj1.equals(obj2);
  }

> ComponentUtils.getScopedIdForComponent() is not producing consistent scoped 
> IDs for components relocated during tag execution
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2048
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2048
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>            Reporter: Max Starets
>            Assignee: Max Starets
>         Attachments: trinidad2048-1.2.x.patch, trinidad2048.patch
>
>
> getScopedIdForComponent() simply walks the parent hierarchy to append naming 
> container IDs. However, we have components that get relocated during tag 
> execution, so their naming container hierarchy is different at tag execution 
> time vs. the rest of the lifecycle. To solve this problem, we need to have 
> getScopedIdForComponent return a scoped Id reflecting the original naming 
> container hierarchy for the component, i.e. return its pre-relocation scoped 
> ID.
> This will require API additions on UIXComponent to allow relocated components 
> to provide their logical (original parent). 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to