Commit d4df178
authored
Skip unparseable Java versions in FindJavaVersion instead of reporting -1 (#1125)
* Skip unparseable Java versions in FindJavaVersion instead of reporting -1
A JavaVersion marker whose source/target compatibility cannot be parsed
reports a major version of -1. FindJavaVersion stringified that straight
into the data table, so repositories surfaced a bogus -1 row. Worse, the
lower() reduction keeps the lowest version per repository, and -1 sorts
below every real version, so a single module with an undetermined version
dragged the whole repository's reported version to -1.
Skip markers whose source or target major version is negative: they carry
no usable version, so they neither emit a -1 row nor mask the real
versions of sibling modules. When no module has a parseable version the
repository simply contributes no row.
* Drop FindJavaVersion all-unknown test that asserts an absent data table
When the recipe emits no rows the JavaVersionTable is absent rather than
present-but-empty, so the dataTable assertion throws. The skip behavior is
already covered by unknownVersionMarkersAreSkipped.1 parent b8a298e commit d4df178
2 files changed
Lines changed: 46 additions & 2 deletions
File tree
- src
- main/java/org/openrewrite/java/migrate/search
- test/java/org/openrewrite/java/migrate/search
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
| |||
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
75 | | - | |
76 | | - | |
| 86 | + | |
| 87 | + | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
146 | 179 | | |
147 | 180 | | |
148 | 181 | | |
| |||
0 commit comments