elharo opened a new issue, #282:
URL: https://github.com/apache/maven-dependency-analyzer/issues/282
## Bug Description
In `DefaultSignatureVisitor.java:38`, `visitInnerClassType("Entry")` adds
`"Entry"` to the result collector **without prepending the outer class name**.
The outer class context from the preceding `visitClassType(...)` call is lost.
For example, a generic signature like `Ljava/util/Map$Entry<TK;TV;>;`
produces calls:
1. `visitClassType("java/util/Map")` → records `"java/util/Map"` ✓
2. `visitInnerClassType("Entry")` → records `"Entry"` ✗ (should record
`"java/util/Map$Entry"`)
The recorded name `"Entry"` will never match any entry in the artifact class
map, so the inner class dependency is silently dropped.
## Impact
**All inner classes referenced through generic type signatures** (e.g.,
`Map.Entry`, `Map.SimpleEntry`, nested generic types in any parameterized
class) produce false "unused declared" / false "used undeclared" results. This
is a common pattern in Java.
## Suggested Fix
Track the current outer class context, e.g. via a `Deque<String>` in
`DefaultSignatureVisitor`, and construct the full internal name when visiting
inner class types:
```java
@Override
public void visitInnerClassType(final String name) {
String outer = outerClasses.peek();
resultCollector.addName(usedByClass, outer + "\$" + name);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]