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:
4
pmd-jedit/etc/scp.sh
Executable file
4
pmd-jedit/etc/scp.sh
Executable 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
BIN
pmd-jedit/lib/pmd-0.4.jar
Normal file
Binary file not shown.
@ -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();
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user