Commit 7812c56
Fix false positive for static inner class implementing parent interface
When a static inner class implements its parent interface (e.g.,
StateObjectFactory
containing StateObjectFactoryProxy implements StateObjectFactory), API
tools was
incorrectly reporting "implements non-API interface" leak warnings.
Root cause: ReferenceExtractor.consider() only checked if referenced
type starts
with current type name (to exclude member type references), but didn't
check the
reverse case where current type is a member of referenced type.
Fix: Added check in ReferenceExtractor.consider() to also exclude
references when
the current type name starts with referencedTypeName + "$", indicating a
member
type referencing its enclosing type.
Test: Added Etest15.java test case and corresponding test methods in
InterfaceExtendsLeak.java to verify static inner classes implementing
parent
interfaces don't produce false positive warnings.1 parent a4050fe commit 7812c56
File tree
3 files changed
+63
-0
lines changed- apitools
- org.eclipse.pde.api.tools.tests
- src/org/eclipse/pde/api/tools/builder/tests/leak
- test-builder/leak/interface
- org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder
3 files changed
+63
-0
lines changedLines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
374 | 398 | | |
Lines changed: 30 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 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1013 | 1022 | | |
1014 | 1023 | | |
1015 | 1024 | | |
| |||
0 commit comments