[jdom-commits] CVS Update: jdom/src/java/org/jdom

Jason Hunter jhunter at servlets.kattare.com
Thu Nov 16 00:16:36 PST 2006


****************************************
Date:   Thu Nov 16, 2006 @00:16:35 PST
Author: 

Update of /home/cvs/jdom/src/java/org/jdom
In directory servlets:/tmp/cvs-serv16897

Modified Files:
CDATA.java
Log Message:
Fix from Victor Toni:

While working on the test cases for CDATA I looked up the code and
noticed that a corner case is not handled correctly in particular
append() could lead to invalid content:
Text set is checked if it contains "]]>", when appending text only the
new part is checked and not the resulting value leading to this to
corner case which are currently ignored:
"some text ]" + "]> some other text"
and
"some text ]]" + "> some other text"

Comment doesn't seem to have a similar issue since it isn't derived from
Text and thus doesn't have an append method.

Attached you'll find a complete test class for CDATA with a 100%
coverage and the changed CDATA class which solves the issue.
I had to add an override for Text.append(Text) in CDATA since the same
could happen there.

-jh-

===================================================================
File: no file CDATA.java		Status: Needs Checkout

   Working revision:	1.31	Thu Nov 16 08:16:35 2006
   Repository revision:	1.31	/home/cvs/jdom/src/java/org/jdom/CDATA.java,v

   Existing Tags:
	jdom_1_0                 	(revision: 1.30)
	jdom_1_0_rc1             	(revision: 1.30)
	BEFORE_UNCHECKED         	(revision: 1.30)
	jdom_1_0_b10             	(revision: 1.29)
	jdom_1_0_b10_rc1         	(revision: 1.29)
	after_rolf               	(revision: 1.28)
	before_rolf              	(revision: 1.28)
	jdom_1_0_b9              	(revision: 1.26)
	jdom_1_0_b8              	(revision: 1.20)
	jdom_prefilter           	(revision: 1.15)
	jdom_1_0_b7              	(revision: 1.15)
	jdom_1_0_b6              	(revision: 1.6)



More information about the jdom-commits mailing list