Commit 7da8450
authored
fix: Fix Java type for annotated array parameters (#3797)
This update fixes the GraalVM reachability metadata generation for methods with annotated array parameters, such as `@Nullable String[]`.
Previously, the code computed the fully qualified class name for the parameter using the **raw** type, which retained the annotations (e.g., `@org.jspecify.annotations.Nullable java.lang.String`). This resulted in incorrect metadata that was ignored by GraalVM.
The issue is resolved by transforming the `DeclaredType` into a `TypeElement`, effectively removing any annotations, and then calling `getQualifiedName()` to correctly generate the fully qualified class name without annotations.1 parent c4df56e commit 7da8450
File tree
4 files changed
+81
-5
lines changed- log4j-core-test/src/test
- java/org/apache/logging/log4j/core/config/plugins/processor
- resources/GraalVmProcessorTest/java
- log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor
- src/changelog/.2.x.x
4 files changed
+81
-5
lines changedLines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
106 | 118 | | |
107 | 119 | | |
108 | 120 | | |
| |||
155 | 167 | | |
156 | 168 | | |
157 | 169 | | |
158 | | - | |
| 170 | + | |
| 171 | + | |
159 | 172 | | |
160 | 173 | | |
161 | 174 | | |
| |||
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
171 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
172 | 187 | | |
173 | 188 | | |
174 | 189 | | |
| |||
214 | 229 | | |
215 | 230 | | |
216 | 231 | | |
217 | | - | |
| 232 | + | |
218 | 233 | | |
219 | 234 | | |
220 | 235 | | |
| |||
250 | 265 | | |
251 | 266 | | |
252 | 267 | | |
253 | | - | |
254 | 268 | | |
255 | 269 | | |
256 | 270 | | |
| |||
260 | 274 | | |
261 | 275 | | |
262 | 276 | | |
| 277 | + | |
| 278 | + | |
263 | 279 | | |
264 | 280 | | |
265 | 281 | | |
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments