updating to work with pmd-0.4

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@313 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-07-12 00:35:41 +00:00
parent 0ce2b38d2f
commit b7a692ce86
5 changed files with 8 additions and 7 deletions

4
pmd-jedit/etc/scp.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
CLASSPATH=../build/
CLASSPATH=$CLASSPATH:../lib/pmd-0.4.jar
CLASSPATH=$CLASSPATH:../lib/jedit.jar

Binary file not shown.

BIN
pmd-jedit/lib/pmd-0.4.jar Normal file

Binary file not shown.

View File

@ -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();

View File

@ -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() {