Skip to content

Commit 0ce853c

Browse files
committed
Fixes #1473 Cannot create reports for non-Java projects
1 parent 4b4d787 commit 0ce853c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Eclipse Update Site: <https://sourceforge.net/projects/pmd/files/pmd-eclipse/upd
1111
* squid:S1854 - Dead stores should be removed ([pull request #17](https://github.com/pmd/pmd-eclipse-plugin/pull/17))
1212
* squid:S1213 - The members of an interface declaration or class should appear in a pre-defined order ([pull request #18](https://github.com/pmd/pmd-eclipse-plugin/pull/18))
1313
* Fixed Executing Rule.start() ([bug #974](https://sourceforge.net/p/pmd/bugs/974/))
14+
* Fixed Cannot create reports for non-Java projects ([bug #1473](https://sourceforge.net/p/pmd/bugs/1473/))
1415
* Fixed Check Code doesn't work from project root in non-java projects ([bug #1474](https://sourceforge.net/p/pmd/bugs/1474/))
1516
* Fixed Not Able to enable PMD for Apex in Eclipse ([bug #1483](https://sourceforge.net/p/pmd/bugs/1483/))
1617

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/RenderReportsCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,15 @@ private Report createReport(IProject project) throws CoreException {
222222

223223
IMarker[] markers = MarkerUtil.findAllMarkers(project);
224224
RuleSet ruleSet = PMDPlugin.getDefault().getPreferencesManager().getRuleSet();
225+
boolean isJavaProject = project.hasNature(JavaCore.NATURE_ID);
225226

226227
for (IMarker marker : markers) {
227228
String ruleName = marker.getAttribute(PMDRuntimeConstants.KEY_MARKERATT_RULENAME, "");
228229
Rule rule = ruleSet.getRuleByName(ruleName);
229230

230231
FakeRuleViolation ruleViolation = createViolation(marker, rule);
231232

232-
if (marker.getResource() instanceof IFile) {
233+
if (isJavaProject && marker.getResource() instanceof IFile) {
233234
classAndPackageFrom(marker, ruleViolation);
234235
}
235236

0 commit comments

Comments
 (0)