pmd / pmd-eclipse-plugin

The pmd-eclipse-plugin integrates the source code analyzer PMD into the Eclipse IDE
Other
93 stars 43 forks source link

Project properties: The currently displayed page contains invalid values #117

Open numeralnathan opened 4 years ago

numeralnathan commented 4 years ago

I clicked on Project > Properties and then selected the PMD tab. I get the following error message:

Title: Could Not Accept Changes Message: The currently displayed page contains invalid values.

The content section of the window is blank.

I tried uninstalling and re-installing the plugin and I get the same error.

Are there some property files I can remove to workaround this problem.

I am running Eclipse 2019-12 (4.14.0) build id 20191212-1212 with PMD Plug-in version 4.10.1.v20200207-1909 on Windows 10 version 1903. I am running Eclipse on HotSpot 11.0.4.

In Eclipse's Error Log, I see 2 errors: Error instantiating a rule and Problems occurred when invoking code from plug-in: "org.eclipse.jface". The latter has an exception ClassNotFoundException. The message complains about a class for a custom Java rule I wrote. I removed the custom rule from my PMD ruleset XML file and I can now see the property page.

How do I add my custom class so that the PMD plugin can use it? I tried "Select a working set..." on the property page but that did not seem to work.

numeralnathan commented 4 years ago

The following steps did not help...

  1. Close Eclipse IDE
  2. Open the folder ...\.metadata.plugins
  3. Delete the PMD related folders
  4. Run eclipse.exe -clean
adangel commented 4 years ago

PMD's project properties are stored in the file .pmd in the project folder. Can you provide the content of this file? If you delete it, the project properties page should be shown again (of course, all the settings are lost). The plugin should definitively handle this situation more gracefully...

numeralnathan commented 4 years ago

There is no .pmd file in the project folder. I fixed the error message problem but hit another.

To fix the error message, I went into my PMD ruleset XML file and removed a custom rule. The custom rule is based on a Java class I wrote.

If I include the custom rule, then the PMD plugin throws a ClassNotFoundException. The PMD plugin does not have the class in the classpath. How do I add my custom class so that the PMD plugin can use it? I tried "Select a working set..." on the property page but that did not seem to work.