diff --git a/pmd-jedit/config/pmd.props b/pmd-jedit/config/pmd.props
index d62f78f928..1eedb25dd4 100644
--- a/pmd-jedit/config/pmd.props
+++ b/pmd-jedit/config/pmd.props
@@ -8,7 +8,7 @@ plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.docs=jedit.html
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.0=jdk 1.3
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.1=jedit 04.00.99.00
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.2=plugin errorlist.ErrorListPlugin 1.2
-plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.jars=pmd-1.05.jar
+plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.jars=pmd-1.1.jar
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.jars=jaxen-core-1.0-fcs.jar
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.jars=saxpath-1.0-fcs.jar
diff --git a/pmd-jedit/etc/build.xml b/pmd-jedit/etc/build.xml
index a97f79e029..b3ef0677c3 100644
--- a/pmd-jedit/etc/build.xml
+++ b/pmd-jedit/etc/build.xml
@@ -4,9 +4,9 @@
-
+
-
+
diff --git a/pmd-jedit/src/net/sourceforge/pmd/jedit/CPDDuplicateCodeViewer.java b/pmd-jedit/src/net/sourceforge/pmd/jedit/CPDDuplicateCodeViewer.java
index fc477ebeba..6c6684a757 100644
--- a/pmd-jedit/src/net/sourceforge/pmd/jedit/CPDDuplicateCodeViewer.java
+++ b/pmd-jedit/src/net/sourceforge/pmd/jedit/CPDDuplicateCodeViewer.java
@@ -17,7 +17,6 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeSelectionModel;
import java.awt.BorderLayout;
import java.util.Vector;
-import org.gjt.sp.util.Log;
//End of Imports
/**
@@ -46,18 +45,19 @@ public class CPDDuplicateCodeViewer extends JPanel
public void valueChanged(TreeSelectionEvent e)
{
DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
- if (node == null) return;
-
- //System.out.println("Node is " + node +" class "+ node.getClass());
- if (node.isLeaf() && node instanceof Duplicate)
+ if (node != null)
{
- Duplicate duplicate = (Duplicate)node;
- gotoDuplicate(duplicate);
- //System.out.println("Got!! " + duplicate);
- }
- else
- {
- //System.out.println("Something else. Please check ");
+ //System.out.println("Node is " + node +" class "+ node.getClass());
+ if (node.isLeaf() && node instanceof Duplicate)
+ {
+ Duplicate duplicate = (Duplicate)node;
+ gotoDuplicate(duplicate);
+ //System.out.println("Got!! " + duplicate);
+ }
+ else
+ {
+ //System.out.println("Something else. Please check ");
+ }
}
}
});
@@ -75,29 +75,25 @@ public class CPDDuplicateCodeViewer extends JPanel
public void gotoDuplicate(final Duplicate duplicate)
{
- if(duplicate == null)
+ if(duplicate != null)
{
- return;
- }
-
- final Buffer buffer = jEdit.openFile(view,duplicate.getFilename());
-
- VFSManager.runInAWTThread(new Runnable()
- {
- public void run()
+ final Buffer buffer = jEdit.openFile(view,duplicate.getFilename());
+
+ VFSManager.runInAWTThread(new Runnable()
{
- view.setBuffer(buffer);
-
- int start = buffer.getLineStartOffset(duplicate.getBeginLine());
- int end = buffer.getLineEndOffset(duplicate.getEndLine()-2);
- //Log.log(Log.DEBUG, this.getClass(), "Start Line "+ duplicate.getBeginLine() + " End Line "+ duplicate.getEndLine() + " Start " + start + " End "+ end);
- //Since an AIOOB Exception is thrown if the end is the end of file. we do a -1 from end to fix it.
- view.getTextArea().setSelection(new Selection.Range(start,end -1));
- view.getTextArea().moveCaretPosition(start);
- }
- });
-
-
+ public void run()
+ {
+ view.setBuffer(buffer);
+
+ int start = buffer.getLineStartOffset(duplicate.getBeginLine());
+ int end = buffer.getLineEndOffset(duplicate.getEndLine()-2);
+ //Log.log(Log.DEBUG, this.getClass(), "Start Line "+ duplicate.getBeginLine() + " End Line "+ duplicate.getEndLine() + " Start " + start + " End "+ end);
+ //Since an AIOOB Exception is thrown if the end is the end of file. we do a -1 from end to fix it.
+ view.getTextArea().setSelection(new Selection.Range(start,end -1));
+ view.getTextArea().moveCaretPosition(start);
+ }
+ });
+ }
}
public DefaultMutableTreeNode getRoot()
diff --git a/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java b/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java
index b876cb0329..028dd00e38 100644
--- a/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java
+++ b/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDJEditPlugin.java
@@ -51,6 +51,7 @@ public class PMDJEditPlugin extends EditPlugin {
public static final String NAME = "PMD";
public static final String OPTION_RULES_PREFIX = "options.pmd.rules.";
public static final String OPTION_UI_DIRECTORY_POPUP = "options.pmd.ui.directorypopup";
+ public static final String DEFAULT_TILE_MINSIZE_PROPERTY = "pmd.cpd.defMinTileSize";
//private static RE re = new UncheckedRE("Starting at line ([0-9]*) of (\\S*)");
private static PMDJEditPlugin instance;
@@ -77,22 +78,26 @@ public class PMDJEditPlugin extends EditPlugin {
}
// boilerplate JEdit code
- public static void checkDirectory(View view) {
- instance.instanceCheckDirectory(view);
- }
+ public static void checkDirectory(View view) {
+ instance.instanceCheckDirectory(view);
+ }
public void instanceCheckDirectory(View view) {
- if (jEdit.getBooleanProperty(PMDJEditPlugin.OPTION_UI_DIRECTORY_POPUP)) {
+ if (jEdit.getBooleanProperty(PMDJEditPlugin.OPTION_UI_DIRECTORY_POPUP))
+ {
final String dir = JOptionPane.showInputDialog(jEdit.getFirstView(), "Please type in a directory to scan", NAME, JOptionPane.QUESTION_MESSAGE);
- if (dir == null) {
- return;
+ if (dir != null)
+ {
+ if (!(new File(dir)).exists() || !(new File(dir)).isDirectory() )
+ {
+ JOptionPane.showMessageDialog(jEdit.getFirstView(), dir + " is not a valid directory name", NAME, JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+ process(findFiles(dir, false));
}
- if (!(new File(dir)).exists() || !(new File(dir)).isDirectory() ) {
- JOptionPane.showMessageDialog(jEdit.getFirstView(), dir + " is not a valid directory name", NAME, JOptionPane.ERROR_MESSAGE);
- return;
- }
- process(findFiles(dir, false));
- } else {
+ }
+ else
+ {
final VFSBrowser browser = (VFSBrowser)view.getDockableWindowManager().getDockable("vfs.browser");
if(browser == null) {
JOptionPane.showMessageDialog(jEdit.getFirstView(), "Can't run PMD on a directory unless the file browser is open", NAME, JOptionPane.ERROR_MESSAGE);
@@ -102,51 +107,54 @@ public class PMDJEditPlugin extends EditPlugin {
}
}
- // check all open buffers
- public static void checkAllOpenBuffers(View view) {
- instance.instanceCheckAllOpenBuffers(view);
- }
+ // check all open buffers
+ public static void checkAllOpenBuffers(View view) {
+ instance.instanceCheckAllOpenBuffers(view);
+ }
- public void instanceCheckAllOpenBuffers(View view) {
- // I'm putting the files in a Set to work around some
- // odd behavior in jEdit - the buffer.getNext()
- // seems to iterate over the files twice.
- Set fileSet = new HashSet();
- for (int i=0; i