[jdom-commits] CVS update: jdom/src/java/org/jdom/input

jhunter at cvs.jdom.org jhunter at cvs.jdom.org
Sun Nov 4 23:58:48 PST 2001

Date:	Monday November 5, 2001 @ 7:58
Author:	jhunter

Update of /home/cvspublic/jdom/src/java/org/jdom/input
In directory www.nmemonix.com:/tmp/cvs-serv12672

Modified Files:
Log Message:
Fixed bug where SAXBuilder would cache the class name even when using
JAXP to create the parser, causing problems for parsers without no-arg

Says Laurent Bihanic <laurent.bihanic at atosorigin.com> responding to a 
bug report from Alastair Rodgers <alastair.rodgers at PHOCIS.COM>:

 This is actually a known problem in SAXBuilder: On the first call to 
 createParser (via build), SAXBuilder caches the class name of the SAX parser, 
 even when JAXP was used to create the parser instance:
 462              saxDriverClass = parser.getClass().getName();

 If you try to reuse a SAXBuilder instance, it will not longer use JAXP to 
 create the parser but will use:
          if (saxDriverClass != null) {
              // The user knows that they want to use a particular class
              parser = XMLReaderFactory.createXMLReader(saxDriverClass);
              // System.out.println("using specific " + saxDriverClass);
          } else {

 In this case, BEA are not wrong: they just have no no-args public contructor 
 for their parser, which makes it inedible by XMLReaderFactory.

 This issue has already been discussed on this list but no changes were made to 
 SAXBuilder (but I don't remember why!). So, my fix is just to comment out the 
 line "saxDriverClass = ..." in the JAXP part of createParser every time I get 
 a new JDOM version.


File: no file SAXBuilder.java		Status: Needs Checkout

   Working revision:	1.59	Mon Nov  5 07:58:48 2001
   Repository revision:	1.59	/home/cvspublic/jdom/src/java/org/jdom/input/SAXBuilder.java,v

   Existing Tags:
	jdom_1_0_b7              	(revision: 1.53)
	jdom_1_0_b6              	(revision: 1.34)
	start                    	(revision:
	jdom                     	(branch: 1.1.1)

More information about the jdom-commits mailing list