Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 50202 invoked from network); 7 Sep 2010 17:34:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Sep 2010 17:34:00 -0000 Received: (qmail 19964 invoked by uid 500); 7 Sep 2010 17:34:00 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 19610 invoked by uid 500); 7 Sep 2010 17:33:59 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 19603 invoked by uid 99); 7 Sep 2010 17:33:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 17:33:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 17:33:57 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o87HXZ6u019775 for ; Tue, 7 Sep 2010 17:33:35 GMT Message-ID: <15506781.57831283880815777.JavaMail.jira@thor> Date: Tue, 7 Sep 2010 13:33:35 -0400 (EDT) From: "Leonardo Uribe (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Resolved: (MYFACES-2908) UIViewRoot.addComponentResource() adding multiple components with same ID instead of replacing In-Reply-To: <12996088.145941283454713095.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MYFACES-2908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leonardo Uribe resolved MYFACES-2908. ------------------------------------- Resolution: Fixed > UIViewRoot.addComponentResource() adding multiple components with same ID instead of replacing > ---------------------------------------------------------------------------------------------- > > Key: MYFACES-2908 > URL: https://issues.apache.org/jira/browse/MYFACES-2908 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.2-SNAPSHOT > Reporter: Michael Concini > Assignee: Michael Concini > Fix For: 2.0.2-SNAPSHOT > > Attachments: MYFACES-2908-patch.txt > > > Looks like when MYFACES-2854 was committed, there were two issues it caused where we break spec compliance. Both are around behavior that "If the component ID of componentResource matches the the ID of a resource that has allready been added, remove the old resource." > The first is that it looks like the "else if (componentId != null)" statement is in the wrong place. > If a UIComponent is added with the same ID as an existing component, we'll never get to this check since we'll be false on the isInView() check. > This will cause duplicate ID exceptions to be thrown if multiple objects with the same ID are added. > This is easily resolved by moving the else if to kick in whenever isInView() is false. > The second issue, and the more important since this is breaking a TCK test, is that since we were only comparing to the parent's ID to the location prefix, we weren't handling the case where the same object gets added a second time after updating the target. > This can be resolved by changing > if (componentResource.getParent() != null && > componentResource.getParent().getId() != null && > componentResource.getParent().getId().startsWith(JAVAX_FACES_LOCATION_PREFIX)) ... > to > if (componentResource.getParent() != null && > componentResource.getParent().getId() != null && > componentResource.getParent().getId().equals(JAVAX_FACES_LOCATION_PREFIX + target)) > I'll attach a patch for review while I wait for our CTS team to try the change out. I probably wont' be able to commit until after the US Labor Day holiday since I'm away Friday. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.