PMD 7.0.0-rc4 finds no issues

Issue #2446 resolved
Alan Birchenough created an issue
  1. I opened the inspections settings using command-, and picked Salesforce > PMD.
  2. I clicked on the PMD DIstribution hyperlink.
  3. I downloaded pmd-dist-7.0.0-rc4-bin.zip.
  4. I unzipped it.
  5. I chose the expanded equivalent of ~/pmd/pmd-bin.7.0.0-rc4 as the distribution directory.
  6. I clicked on the PMD Ruleset hyperlink.
  7. I copied all the rules in the raw Github content, and pasted into ~/pmd/ruleset.xml.
  8. I chose this location for the ruleset setting.
  9. I ran “Run Inspection By Name…” and selected “PMD Salesforce”.
  10. I chose to run it on the whole project.

Result: No errors or warnings were generated.

Expected result: Errors or warnings would be generated.

What am I missing?

Thanks.

Official response

Comments (10)

  1. Scott Wells repo owner

    Alan, they have been changing the Java interface for PMD quite a bit in 7.x. I updated IC2 to work with 7.0.0-rc3 as well as 6.x a bit back and that required some non-trivial changes. It’s very possible (likely even) that 7.0.0-rc4 is changed yet again in an incompatible manner and requires some tweaks. I’ll take a look this week and, if so, try to target a compatible update for this Thursday’s build. In the interim, you can either install 7.0.0-rc3 or 6.55.0 as a workaround. Please let me know if you do that and see the same issues.

  2. Alan Birchenough reporter

    Thanks for letting me know. If I get a chance to try those other versions, I will let you know how it goes. For today, I ran PMD outside of IJ, just so I could keep going

    Regards, A.

  3. Scott Wells repo owner

    Yeah, whatever is going on is specific to this new release candidate. When IC2 calls the Java API to evaluate the current file, it comes back happily, but with nothing reported in RC4 whereas things are reported in RC3. I imagine there’s something I’ll need to change to accommodate, but right now I’m calling the API exactly as instructed by the PMD maintainers, and no errors/exceptions are occurring, so whatever needs to change isn’t obvious to me. They’re very responsive, though, so hopefully I’ll hear back from them later today or tomorrow and can test whatever they recommend.

  4. Scott Wells repo owner

    I figured it out. I needed to add two additional jars to the classpath of the dynamic classloader for some things that get used indirectly/transitively in RC4 vs. RC3. I don’t like that PMD isn’t raising clear exceptions about those being unresolvable, but I was able to set some breakpoints judiciously and see what was happening. I’ll include the fix in this week’s build and you’ll be able to safely update to 7.0.0-rc4. I’ll just need to keep a close eye on these RCs leading to GA and continue to adjust accordingly.

  5. Log in to comment