Commit 0caa636
[Xamarin.Android.Build.Tasks] Fix Removal of Non Duplicate elements (#856)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59473
Commit d079a42 went a bit too far when removing duplicates.
It removed *any* duplicate entry that appeared anywhere in the
document. What we really wanted to remove full duplicates that
exist at the same level as the current element in the document.
For example:
```xml
<foo>
<bar name="bar1">
<bar2 />
</bar>
<bar name="bar2">
<bar2 />
</bar>
<dupe/>
<dupe/>
</foo>
```
`<bar2/>` should *not* be removed but one of the `<dupe/>` values
should. This commit reworks `RemoveDuplicates()` code to handle the
correct logic. It also adds a unit test for this exact senario.1 parent 81accb3 commit 0caa636
File tree
2 files changed
+68
-3
lines changed- src/Xamarin.Android.Build.Tasks
- Tests/Xamarin.Android.Build.Tests
- Utilities
2 files changed
+68
-3
lines changedLines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
547 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
548 | 597 | | |
549 | 598 | | |
550 | 599 | | |
| |||
558 | 607 | | |
559 | 608 | | |
560 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
561 | 619 | | |
562 | 620 | | |
563 | 621 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
405 | 414 | | |
406 | 415 | | |
407 | | - | |
408 | | - | |
409 | | - | |
| 416 | + | |
410 | 417 | | |
411 | 418 | | |
412 | 419 | | |
| |||
0 commit comments