diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt
index 1b0945f6fe..2a43c72e2d 100644
--- a/pmd/etc/changelog.txt
+++ b/pmd/etc/changelog.txt
@@ -1,5 +1,5 @@
????, 2005 - 3.4:
-New rules: NonThreadSafeSingleton (design ruleset), DefaultPackage (controversial ruleset)
+New rules: NonThreadSafeSingleton (design ruleset), DefaultPackage (controversial ruleset), MisleadingVariableName (naming ruleset)
Fixed bug 1292745 - Removed unused source file ExceptionTypeChecking.java
Fixed bug 1292609 - The JDK 1.3 parser now correctly handles certain 'assert' usages. Also added a 'JDK 1.3' menu item to the Designer.
Fixed bug 1292689 - Description wrong for UnnecessaryLocalBeforeReturn
@@ -481,4 +481,6 @@ Moved Ant task to the net.sourceforge.pmd.ant package
Added new HTML report format
June 25 2002 - 0.1:
-Initial release
\ No newline at end of file
+Initial release
+
+Using PMD? Get "PMD Applied", the book! http://pmdapplied.com/
\ No newline at end of file
diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/MisleadingVariableNameTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/MisleadingVariableNameTest.java
new file mode 100644
index 0000000000..0614c541ce
--- /dev/null
+++ b/pmd/regress/test/net/sourceforge/pmd/rules/MisleadingVariableNameTest.java
@@ -0,0 +1,43 @@
+package test.net.sourceforge.pmd.rules;
+
+import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
+import test.net.sourceforge.pmd.testframework.TestDescriptor;
+import net.sourceforge.pmd.Rule;
+import net.sourceforge.pmd.RuleSetNotFoundException;
+import net.sourceforge.pmd.PMD;
+
+public class MisleadingVariableNameTest extends SimpleAggregatorTst {
+ private Rule rule;
+
+ public void setUp() throws RuleSetNotFoundException {
+ rule = findRule("naming", "MisleadingVariableName");
+ }
+
+ public void testAll() {
+ runTests(new TestDescriptor[] {
+ new TestDescriptor(TEST1, "misnamed param", 1, rule),
+ new TestDescriptor(TEST2, "misnamed local", 1, rule),
+ new TestDescriptor(TEST3, "all's well", 0, rule),
+ });
+ }
+
+ private static final String TEST1 =
+ "public class Foo {" + PMD.EOL +
+ " void main(String m_foo) {" + PMD.EOL +
+ " }" + PMD.EOL +
+ "}";
+
+ private static final String TEST2 =
+ "public class Foo {" + PMD.EOL +
+ " void main() {" + PMD.EOL +
+ " int m_foo = 42;" + PMD.EOL +
+ " }" + PMD.EOL +
+ "}";
+
+ private static final String TEST3 =
+ "public class Foo {" + PMD.EOL +
+ " private int m_bar;" + PMD.EOL +
+ " public static final int m_buz = 42;" + PMD.EOL +
+ " private void buz(String biz) {}" + PMD.EOL +
+ "}";
+}
diff --git a/pmd/rulesets/naming.xml b/pmd/rulesets/naming.xml
index 02e1829851..4ca06d3c99 100644
--- a/pmd/rulesets/naming.xml
+++ b/pmd/rulesets/naming.xml
@@ -441,6 +441,38 @@ public class SomeClass {
]]>
+
+
+
+Detects when a non-field has a name starting with 'm_'. This usually
+indicates a field and thus is confusing.
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
diff --git a/pmd/rulesets/scratchpad.xml b/pmd/rulesets/scratchpad.xml
index 1356087c6f..757764fbf7 100644
--- a/pmd/rulesets/scratchpad.xml
+++ b/pmd/rulesets/scratchpad.xml
@@ -7,6 +7,7 @@ These are new rules that are still in progress
+
-