Open anuragagarwal561994 opened 1 week ago
This appears to be an issue parsing a classfile, so I need information about your dependencies. What version of Guava are you using?
When a field with not well known types are defined as non private field in an object, pmd is not able to analyse the class and breaks. While when the field is declared final, there is no such issue.
Can you clarify what you mean? What is a not well known type? The code sample you provided also has no non-private fields. Do you really mean final, or private? I don't see how adding a final modifier would change anything.
If you have time to put together a small repository with maven that shows the issue it would be a great help!
Guava version used here is 33.2.1-jre
In the above if you see impTransforms
field is non final but private. It can be re-declared in another method of the class.
Mostly this example should work, if not I will help you with setting up a repo.
When I say non well known type, I mean not List, Map etc. If I remove the field from the class it works, non well known is just an assumption because if I replace this with a map it works.
Affects PMD Version:
This is happening since pmd v7, but my test version is 7.7.0
Description:
When a field with not well known types are defined as non private field in an object, pmd is not able to analyse the class and breaks. While when the field is declared final, there is no such issue.
Exception Stacktrace:
Code Sample demonstrating the issue:
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Maven