From f663b9773a0b422589d2e831fba5e8effa6237e6 Mon Sep 17 00:00:00 2001 From: Romain Pelisse Date: Fri, 13 Jun 2008 22:07:56 +0000 Subject: [PATCH] Applying patch [ 1958961 ] EmptyInitializer Not really bug fix, but the patch was easy to apply so, why deprive soon to be 4.2.X user from this little addon... git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6201 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/changelog.txt | 2 + .../pmd/rules/basic/BasicRulesTest.java | 1 + .../pmd/rules/basic/xml/EmptyInitializer.xml | 49 +++++++++++++++++++ pmd/rulesets/basic.xml | 31 ++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/EmptyInitializer.xml diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 4960df39a9..941428e1ff 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -6,6 +6,8 @@ Upgrading UselessOperationOnImmutable to detect more use cases, especially on St Fixed bug 1988829 - Violation reported without source file name (actually a fix to ConsecutiveLiteralAppends) Fixed bug 1989814 - false +: ConsecutiveLiteralAppends +New rule: + Basic ruleset: EmptyInitializer May 20, 2008 - 4.2.2: diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/basic/BasicRulesTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/basic/BasicRulesTest.java index 75fe55c1f6..f0f42c1db1 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/basic/BasicRulesTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/basic/BasicRulesTest.java @@ -27,6 +27,7 @@ public class BasicRulesTest extends SimpleAggregatorTst { addRule("basic", "EmptyCatchBlock"); addRule("basic", "EmptyFinallyBlock"); addRule("basic", "EmptyIfStmt"); + addRule("basic", "EmptyInitializer"); addRule("basic", "EmptyStatementNotInLoop"); addRule("basic", "EmptyStaticInitializer"); addRule("basic", "EmptySwitchStatements"); diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/EmptyInitializer.xml b/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/EmptyInitializer.xml new file mode 100644 index 0000000000..9579c6edcf --- /dev/null +++ b/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/EmptyInitializer.xml @@ -0,0 +1,49 @@ + + + + + 1 + + + + + 1 + + + + + 0 + + + + + 0 + + + \ No newline at end of file diff --git a/pmd/rulesets/basic.xml b/pmd/rulesets/basic.xml index 7ccb666160..a305d3ed0f 100644 --- a/pmd/rulesets/basic.xml +++ b/pmd/rulesets/basic.xml @@ -1200,5 +1200,36 @@ public class Test { + + +An empty initializer was found. + + 3 + + + + + + + + + + + +