Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 88434 invoked from network); 11 Apr 2002 03:00:16 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 11 Apr 2002 03:00:16 -0000 Received: (qmail 26942 invoked by uid 97); 11 Apr 2002 03:00:23 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 26926 invoked by uid 97); 11 Apr 2002 03:00:23 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 26915 invoked by uid 97); 11 Apr 2002 03:00:22 -0000 Date: 11 Apr 2002 03:00:11 -0000 Message-ID: <20020411030011.86914.qmail@icarus.apache.org> From: dmitri@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath XMLDocumentContainer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dmitri 02/04/10 20:00:11 Modified: jxpath/src/java/org/apache/commons/jxpath XMLDocumentContainer.java Log: NPE when file is missing is now fixed Revision Changes Path 1.2 +11 -4 jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java Index: XMLDocumentContainer.java =================================================================== RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMLDocumentContainer.java 3 Sep 2001 01:22:30 -0000 1.1 +++ XMLDocumentContainer.java 11 Apr 2002 03:00:11 -0000 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v 1.1 2001/09/03 01:22:30 dmitri Exp $ - * $Revision: 1.1 $ - * $Date: 2001/09/03 01:22:30 $ + * $Header: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v 1.2 2002/04/11 03:00:11 dmitri Exp $ + * $Revision: 1.2 $ + * $Date: 2002/04/11 03:00:11 $ * * ==================================================================== * The Apache Software License, Version 1.1 @@ -82,7 +82,7 @@ * read at all. * * @author Dmitri Plotnikov - * @version $Revision: 1.1 $ $Date: 2001/09/03 01:22:30 $ + * @version $Revision: 1.2 $ $Date: 2002/04/11 03:00:11 $ */ public class XMLDocumentContainer implements Container { @@ -92,10 +92,16 @@ public XMLDocumentContainer(URL xmlURL){ this.xmlURL = xmlURL; + if (xmlURL == null){ + throw new RuntimeException("Source is null"); + } } public XMLDocumentContainer(Source source){ this.source = source; + if (source == null){ + throw new RuntimeException("Source is null"); + } } public Object getValue(){ @@ -120,7 +126,8 @@ } catch (Exception ex){ throw new RuntimeException("Cannot read XML from: " + - (xmlURL != null ? xmlURL.toString() : source.getSystemId()) + "\n" + ex); + (xmlURL != null ? xmlURL.toString() : + (source != null ? source.getSystemId() : "<>")) + "\n" + ex); } } return document; -- To unsubscribe, e-mail: For additional commands, e-mail: