Commit db84f2a
Fix findAnnotations() for standalone/fat Multi-Release JARs
NameLookup.findType() with ACCEPT_ANNOTATIONS may fail to resolve
annotation types from standalone/fat Multi-Release JARs such as
junit-platform-console-standalone-1.13.4.jar. This causes JUnit 5
test launches to fail with "Cannot find Testable on project build path".
Add a fallback that retries with ACCEPT_ALL when the strict
ACCEPT_ANNOTATIONS lookup finds nothing. The fallback still enforces
access restrictions (checkRestrictions=true + isNonAccessible check)
and verifies the resolved type is actually an annotation, so the
PDE forbidden-transitive-dependency case remains protected.
The fallback is skipped when the original lookup found the type but
it was access-restricted, to avoid reviving forbidden dependencies.
Fixes: #2959
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4951d4e commit db84f2a
1 file changed
Lines changed: 29 additions & 2 deletions
File tree
- org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/util
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
368 | | - | |
369 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
370 | 397 | | |
371 | 398 | | |
372 | 399 | | |
| |||
0 commit comments