@@ -44,7 +44,7 @@ public class VariablePointer extends NodePointer {
4444 /**
4545 * Qualified name.
4646 */
47- private final QName name ;
47+ private final QName qName ;
4848
4949 /**
5050 * Value pointer.
@@ -59,32 +59,32 @@ public class VariablePointer extends NodePointer {
5959 /**
6060 * Constructs a new (non-actual) VariablePointer.
6161 *
62- * @param name variable name
62+ * @param qName variable name
6363 */
64- public VariablePointer (final QName name ) {
64+ public VariablePointer (final QName qName ) {
6565 super (null );
66- this .name = name ;
66+ this .qName = qName ;
6767 actual = false ;
6868 }
6969
7070 /**
7171 * Constructs a new VariablePointer.
7272 *
7373 * @param variables Variables instance
74- * @param name variable name
74+ * @param qName variable name
7575 */
76- public VariablePointer (final Variables variables , final QName name ) {
76+ public VariablePointer (final Variables variables , final QName qName ) {
7777 super (null );
7878 this .variables = variables ;
79- this .name = name ;
79+ this .qName = qName ;
8080 actual = true ;
8181 }
8282
8383 @ Override
8484 public String asPath () {
8585 final StringBuilder buffer = new StringBuilder ();
8686 buffer .append ('$' );
87- buffer .append (name );
87+ buffer .append (qName );
8888 if (!actual ) {
8989 if (index != WHOLE_COLLECTION ) {
9090 buffer .append ('[' ).append (index + 1 ).append (']' );
@@ -96,8 +96,8 @@ public String asPath() {
9696 }
9797
9898 @ Override
99- public NodeIterator attributeIterator (final QName name ) {
100- return getValuePointer ().attributeIterator (name );
99+ public NodeIterator attributeIterator (final QName qName ) {
100+ return getValuePointer ().attributeIterator (qName );
101101 }
102102
103103 @ Override
@@ -111,7 +111,7 @@ public int compareChildNodePointers(final NodePointer pointer1, final NodePointe
111111 }
112112
113113 @ Override
114- public NodePointer createChild (final JXPathContext context , final QName name , final int index ) {
114+ public NodePointer createChild (final JXPathContext context , final QName qName , final int index ) {
115115 final Object collection = createCollection (context , index );
116116 if (!isActual () || index != 0 && index != WHOLE_COLLECTION ) {
117117 final AbstractFactory factory = getAbstractFactory (context );
@@ -127,7 +127,7 @@ public NodePointer createChild(final JXPathContext context, final QName name, fi
127127 }
128128
129129 @ Override
130- public NodePointer createChild (final JXPathContext context , final QName name , final int index , final Object value ) {
130+ public NodePointer createChild (final JXPathContext context , final QName qName , final int index , final Object value ) {
131131 final Object collection = createCollection (context , index );
132132 ValueUtils .setValue (collection , index , value );
133133 final NodePointer cl = (NodePointer ) clone ();
@@ -146,7 +146,7 @@ private Object createCollection(final JXPathContext context, int index) {
146146 createPath (context );
147147 Object collection = getBaseValue ();
148148 if (collection == null ) {
149- throw new JXPathAbstractFactoryException ("Factory did not assign a collection to variable '" + name + "' for path: " + asPath ());
149+ throw new JXPathAbstractFactoryException ("Factory did not assign a collection to variable '" + qName + "' for path: " + asPath ());
150150 }
151151 if (index == WHOLE_COLLECTION ) {
152152 index = 0 ;
@@ -155,7 +155,7 @@ private Object createCollection(final JXPathContext context, int index) {
155155 }
156156 if (index >= getLength ()) {
157157 collection = ValueUtils .expandCollection (collection , index + 1 );
158- variables .declareVariable (name .toString (), collection );
158+ variables .declareVariable (qName .toString (), collection );
159159 }
160160 return collection ;
161161 }
@@ -164,8 +164,8 @@ private Object createCollection(final JXPathContext context, int index) {
164164 public NodePointer createPath (final JXPathContext context ) {
165165 if (!actual ) {
166166 final AbstractFactory factory = getAbstractFactory (context );
167- if (!factory .declareVariable (context , name .toString ())) {
168- throw new JXPathAbstractFactoryException ("Factory cannot define variable '" + name + "' for path: " + asPath ());
167+ if (!factory .declareVariable (context , qName .toString ())) {
168+ throw new JXPathAbstractFactoryException ("Factory cannot define variable '" + qName + "' for path: " + asPath ());
169169 }
170170 findVariables (context );
171171 // Assert: actual == true
@@ -193,7 +193,7 @@ public boolean equals(final Object object) {
193193 return false ;
194194 }
195195 final VariablePointer other = (VariablePointer ) object ;
196- return variables == other .variables && name .equals (other .name ) && index == other .index ;
196+ return variables == other .variables && qName .equals (other .qName ) && index == other .index ;
197197 }
198198
199199 /**
@@ -206,7 +206,7 @@ protected void findVariables(final JXPathContext context) {
206206 JXPathContext varCtx = context ;
207207 while (varCtx != null ) {
208208 variables = varCtx .getVariables ();
209- if (variables .isDeclaredVariable (name .toString ())) {
209+ if (variables .isDeclaredVariable (qName .toString ())) {
210210 actual = true ;
211211 break ;
212212 }
@@ -218,9 +218,9 @@ protected void findVariables(final JXPathContext context) {
218218 @ Override
219219 public Object getBaseValue () {
220220 if (!actual ) {
221- throw new JXPathException ("Undefined variable: " + name );
221+ throw new JXPathException ("Undefined variable: " + qName );
222222 }
223- return variables .getVariable (name .toString ());
223+ return variables .getVariable (qName .toString ());
224224 }
225225
226226 @ Override
@@ -240,7 +240,7 @@ public NodePointer getImmediateValuePointer() {
240240
241241 @ Override
242242 public Object getImmediateNode () {
243- throw new JXPathException ("Undefined variable: " + name );
243+ throw new JXPathException ("Undefined variable: " + qName );
244244 }
245245 };
246246 }
@@ -261,12 +261,12 @@ public int getLength() {
261261
262262 @ Override
263263 public QName getName () {
264- return name ;
264+ return qName ;
265265 }
266266
267267 @ Override
268268 public int hashCode () {
269- return (actual ? System .identityHashCode (variables ) : 0 ) + name .hashCode () + index ;
269+ return (actual ? System .identityHashCode (variables ) : 0 ) + qName .hashCode () + index ;
270270 }
271271
272272 @ Override
@@ -305,15 +305,15 @@ public NodePointer namespacePointer(final String name) {
305305 public void remove () {
306306 if (actual ) {
307307 if (index == WHOLE_COLLECTION ) {
308- variables .undeclareVariable (name .toString ());
308+ variables .undeclareVariable (qName .toString ());
309309 } else {
310310 if (index < 0 ) {
311311 throw new JXPathInvalidAccessException ("Index is less than 1: " + asPath ());
312312 }
313313 Object collection = getBaseValue ();
314314 if (collection != null && index < getLength ()) {
315315 collection = ValueUtils .remove (collection , index );
316- variables .declareVariable (name .toString (), collection );
316+ variables .declareVariable (qName .toString (), collection );
317317 }
318318 }
319319 }
@@ -328,14 +328,14 @@ public void setIndex(final int index) {
328328 @ Override
329329 public void setValue (final Object value ) {
330330 if (!actual ) {
331- throw new JXPathException ("Cannot set undefined variable: " + name );
331+ throw new JXPathException ("Cannot set undefined variable: " + qName );
332332 }
333333 valuePointer = null ;
334334 if (index != WHOLE_COLLECTION ) {
335335 final Object collection = getBaseValue ();
336336 ValueUtils .setValue (collection , index , value );
337337 } else {
338- variables .declareVariable (name .toString (), value );
338+ variables .declareVariable (qName .toString (), value );
339339 }
340340 }
341341
0 commit comments