diff --git a/pmd-netbeans/CHANGES.txt b/pmd-netbeans/CHANGES.txt index a20b4d14f9..e59fefc51d 100644 --- a/pmd-netbeans/CHANGES.txt +++ b/pmd-netbeans/CHANGES.txt @@ -1,3 +1,5 @@ +- Updated pmd to version 3.9 + Version 1.8.1 - Now it is only tested with NB5.5 and development builds - Reflecting changes in NB trunk (http://www.netbeans.org/issues/show_bug.cgi?id=87929) diff --git a/pmd-netbeans/build.xml b/pmd-netbeans/build.xml index 6831a54ef9..f6354ff1ed 100644 --- a/pmd-netbeans/build.xml +++ b/pmd-netbeans/build.xml @@ -2,9 +2,9 @@ - + - + @@ -31,8 +31,10 @@ - + + + @@ -49,7 +51,9 @@ - + + + diff --git a/pmd-netbeans/lib/asm-3.0.jar b/pmd-netbeans/lib/asm-3.0.jar new file mode 100644 index 0000000000..112f5bd4ae Binary files /dev/null and b/pmd-netbeans/lib/asm-3.0.jar differ diff --git a/pmd-netbeans/lib/backport-util-concurrent.jar b/pmd-netbeans/lib/backport-util-concurrent.jar new file mode 100644 index 0000000000..99f9b9c6a3 Binary files /dev/null and b/pmd-netbeans/lib/backport-util-concurrent.jar differ diff --git a/pmd-netbeans/lib/pmd-3.8.jar b/pmd-netbeans/lib/pmd-3.8.jar deleted file mode 100644 index 087138bb6c..0000000000 Binary files a/pmd-netbeans/lib/pmd-3.8.jar and /dev/null differ diff --git a/pmd-netbeans/lib/pmd-3.9.jar b/pmd-netbeans/lib/pmd-3.9.jar new file mode 100644 index 0000000000..5006cbea02 Binary files /dev/null and b/pmd-netbeans/lib/pmd-3.9.jar differ diff --git a/pmd-netbeans/manifest.mf b/pmd-netbeans/manifest.mf index 3ad928e253..df402ead67 100644 --- a/pmd-netbeans/manifest.mf +++ b/pmd-netbeans/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 1.8.1 +OpenIDE-Module-Specification-Version: 1.9 Created-By: Ole-Martin Mørk and Gunnlaugur Þór Briem, Radim Kubacki, Tomasz Slota OpenIDE-Module: pmd OpenIDE-Module-Layer: pmd/mf-layer.xml diff --git a/pmd-netbeans/nbproject/genfiles.properties b/pmd-netbeans/nbproject/genfiles.properties index 46664a50b9..40a1b50f49 100644 --- a/pmd-netbeans/nbproject/genfiles.properties +++ b/pmd-netbeans/nbproject/genfiles.properties @@ -1,5 +1,5 @@ # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=b02625f3 +nbproject/build-impl.xml.data.CRC32=6a5bcde4 nbproject/build-impl.xml.script.CRC32=209b78c0 nbproject/build-impl.xml.stylesheet.CRC32=3f8b4615 diff --git a/pmd-netbeans/nbproject/project.properties b/pmd-netbeans/nbproject/project.properties index 928152d884..c837e2fc82 100644 --- a/pmd-netbeans/nbproject/project.properties +++ b/pmd-netbeans/nbproject/project.properties @@ -1,6 +1,8 @@ extra.module.files=\ modules/ext/jaxen-1.1-beta-10.jar \ - modules/ext/pmd-3.8.jar \ + modules/ext/pmd-3.9.jar \ + modules/ext/backport-util-concurrent.jar \ + modules/ext/asm-3.0.jar \ modules/ext/jakarta-oro-2.0.8.jar \ modules/ext/nbpmdrules.jar javac.compilerargs=-Xlint:unchecked diff --git a/pmd-netbeans/nbproject/project.xml b/pmd-netbeans/nbproject/project.xml index 16a6d3187c..c122b357d9 100644 --- a/pmd-netbeans/nbproject/project.xml +++ b/pmd-netbeans/nbproject/project.xml @@ -8,17 +8,25 @@ - ext/jakarta-oro-2.0.8.jar + ext/asm-3.0.jar - lib/jakarta-oro-2.0.8.jar + lib/asm-3.0.jar + + + ext/backport-util-concurrent.jar + lib/backport-util-concurrent.jar ext/jaxen-1.1-beta-10.jar lib/jaxen-1.1-beta-10.jar - ext/pmd-3.8.jar - lib/pmd-3.8.jar + ext/jakarta-oro-2.0.8.jar + lib/jakarta-oro-2.0.8.jar + + + ext/pmd-3.9.jar + lib/pmd-3.9.jar @@ -188,7 +196,7 @@ libsrc - lib/pmd-3.8.jar + lib/pmd-3.9.jar build/libclasses ${cluster}/modules/ext/nbpmdrules.jar diff --git a/pmd-netbeans/src/pmd/config/ConfigUtils.java b/pmd-netbeans/src/pmd/config/ConfigUtils.java index 626b9ad36e..2a118ed3eb 100644 --- a/pmd-netbeans/src/pmd/config/ConfigUtils.java +++ b/pmd-netbeans/src/pmd/config/ConfigUtils.java @@ -28,6 +28,9 @@ package pmd.config; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -176,20 +179,31 @@ public abstract class ConfigUtils { ErrorManager.getDefault().notify(e); } } - Iterator rulesets = settings.getRuleSets().iterator(); - while( rulesets.hasNext() ) { - String ruleSetXml = rulesets.next(); - try { - RuleSet ruleset = ruleSetFactory.createRuleSet( - new FileInputStream( ruleSetXml ), - // PENDING: perhaps can get ClassLoader from Lookup - new RuleClassLoader( ConfigUtils.class.getClassLoader() ) ); - list.addAll( ruleset.getRules() ); - } - catch( RuntimeException e ) { - ErrorManager.getDefault().notify(e); - } - } + Iterator rulesets = settings.getRuleSets().iterator(); + while( rulesets.hasNext() ) { + String ruleSetXml = rulesets.next(); + try { + Method m = RuleSetFactory.class.getDeclaredMethod("createRuleSet", InputStream.class, ClassLoader.class); + m.setAccessible(true); + Object o = m.invoke(ruleSetFactory, new FileInputStream( ruleSetXml ), + new RuleClassLoader(ConfigUtils.class.getClassLoader())); + RuleSet ruleset = (RuleSet)o; + /* + RuleSet ruleset = ruleSetFactory.createRuleSet( + new FileInputStream( ruleSetXml ), + new RuleClassLoader( ConfigUtils.class.getClassLoader() ) ); + */ + list.addAll( ruleset.getRules() ); + } catch( RuntimeException e ) { + ErrorManager.getDefault().notify(e); + } catch (NoSuchMethodException e) { + ErrorManager.getDefault().notify(e); + } catch (IllegalAccessException e) { + ErrorManager.getDefault().notify(e); + } catch (InvocationTargetException e) { + ErrorManager.getDefault().notify(e); + } + } } catch( FileNotFoundException e ) { throw new RuntimeException( e.getMessage() );