@@ -130,7 +130,9 @@ public final class ChildrenIterator extends InternalAxisIteratorBase {
130
130
@ Override
131
131
public void setStartNode (int node ) {
132
132
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
133
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
133
+ if (node == DTMDefaultBase .ROOTNODE ) {
134
+ node = getDocument ();
135
+ }
134
136
if (_isRestartable ) {
135
137
_startNode = node ;
136
138
_currentNode = (node == DTM .NULL ) ? DTM .NULL : _firstch (makeNodeIdentity (node ));
@@ -162,7 +164,9 @@ public final class ParentIterator extends InternalAxisIteratorBase {
162
164
@ Override
163
165
public void setStartNode (int node ) {
164
166
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
165
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
167
+ if (node == DTMDefaultBase .ROOTNODE ) {
168
+ node = getDocument ();
169
+ }
166
170
if (_isRestartable ) {
167
171
_startNode = node ;
168
172
_currentNode = getParent (node );
@@ -199,7 +203,9 @@ public NamespaceIterator() {
199
203
@ Override
200
204
public void setStartNode (int node ) {
201
205
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
202
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
206
+ if (node == DTMDefaultBase .ROOTNODE ) {
207
+ node = getDocument ();
208
+ }
203
209
if (_isRestartable ) {
204
210
_startNode = node ;
205
211
_currentNode = getFirstNamespaceNode (node , true );
@@ -214,7 +220,9 @@ public int next() {
214
220
215
221
final int node = _currentNode ;
216
222
217
- if (DTM .NULL != node ) _currentNode = getNextNamespaceNode (_startNode , node , true );
223
+ if (DTM .NULL != node ) {
224
+ _currentNode = getNextNamespaceNode (_startNode , node , true );
225
+ }
218
226
219
227
return returnNode (node );
220
228
}
@@ -244,7 +252,9 @@ public void setStartNode(final int node) {
244
252
/** {@inheritDoc} */
245
253
@ Override
246
254
public int next () {
247
- if (_startNode == _currentNode ) return NULL ;
255
+ if (_startNode == _currentNode ) {
256
+ return NULL ;
257
+ }
248
258
249
259
_currentNode = _startNode ;
250
260
@@ -259,7 +269,9 @@ public class FollowingSiblingIterator extends InternalAxisIteratorBase {
259
269
@ Override
260
270
public void setStartNode (int node ) {
261
271
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
262
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
272
+ if (node == DTMDefaultBase .ROOTNODE ) {
273
+ node = getDocument ();
274
+ }
263
275
if (_isRestartable ) {
264
276
_startNode = node ;
265
277
_currentNode = makeNodeIdentity (node );
@@ -285,7 +297,9 @@ public final class AttributeIterator extends InternalAxisIteratorBase {
285
297
@ Override
286
298
public void setStartNode (int node ) {
287
299
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
288
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
300
+ if (node == DTMDefaultBase .ROOTNODE ) {
301
+ node = getDocument ();
302
+ }
289
303
if (_isRestartable ) {
290
304
_startNode = node ;
291
305
_currentNode = getFirstAttributeIdentity (makeNodeIdentity (node ));
@@ -325,7 +339,9 @@ public boolean isReverse() {
325
339
@ Override
326
340
public void setStartNode (int node ) {
327
341
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
328
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
342
+ if (node == DTMDefaultBase .ROOTNODE ) {
343
+ node = getDocument ();
344
+ }
329
345
if (_isRestartable ) {
330
346
_startNode = node ;
331
347
node = _startNodeID = makeNodeIdentity (node );
@@ -343,8 +359,12 @@ public void setStartNode(int node) {
343
359
else {
344
360
// Be careful to handle the Document node properly
345
361
_currentNode = _parent (node );
346
- if (NULL != _currentNode ) _currentNode = _firstch (_currentNode );
347
- else _currentNode = node ;
362
+ if (NULL != _currentNode ) {
363
+ _currentNode = _firstch (_currentNode );
364
+ }
365
+ else {
366
+ _currentNode = node ;
367
+ }
348
368
}
349
369
350
370
resetPosition ();
@@ -413,14 +433,18 @@ public DTMAxisIterator cloneIterator() {
413
433
@ Override
414
434
public void setStartNode (int node ) {
415
435
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
416
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
436
+ if (node == DTMDefaultBase .ROOTNODE ) {
437
+ node = getDocument ();
438
+ }
417
439
if (_isRestartable ) {
418
440
node = makeNodeIdentity (node );
419
441
420
442
// iterator is not a clone
421
443
int parent , index ;
422
444
423
- if (_type (node ) == DTM .ATTRIBUTE_NODE ) node = _parent (node );
445
+ if (_type (node ) == DTM .ATTRIBUTE_NODE ) {
446
+ node = _parent (node );
447
+ }
424
448
425
449
_startNode = node ;
426
450
_stack [index = 0 ] = node ;
@@ -434,7 +458,9 @@ public void setStartNode(int node) {
434
458
}
435
459
_stack [index ] = parent ;
436
460
}
437
- if (index > 0 ) --index ; // Pop actual root node (if not start) back off the stack
461
+ if (index > 0 ) {
462
+ --index ; // Pop actual root node (if not start) back off the stack
463
+ }
438
464
439
465
_currentNode = _stack [index ]; // Last parent before root node
440
466
@@ -452,10 +478,13 @@ public int next() {
452
478
// the tail-recursion.
453
479
for (++_currentNode ; _sp >= 0 ; ++_currentNode ) {
454
480
if (_currentNode < _stack [_sp ]) {
455
- if (_type (_currentNode ) != ATTRIBUTE_NODE && _type (_currentNode ) != NAMESPACE_NODE )
481
+ if (_type (_currentNode ) != ATTRIBUTE_NODE && _type (_currentNode ) != NAMESPACE_NODE ) {
456
482
return returnNode (makeNodeHandle (_currentNode ));
483
+ }
484
+ }
485
+ else {
486
+ --_sp ;
457
487
}
458
- else --_sp ;
459
488
}
460
489
return NULL ;
461
490
}
@@ -484,7 +513,9 @@ public FollowingIterator() {
484
513
@ Override
485
514
public void setStartNode (int node ) {
486
515
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
487
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
516
+ if (node == DTMDefaultBase .ROOTNODE ) {
517
+ node = getDocument ();
518
+ }
488
519
if (_isRestartable ) {
489
520
_startNode = node ;
490
521
_currentNode = m_traverser .first (node );
@@ -545,7 +576,9 @@ public DTMAxisIterator cloneIterator() {
545
576
@ Override
546
577
public void setStartNode (int node ) {
547
578
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
548
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
579
+ if (node == DTMDefaultBase .ROOTNODE ) {
580
+ node = getDocument ();
581
+ }
549
582
550
583
if (_isRestartable ) {
551
584
int nodeID = makeNodeIdentity (node );
@@ -602,12 +635,16 @@ public class DescendantIterator extends InternalAxisIteratorBase {
602
635
@ Override
603
636
public void setStartNode (int node ) {
604
637
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
605
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
638
+ if (node == DTMDefaultBase .ROOTNODE ) {
639
+ node = getDocument ();
640
+ }
606
641
if (_isRestartable ) {
607
642
node = makeNodeIdentity (node );
608
643
_startNode = node ;
609
644
610
- if (_includeSelf ) node --;
645
+ if (_includeSelf ) {
646
+ node --;
647
+ }
611
648
612
649
_currentNode = node ;
613
650
@@ -638,8 +675,9 @@ public int next() {
638
675
return NULL ;
639
676
}
640
677
641
- if (_includeSelf && (_currentNode + 1 ) == _startNode )
678
+ if (_includeSelf && (_currentNode + 1 ) == _startNode ) {
642
679
return returnNode (makeNodeHandle (++_currentNode )); // | m_dtmIdent);
680
+ }
643
681
644
682
int node = _currentNode ;
645
683
int type ;
@@ -699,7 +737,9 @@ public SingletonIterator(final int node, final boolean constant) {
699
737
@ Override
700
738
public void setStartNode (int node ) {
701
739
// %HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
702
- if (node == DTMDefaultBase .ROOTNODE ) node = getDocument ();
740
+ if (node == DTMDefaultBase .ROOTNODE ) {
741
+ node = getDocument ();
742
+ }
703
743
if (_isConstant ) {
704
744
_currentNode = _startNode ;
705
745
0 commit comments