commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model VariablePointer.java
Date Mon, 20 Jan 2003 00:07:53 GMT
dmitri      2003/01/19 16:07:53

  Modified:    jxpath/src/java/org/apache/commons/jxpath/ri/model
                        VariablePointer.java
  Log:
  Refix: accidentally undid a previous fix
  
  Revision  Changes    Path
  1.13      +16 -6     jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/VariablePointer.java
  
  Index: VariablePointer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/VariablePointer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- VariablePointer.java	19 Jan 2003 23:58:27 -0000	1.12
  +++ VariablePointer.java	20 Jan 2003 00:07:52 -0000	1.13
  @@ -68,6 +68,7 @@
   import org.apache.commons.jxpath.Variables;
   import org.apache.commons.jxpath.ri.QName;
   import org.apache.commons.jxpath.ri.compiler.NodeTest;
  +import org.apache.commons.jxpath.ri.model.beans.NullPointer;
   import org.apache.commons.jxpath.util.ValueUtils;
   
   /**
  @@ -157,12 +158,21 @@
               Object value = null;
               if (actual) {
                   value = getImmediateNode();
  +                valuePointer =
  +                    NodePointer.newChildNodePointer(this, null, value);
  +            }
  +            else {
  +                return new NullPointer(this, getName()) {
  +                    public Object getImmediateNode() {
  +                        throw new JXPathException(
  +                            "Undefined variable: " + name);
  +                    }
  +                };
               }
  -            valuePointer = NodePointer.newChildNodePointer(this, null, value);
           }
           return valuePointer;
       }
  -
  +    
       public int getLength() {
           if (actual) {
               Object value = getBaseValue();
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message