Commit 8a95d55
[Xamarin.Android.Build.Tasks] Fix Removal of Non Duplicate elements (dotnet#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 b18f6d4 commit 8a95d55
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 | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
515 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
516 | 565 | | |
517 | 566 | | |
518 | 567 | | |
| |||
526 | 575 | | |
527 | 576 | | |
528 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
529 | 587 | | |
530 | 588 | | |
531 | 589 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
404 | 413 | | |
405 | 414 | | |
406 | | - | |
407 | | - | |
408 | | - | |
| 415 | + | |
409 | 416 | | |
410 | 417 | | |
411 | 418 | | |
| |||
0 commit comments