Return-Path: X-Original-To: apmail-xerces-j-dev-archive@www.apache.org Delivered-To: apmail-xerces-j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 132FC668B for ; Sat, 14 May 2011 17:13:30 +0000 (UTC) Received: (qmail 38171 invoked by uid 500); 14 May 2011 17:13:30 -0000 Delivered-To: apmail-xerces-j-dev-archive@xerces.apache.org Received: (qmail 38076 invoked by uid 500); 14 May 2011 17:13:29 -0000 Mailing-List: contact j-dev-help@xerces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: j-dev@xerces.apache.org Delivered-To: mailing list j-dev@xerces.apache.org Received: (qmail 38069 invoked by uid 99); 14 May 2011 17:13:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 May 2011 17:13:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 May 2011 17:13:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 50B11CA3B8 for ; Sat, 14 May 2011 17:12:47 +0000 (UTC) Date: Sat, 14 May 2011 17:12:47 +0000 (UTC) From: "Michael Glavassevich (JIRA)" To: j-dev@xerces.apache.org Message-ID: <2019025677.13298.1305393167311.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (XERCESJ-1421) Temporary inconsistent data inside Xerces2-J when removing a first child of a node. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/XERCESJ-1421?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13= 033581#comment-13033581 ]=20 Michael Glavassevich commented on XERCESJ-1421: ----------------------------------------------- Ludger and Thiwanka, I agree with both or your assessments. This not only c= orrects an inconsistent state but is also minor performance improvement for= checkNormalizationAfterRemove() when the first child of a node is removed. > Temporary inconsistent data inside Xerces2-J when removing a first child = of a node. > -------------------------------------------------------------------------= ---------- > > Key: XERCESJ-1421 > URL: https://issues.apache.org/jira/browse/XERCESJ-1421 > Project: Xerces2-J > Issue Type: Improvement > Components: DOM (Level 3 Core) > Affects Versions: 2.9.1 > Reporter: Ludger B=C3=BCnger > Assignee: Michael Glavassevich > Priority: Minor > Attachments: PreviousSiblingInconsistentDataPatch.txt > > > When removing a first child, currently there is a local field inside Pare= ntNode.internalRemoveChild that contains inconsistent data. > Since in this specific case the following code still performs correct, th= ere is currently no harm done. > However I think it should be fixed nonetheless since future changes to th= e code might cause problems. > And here the description of the issue: > Xerces2-J uses an internal optimization by overloading the ChildNode.prev= iousSibling field. > 1) If a node has a previous sibling, this field contains the previous sib= ling. > 2) if a node is the first child of it's parent (and thus has no previous = sibling), this field is re-used for a different purpose and contains the la= st sibling thus allowing quick access to the end of a node list > Now ChildNode.internalRemoveNode stores a reference to the previousSiblin= g of the removed node for normalization checking purposes in the local fiel= d oldPreviousSibling. > However this is done after removal of the node is already done but before= null'ing of the tree structure fields of the node. > Since this node has already been removed, the isFirstChild() check fails = and instead of 'null' the last sibling is stored in the oldPreviousSibling = field. > By chance the normalization checking code still works correct if the prev= ious sibling field contains the last sibling instead of the correct value '= null' but this still should be fixed. > See attached patch. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org For additional commands, e-mail: j-dev-help@xerces.apache.org