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:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to