Skip to content

[java] Fix NoClassDefFoundErrors#2685

Merged
adangel merged 5 commits into
pmd:masterfrom
adangel:issue-2663
Aug 21, 2020
Merged

[java] Fix NoClassDefFoundErrors#2685
adangel merged 5 commits into
pmd:masterfrom
adangel:issue-2663

Conversation

@adangel

@adangel adangel commented Jul 31, 2020

Copy link
Copy Markdown
Member

Describe the PR

When determining methods/fields by reflection, we could run into situations, that the classes, that are referenced in the methods (e.g. parameter types, return types) are not on the auxclasspath. Then a LinkageError is thrown, which was not handled before.

The reason, why the types are missing on the auxclasspath is actually a valid case: As long as the methods are not used in the code, the referenced classes neither need to be on the compile classpath. And we use the compile classpath as our auxclasspath.

This can happen, if a project uses a provided dependency and this dependency has other transitive dependencies. These transitive dependencies are not on the compile classpath.

This PR fixes the problem in ImportWrapper as well as in two other cases, where we use reflection.

Related issues

Ready?

@adangel adangel added this to the 6.27.0 milestone Jul 31, 2020
@ghost

ghost commented Jul 31, 2020

Copy link
Copy Markdown
1 Message
📖 This changeset introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report
This changeset introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala mentioned this pull request Aug 1, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] NoClassDefFoundError on upgrade from 6.25.0 to 6.26.0

2 participants