diff --git a/pmd-jedit/etc/scp.sh b/pmd-jedit/etc/scp.sh new file mode 100755 index 0000000000..19f339f33c --- /dev/null +++ b/pmd-jedit/etc/scp.sh @@ -0,0 +1,4 @@ +#!/bin/sh +CLASSPATH=../build/ +CLASSPATH=$CLASSPATH:../lib/pmd-0.4.jar +CLASSPATH=$CLASSPATH:../lib/jedit.jar diff --git a/pmd-jedit/lib/pmd-0.3.jar b/pmd-jedit/lib/pmd-0.3.jar deleted file mode 100644 index 47806e1c2f..0000000000 Binary files a/pmd-jedit/lib/pmd-0.3.jar and /dev/null differ diff --git a/pmd-jedit/lib/pmd-0.4.jar b/pmd-jedit/lib/pmd-0.4.jar new file mode 100644 index 0000000000..034ad9d75f Binary files /dev/null and b/pmd-jedit/lib/pmd-0.4.jar differ diff --git a/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java b/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java index 3a0502f388..de4d879ac7 100644 --- a/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java +++ b/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java @@ -13,10 +13,9 @@ import java.util.Vector; import java.util.Iterator; import java.io.FileNotFoundException; import java.io.FileInputStream; -import java.io.StringBufferInputStream; +import java.io.StringReader; import net.sourceforge.pmd.*; -import net.sourceforge.pmd.reports.ReportFactory; public class PMDJEditPlugin extends EBPlugin { @@ -44,9 +43,7 @@ public class PMDJEditPlugin extends EBPlugin { public void instanceCheck(View view) { PMD pmd = new PMD(); - ReportFactory rf = new ReportFactory(); RuleContext ctx = new RuleContext(); - RuleSetFactory ruleSetFactory = new RuleSetFactory(); SelectedRuleSetsMap selectedRuleSets = new SelectedRuleSetsMap(); RuleSet rules = new RuleSet(); @@ -54,11 +51,10 @@ public class PMDJEditPlugin extends EBPlugin { rules.addRuleSet(ruleSetFactory.createRuleSet(pmd.getClass().getClassLoader().getResourceAsStream((String)i.next()))); } - ctx.setReport(rf.createReport("xml")); + ctx.setReport(new Report()); ctx.setSourceCodeFilename("this"); try { - // TODO switch to use StringReader once PMD 0.4 gets released - pmd.processFile(new StringBufferInputStream(view.getTextArea().getText()), rules, ctx); + pmd.processFile(new StringReader(view.getTextArea().getText()), rules, ctx); // TODO put this in a list box or something StringBuffer msg = new StringBuffer(); diff --git a/pmd-jedit/src/net/sourceforge/pmd/jedit/SelectedRuleSetsMap.java b/pmd-jedit/src/net/sourceforge/pmd/jedit/SelectedRuleSetsMap.java index 5120d03d93..7e6b670736 100644 --- a/pmd-jedit/src/net/sourceforge/pmd/jedit/SelectedRuleSetsMap.java +++ b/pmd-jedit/src/net/sourceforge/pmd/jedit/SelectedRuleSetsMap.java @@ -19,6 +19,7 @@ public class SelectedRuleSetsMap { selections.put("basic", createCheckBox("basic")); selections.put("unusedcode", createCheckBox("unusedcode")); selections.put("design", createCheckBox("design")); + selections.put("naming", createCheckBox("naming")); } public Iterator keys() {