You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dm...@apache.org on 2002/08/10 03:30:39 UTC

cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri JXPathContextReferenceImpl.java

dmitri      2002/08/09 18:30:39

  Modified:    jxpath/src/java/org/apache/commons/jxpath/ri
                        JXPathContextReferenceImpl.java
  Log:
  Should not return a NullPointer in the non-lenient mode
  
  Revision  Changes    Path
  1.20      +16 -4     jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
  
  Index: JXPathContextReferenceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JXPathContextReferenceImpl.java	8 Jun 2002 22:47:25 -0000	1.19
  +++ JXPathContextReferenceImpl.java	10 Aug 2002 01:30:39 -0000	1.20
  @@ -99,12 +99,21 @@
           nodeFactories.add(new CollectionPointerFactory());
           nodeFactories.add(new BeanPointerFactory());
           nodeFactories.add(new DynamicPointerFactory());
  +
           Object domFactory = allocateConditionally(
                   "org.apache.commons.jxpath.ri.model.dom.DOMPointerFactory",
                   "org.w3c.dom.Node");
           if (domFactory != null){
               nodeFactories.add(domFactory);
           }
  +/* TBD
  +        Object jdomFactory = allocateConditionally(
  +                "org.apache.commons.jxpath.ri.model.jdom.JDOMPointerFactory",
  +                "org.jdom.Document");
  +        if (jdomFactory != null){
  +            nodeFactories.add(jdomFactory);
  +        }
  +*/
           nodeFactories.add(new ContainerPointerFactory());
           createNodeFactoryArray();
       }
  @@ -261,6 +270,9 @@
               result = ((EvalContext)result).getSingleNodePointer();
           }
           if (result instanceof Pointer){
  +            if (!lenient && !((NodePointer)result).isActual()){
  +                throw new JXPathException("No pointer for xpath: " + xpath);
  +            }
               return (Pointer)result;
           }
           else {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>