Skip to content

Check the code quality with PMD

Eric Bruneton requested to merge check-code-quality-with-pmd into master

I split the changes in several commits for easier review. The remaining warnings are related to missing defensive copy of the arrays we get from or return to the user (https://pmd.github.io/pmd-6.5.0/pmd_rules_java_bestpractices.html#arrayisstoreddirectly, https://pmd.github.io/pmd-6.5.0/pmd_rules_java_bestpractices.html#methodreturnsinternalarray). We should probably do this defensive copy, for better safety.

For ConstantDynamic, since it was experimental in the last published version, we still have the opportunity to change its API to avoid some defensive copying. For instance, instead of getBootstrapMethodArguments(), we can use getBootstrapMethodArgumentCount() and getBootstrapMethodArgument(int), as we do in TypePath. What do you think?

Edited by Eric Bruneton

Merge request reports