diff --git a/pmd-netbeans/build.xml b/pmd-netbeans/build.xml index e0074b3d94..26157a96ac 100644 --- a/pmd-netbeans/build.xml +++ b/pmd-netbeans/build.xml @@ -2,9 +2,9 @@ - + - + diff --git a/pmd-netbeans/lib/BUILDING.txt b/pmd-netbeans/lib/BUILDING.txt index f9137c4fca..dacb804ded 100644 --- a/pmd-netbeans/lib/BUILDING.txt +++ b/pmd-netbeans/lib/BUILDING.txt @@ -1,6 +1,6 @@ ---++ BUILDING -The trunk version of NetBeans IDE is used to develop the PMD plugin +The NetBeans IDE version 5.0 or newer can be used to develop the PMD plugin using the new plugin development support. Read the documentation of this support to get details about the @@ -8,4 +8,4 @@ configuration. For a quick setup it should be enough to copy the 'pmdsuite.properties.template' file into pmdsuite.properties' edit its content according to comments. - +Released plugin versions are built with JDK 1.4.2 and against NetBeans5.0. diff --git a/pmd-netbeans/lib/pmd-3.5.jar b/pmd-netbeans/lib/pmd-3.5.jar deleted file mode 100644 index a766f01e49..0000000000 Binary files a/pmd-netbeans/lib/pmd-3.5.jar and /dev/null differ diff --git a/pmd-netbeans/lib/pmd-3.6.jar b/pmd-netbeans/lib/pmd-3.6.jar new file mode 100644 index 0000000000..fef6eddc07 Binary files /dev/null and b/pmd-netbeans/lib/pmd-3.6.jar differ diff --git a/pmd-netbeans/manifest.mf b/pmd-netbeans/manifest.mf index 4c9121fe47..e7bf0ed9ad 100644 --- a/pmd-netbeans/manifest.mf +++ b/pmd-netbeans/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 1.5.1 +OpenIDE-Module-Specification-Version: 1.6 Created-By: Ole-Martin Mørk and Gunnlaugur Þór Briem and Radim Kubacki OpenIDE-Module: pmd OpenIDE-Module-Layer: pmd/mf-layer.xml diff --git a/pmd-netbeans/nbproject/project.properties b/pmd-netbeans/nbproject/project.properties index a017351b44..dd00620f22 100644 --- a/pmd-netbeans/nbproject/project.properties +++ b/pmd-netbeans/nbproject/project.properties @@ -1,6 +1,6 @@ extra.module.files=\ modules/ext/jaxen-1.1-beta-7.jar \ - modules/ext/pmd-3.5.jar \ + modules/ext/pmd-3.6.jar \ modules/ext/jakarta-oro-2.0.8.jar \ modules/ext/nbpmdrules.jar nbm.distribution=http://pmd.sourceforge.net/ diff --git a/pmd-netbeans/nbproject/project.xml b/pmd-netbeans/nbproject/project.xml index d625d145ab..d4742518ae 100644 --- a/pmd-netbeans/nbproject/project.xml +++ b/pmd-netbeans/nbproject/project.xml @@ -17,8 +17,8 @@ lib/jaxen-1.1-beta-7.jar - ext/pmd-3.5.jar - lib/pmd-3.5.jar + ext/pmd-3.6.jar + lib/pmd-3.6.jar @@ -181,7 +181,7 @@ libsrc - lib/pmd-3.5.jar + lib/pmd-3.6.jar build/libclasses ${cluster}/modules/ext/nbpmdrules.jar diff --git a/pmd-netbeans/src/pmd/RunPMDAction.java b/pmd-netbeans/src/pmd/RunPMDAction.java index 6a8f317ae5..3d2a20e79b 100644 --- a/pmd-netbeans/src/pmd/RunPMDAction.java +++ b/pmd-netbeans/src/pmd/RunPMDAction.java @@ -46,9 +46,7 @@ import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.RuleViolation; -import net.sourceforge.pmd.TargetJDK1_3; -import net.sourceforge.pmd.TargetJDK1_4; -import net.sourceforge.pmd.TargetJDK1_5; +import net.sourceforge.pmd.SourceType; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.queries.SourceLevelQuery; @@ -163,9 +161,6 @@ public class RunPMDAction extends CookieAction { SourceLevelQuery sourceLevelQuery = (SourceLevelQuery) Lookup.getDefault().lookup(SourceLevelQuery.class); RuleSet set = constructRuleSets(); - PMD pmd_1_3 = null; - PMD pmd_1_4 = null; - PMD pmd_1_5 = null; ArrayList/**/ list = new ArrayList( 100 ); CancelCallback cancel = new CancelCallback(); @@ -193,25 +188,15 @@ public class RunPMDAction extends CookieAction { String sourceLevel = sourceLevelQuery.getSourceLevel(fobj); // choose the correct PMD to use according to the source level - PMD pmd = null; - if (sourceLevel != null) { - if (sourceLevel.equals("1.5")) { - if (pmd_1_5 == null) - pmd_1_5 = new PMD(new TargetJDK1_5()); - pmd = pmd_1_5; - } else if (sourceLevel.equals("1.3")) { - if (pmd_1_3 == null) - pmd_1_3 = new PMD(new TargetJDK1_3()); - pmd = pmd_1_3; - } + PMD pmd = new PMD(); + if ("1.5".equals(sourceLevel)) { + pmd.setJavaVersion(SourceType.JAVA_15); + } else if ("1.3".equals(sourceLevel)) { + pmd.setJavaVersion(SourceType.JAVA_13); + } else { + // default to JDK 1.4 if we don't know any better... + pmd.setJavaVersion(SourceType.JAVA_14); } - // default to JDK 1.4 if we don't know any better... - if (pmd == null) { - if (pmd_1_4 == null) - pmd_1_4 = new PMD(new TargetJDK1_4()); - pmd = pmd_1_4; - } - Reader reader; try { @@ -245,7 +230,7 @@ public class RunPMDAction extends CookieAction { StringBuffer buffer = new StringBuffer(); buffer.append( violation.getRule().getName() ).append( ", " ); buffer.append( violation.getDescription() ); - Fault fault = new Fault( violation.getNode().getBeginLine(), + Fault fault = new Fault( violation.getBeginLine(), violation.getFilename(), buffer.toString() ); list.add( fault );