From eb57fdc8827e65e7fcdb9714178169adf1265053 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 3 Aug 2013 13:08:26 +0200 Subject: [PATCH] pmd: fix #991 AvoidSynchronizedAtMethodLevel for static methods --- pmd/etc/changelog.txt | 1 + .../main/resources/rulesets/java/design.xml | 14 ++++++++-- .../xml/AvoidSynchronizedAtMethodLevel.xml | 26 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index d92d02d253..dbee6a3859 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -1,5 +1,6 @@ ????? ??, 2013 - 5.0.5: +Fixed bug 991: AvoidSynchronizedAtMethodLevel for static methods Fixed bug 1114: CPD - Tokenizer not initialized with requested properties diff --git a/pmd/src/main/resources/rulesets/java/design.xml b/pmd/src/main/resources/rulesets/java/design.xml index 3731cadf0c..4ab55f86c9 100644 --- a/pmd/src/main/resources/rulesets/java/design.xml +++ b/pmd/src/main/resources/rulesets/java/design.xml @@ -866,13 +866,23 @@ gets it. diff --git a/pmd/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/AvoidSynchronizedAtMethodLevel.xml b/pmd/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/AvoidSynchronizedAtMethodLevel.xml index d87db14d02..590822cbe3 100644 --- a/pmd/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/AvoidSynchronizedAtMethodLevel.xml +++ b/pmd/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/AvoidSynchronizedAtMethodLevel.xml @@ -24,4 +24,30 @@ public class Foo { } ]]> + + + #991 AvoidSynchronizedAtMethodLevel for static methods - bad case + 1 + + + + + #991 AvoidSynchronizedAtMethodLevel for static methods - good case + 0 + +