From d7972f80d142fac0d81e17ce973eee0dc0b63860 Mon Sep 17 00:00:00 2001 From: Xavier Le Vourch Date: Sat, 27 Oct 2007 17:44:43 +0000 Subject: [PATCH] AvoidUsingHardCodedIP now checks for IPv6 addresses as well git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5595 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/changelog.txt | 2 +- .../rules/basic/xml/AvoidUsingHardCodedIP.xml | 39 +++++++++++++++ pmd/rulesets/basic.xml | 4 +- .../rules/basic/AvoidUsingHardCodedIP.java | 48 +++++++++++++++++++ 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 pmd/src/net/sourceforge/pmd/rules/basic/AvoidUsingHardCodedIP.java diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 59c7b0e899..187da01626 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -1,6 +1,6 @@ ????, 2007 - 4.1: New rules: - Basic ruleset: AvoidUsingHardCodedIPRule,CheckResultSet + Basic ruleset: AvoidUsingHardCodedIP,CheckResultSet Controversial ruleset: AvoidFinalLocalVariable,AvoidUsingShortType,AvoidUsingVolatile,AvoidUsingNativeCode,AvoidAccessibilityAlteration Design ruleset: ClassWithOnlyPrivateConstructorsShouldBeFinal,EmptyMethodInAbstractClassShouldBeAbstract Imports ruleset: TooManyStaticImports diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/AvoidUsingHardCodedIP.xml b/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/AvoidUsingHardCodedIP.xml index 45dd79c47a..90a3becad4 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/AvoidUsingHardCodedIP.xml +++ b/pmd/regress/test/net/sourceforge/pmd/rules/basic/xml/AvoidUsingHardCodedIP.xml @@ -61,4 +61,43 @@ public class Foo { ]]> + + + 0 + + + + + + 11 + + + diff --git a/pmd/rulesets/basic.xml b/pmd/rulesets/basic.xml index fc956b4d30..f2d827ea4d 100644 --- a/pmd/rulesets/basic.xml +++ b/pmd/rulesets/basic.xml @@ -1014,8 +1014,8 @@ public class Test {