commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29428] - Digester does not keep "root" variable in sync...
Date Mon, 07 Jun 2004 15:04:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29428>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29428

Digester does not keep "root" variable in sync...





------- Additional Comments From james@carmanconsulting.com  2004-06-07 15:04 -------
The Digester class currently maintains a reference to the root object on the 
stack via a member variable named "root."  However, it doesn't properly keep 
this in sync upon a clear() operation (see attached, simplified test case).  
IMHO, the variable should be removed completely.  You're (or I guess we're in 
the open source world) just asking for problems when trying to keep these 
values in sync.  The patch (also attached) completely removes the root 
variable and re-implements the getRoot() method to use the stack API to 
reference the root element (peek using size - 1) instead.  In order to remove 
the variable, I had to modify the SetRootRule class also as it directly 
referenced the root variable (bad idea).  I changed it to use the getRoot() 
method instead.  I also added some checks in the test case 
DigesterTestCase.testStackMethods() to exercise the code that I modified and 
to illustrate the bug that was there.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message