@@ -581,13 +581,11 @@ private ComparisonState compareNodeLists(Iterable<Node> allControlChildren,
581
581
582
582
Iterable <Map .Entry <Node , Node >> matches =
583
583
getNodeMatcher ().match (controlSeq , testSeq );
584
- List <Node > controlListForXpath = Linqy .asList (allControlChildren );
585
- List <Node > testListForXpath = Linqy .asList (allTestChildren );
586
584
List <Node > controlList = Linqy .asList (controlSeq );
587
585
List <Node > testList = Linqy .asList (testSeq );
588
586
589
- final Map <Node , Integer > controlListForXpathIndex = index (controlListForXpath );
590
- final Map <Node , Integer > testListForXpathIndex = index (testListForXpath );
587
+ final Map <Node , Integer > controlListForXpathIndex = index (allControlChildren );
588
+ final Map <Node , Integer > testListForXpathIndex = index (allTestChildren );
591
589
final Map <Node , Integer > controlListIndex = index (controlList );
592
590
final Map <Node , Integer > testListIndex = index (testList );
593
591
@@ -628,26 +626,23 @@ public ComparisonState apply() {
628
626
}
629
627
}
630
628
631
- return chain .andThen (new UnmatchedControlNodes (controlListForXpath , controlListForXpathIndex ,
632
- controlList , controlContext , seen , testContext ))
633
- .andThen (new UnmatchedTestNodes (testListForXpath , testListForXpathIndex , testList ,
629
+ return chain .andThen (new UnmatchedControlNodes (controlListForXpathIndex , controlList ,
630
+ controlContext , seen , testContext ))
631
+ .andThen (new UnmatchedTestNodes (testListForXpathIndex , testList ,
634
632
testContext , seen , controlContext ));
635
633
}
636
634
637
635
private class UnmatchedControlNodes implements DeferredComparison {
638
- private final List <Node > controlListForXpath ;
639
636
private final Map <Node , Integer > controlListForXpathIndex ;
640
637
private final List <Node > controlList ;
641
638
private final XPathContext controlContext ;
642
639
private final Set <Node > seen ;
643
640
private final XPathContext testContext ;
644
641
645
- private UnmatchedControlNodes (List <Node > controlListForXpath ,
646
- Map <Node , Integer > controlListForXpathIndex ,
642
+ private UnmatchedControlNodes (Map <Node , Integer > controlListForXpathIndex ,
647
643
List <Node > controlList ,
648
644
XPathContext controlContext ,
649
645
Set <Node > seen , XPathContext testContext ) {
650
- this .controlListForXpath = controlListForXpath ;
651
646
this .controlListForXpathIndex = controlListForXpathIndex ;
652
647
this .controlList = controlList ;
653
648
this .controlContext = controlContext ;
@@ -679,18 +674,15 @@ public ComparisonState apply() {
679
674
}
680
675
681
676
private class UnmatchedTestNodes implements DeferredComparison {
682
- private final List <Node > testListForXpath ;
683
677
private final Map <Node , Integer > testListForXpathIndex ;
684
678
private final List <Node > testList ;
685
679
private final XPathContext testContext ;
686
680
private final Set <Node > seen ;
687
681
private final XPathContext controlContext ;
688
682
689
- private UnmatchedTestNodes (List <Node > testListForXpath ,
690
- Map <Node , Integer > testListForXpathIndex ,
683
+ private UnmatchedTestNodes (Map <Node , Integer > testListForXpathIndex ,
691
684
List <Node > testList , XPathContext testContext ,
692
685
Set <Node > seen , XPathContext controlContext ) {
693
- this .testListForXpath = testListForXpath ;
694
686
this .testListForXpathIndex = testListForXpathIndex ;
695
687
this .testList = testList ;
696
688
this .testContext = testContext ;
@@ -896,7 +888,7 @@ private static Attr findMatchingAttr(final List<Attr> attrs,
896
888
return null ;
897
889
}
898
890
899
- private static Map <Node , Integer > index (final List <Node > nodes ) {
891
+ private static Map <Node , Integer > index (final Iterable <Node > nodes ) {
900
892
Map <Node , Integer > indices = new HashMap <Node , Integer >();
901
893
int idx = 0 ;
902
894
for (Node n : nodes ) {
0 commit comments