Commit 5559bfc
authored
XmlParser: case-insensitive accept for nuget.config (#7317)
* Use case-insensitive comparison for nuget.config and packages.config in XmlParser
The XmlParser.accept() method used Path.endsWith() which is case-sensitive,
so files like NuGet.config or Packages.config were not recognized as XML and
fell through to the PlainTextParser. Switch to equalsIgnoreCase on the file
name to handle all casing variants.
* Also make file extension checks case-insensitive in XmlParser
Apply toLowerCase() to the extracted extension before checking against the
accepted set, so files like foo.XML or proj.Csproj are correctly recognized.1 parent 71809c7 commit 5559bfc
2 files changed
Lines changed: 11 additions & 4 deletions
File tree
- rewrite-xml/src
- main/java/org/openrewrite/xml
- test/java/org/openrewrite/xml
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
| 689 | + | |
689 | 690 | | |
| 691 | + | |
690 | 692 | | |
691 | | - | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
692 | 698 | | |
693 | 699 | | |
694 | 700 | | |
| |||
0 commit comments