Repository navigation
Commit dbe961c
Fix NPE on a recursive property reference in a list field (#13145)
DefaultModelInterpolator records an ERROR and returns null when the
interpolator throws on a recursive variable reference. The generated
transformer stores that null in List<String> model fields such as
build/filters, whose Properties sibling branch already guards against
it, and the immutable model constructor then copies the list with
List.copyOf. The build fails with a bare NullPointerException instead
of the "recursive variable reference" error that was just collected.
Return the original text instead, which is what the Properties branch
and StringVisitorModelInterpolator (MNG-8174) already do. The returned
instance is identical, so the transformer's newVal != oldVal check
stays false and unaffected models are still returned unchanged.
Co-authored-by: renechoi <115696395+renechoi@users.noreply.github.com>1 parent 3f0ed3f commit dbe961c
2 files changed
Lines changed: 25 additions & 1 deletion
File tree
- impl/maven-impl/src
- main/java/org/apache/maven/impl/model
- test/java/org/apache/maven/impl/model
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
635 | 655 | | |
636 | 656 | | |
637 | 657 | | |
| |||
0 commit comments