Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 64035 invoked by uid 500); 21 Aug 2002 06:44:00 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 64026 invoked by uid 500); 21 Aug 2002 06:43:59 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 21 Aug 2002 06:43:58 -0000 Message-ID: <20020821064358.18040.qmail@icarus.apache.org> From: cziegeler@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/webapps/session/xml XMLUtil.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N cziegeler 2002/08/20 23:43:58 Modified: src/java/org/apache/cocoon/webapps/session/xml XMLUtil.java Log: Adding more meaning to NPE. Revision Changes Path 1.5 +11 -3 xml-cocoon2/src/java/org/apache/cocoon/webapps/session/xml/XMLUtil.java Index: XMLUtil.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/session/xml/XMLUtil.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- XMLUtil.java 24 Jun 2002 12:42:50 -0000 1.4 +++ XMLUtil.java 21 Aug 2002 06:43:58 -0000 1.5 @@ -827,13 +827,21 @@ * this node is searched for a child named path[1]... */ public static NodeList getNodeListFromPath(Node contextNode, - String[] path) { + String[] path) { if (contextNode == null) return new NodeListImpl(); if (path == null || path.length == 0) { return new NodeListImpl(new Node[] {contextNode}); } NodeListImpl result = new NodeListImpl(); - getNodesFromPath(result, contextNode, path, 0); + try { + getNodesFromPath(result, contextNode, path, 0); + } catch (NullPointerException npe) { + // this NPE is thrown because the parser iss not configured + // to use DOM Level 2 + throw new NullPointerException("XMLUtil.getNodeListFromPath() did catch a NullPointerException."+ + "This might be due to a missconfigured XML parser which does not use DOM Level 2."+ + "Make sure that you use the XML parser shipped with Cocoon."); + } return result; } ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org