From f163c2ec7af5ae0396d2a41e3ea19a01e3b02489 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Tue, 1 Apr 2003 17:35:19 +0000 Subject: [PATCH] Release preps git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1674 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd-jdeveloper/etc/Manifest.mf | 4 +-- pmd-jdeveloper/etc/build.xml | 6 +++- pmd-jdeveloper/etc/changelog.txt | 4 +++ .../jdeveloper/JDeveloperRuleSetFactory.java | 35 ++++++++++++------- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/pmd-jdeveloper/etc/Manifest.mf b/pmd-jdeveloper/etc/Manifest.mf index 01d15e37b4..74eef5a6ef 100644 --- a/pmd-jdeveloper/etc/Manifest.mf +++ b/pmd-jdeveloper/etc/Manifest.mf @@ -5,9 +5,9 @@ Addin0: net.sourceforge.pmd.jdeveloper.Plugin Name: net/sourceforge/pmd/jdeveloper/ Specification-Title: PMD Static Code Analyzer -Specification-Version: 0.1 +Specification-Version: 0.2 Specification-Vendor: Tom Copeland Implementation-Title: net.sourceforge.pmd.jdeveloper -Implementation-Version: 0.1 +Implementation-Version: 0.2 Implementation-Vendor: Tom Copeland Implementation-URL: http://pmd.sf.net/ \ No newline at end of file diff --git a/pmd-jdeveloper/etc/build.xml b/pmd-jdeveloper/etc/build.xml index aaa33b0645..9089879b35 100644 --- a/pmd-jdeveloper/etc/build.xml +++ b/pmd-jdeveloper/etc/build.xml @@ -6,7 +6,7 @@ - + @@ -45,12 +45,16 @@ + + + + diff --git a/pmd-jdeveloper/etc/changelog.txt b/pmd-jdeveloper/etc/changelog.txt index 2b6912b5e2..294018343e 100644 --- a/pmd-jdeveloper/etc/changelog.txt +++ b/pmd-jdeveloper/etc/changelog.txt @@ -1,2 +1,6 @@ +April 1, 2003 - 0.2: +Updated to work with pmd-1.04. +Implemented several of Ronald Kinion's suggestions. + February 25, 2003 - 0.1: Initial release diff --git a/pmd-jdeveloper/src/net/sourceforge/pmd/jdeveloper/JDeveloperRuleSetFactory.java b/pmd-jdeveloper/src/net/sourceforge/pmd/jdeveloper/JDeveloperRuleSetFactory.java index 3ac97af63e..327d3dbf3a 100644 --- a/pmd-jdeveloper/src/net/sourceforge/pmd/jdeveloper/JDeveloperRuleSetFactory.java +++ b/pmd-jdeveloper/src/net/sourceforge/pmd/jdeveloper/JDeveloperRuleSetFactory.java @@ -4,8 +4,11 @@ import net.sourceforge.pmd.ExternalRuleID; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.RuleSetFactory; +import net.sourceforge.pmd.util.ResourceLoader; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Document; +import org.w3c.dom.Element; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -14,26 +17,30 @@ import java.io.InputStream; public class JDeveloperRuleSetFactory extends RuleSetFactory { public RuleSet createRuleSet(InputStream inputStream) { + return this.createRuleSet(inputStream, getClass().getClassLoader()); + } + + public RuleSet createRuleSet(InputStream inputStream, ClassLoader classLoader) { try { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - org.w3c.dom.Document doc = builder.parse(inputStream); - org.w3c.dom.Element root = doc.getDocumentElement(); + Document doc = builder.parse(inputStream); + Element root = doc.getDocumentElement(); RuleSet ruleSet = new RuleSet(); ruleSet.setName(root.getAttribute("name")); ruleSet.setDescription(root.getChildNodes().item(1).getFirstChild().getNodeValue()); NodeList rules = root.getElementsByTagName("rule"); - for (int i =0; i