[jdom-interest] Protected methods to make private

Laurent Bihanic laurent.bihanic at atosorigin.com
Thu Jun 26 07:41:47 PDT 2003


Hi,

Jason Hunter wrote:
>> getCurrentElement can be made public.
>> Yet ElementScanner.ElementBuilder needs to override it because it 
>> builds rootlees subtrees and thus has to remove the consistency checks 
>> SAXHandler's getCurrentElement does. If currentElement is made 
>> private, ElementScanner.ElementBuilder.getCurrentElement() will look 
>> like:
>>
>>       public Element getCurrentElement() throws SAXException {
>>          try {
>>             return super.getCurrentElement();
>>          }
>>          catch (SAXException e) {
>>             return null;
>>          }
>>       }
> 
> So right now we have getCurrentElement() public.  Laurent, could you 
> please make the above change to ElementBuilder, test it, and send in a 
> patch if everything looks to work?

I'm a little bit surprised but ElementBuilder has been removed from 
ElementScanner in CVS and replaced by SAXHandler.
Has anybody validated this ? IMHO this won't work because 
SAXHandler.getCurrentElement throws an exception if there's no current 
element, which is a very common case in ElementScanner when no filter selects 
the document root.

Brad, I suppose you made this patch. Have you run any test ?

Laurent




More information about the jdom-interest mailing list