Glenn wrote :
> Pavani writes:
>
> >Please find the attached patch for AbstractSAXParser.
> >parse(inputSource) throws a NullPointerException if 'inputSource' is null.
>
> > + if (inputSource == null) {
> > + throw new SAXException("InputSource is null");
> > + }
>
> This seems like an unusual change to make to the Java implementation
> of a service. We could add hundreds of such checks where users are
> passing null in place of a required parameter.
We are making these checks wherever required.
> What is the rationale
> that the application should not receive a NullPointerException when
> they are in fact passing a null pointer ?
I feel letting the parser throw an NPE is not a good idea.
So, it'd better if we throw a SAXException (which is more informative)
wrapping the NPE.
> This is not a SAX error
> per se, but a programming error in using a Java API and Java has
> defined such exceptions for this purpose.
>
It's, of course, not a SAX error but the parse(..) documentation says
any SAX exception possibly wrapping another exception can be thrown.
Pavani
--
Pavani Mukthipudi
Sun Microsystems Inc.
Phone: 080 - 2298989 Extn: 87390
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]