more restrictive regexp in AvoidUsingHardCodedIP to limit false positives

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5579 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Xavier Le Vourch
2007-10-25 01:12:51 +00:00
parent d83c4ec977
commit e28103ddfa
2 changed files with 15 additions and 1 deletions

View File

@ -47,4 +47,18 @@ public class Foo {
}
]]></code>
</test-code>
<test-code>
<description><![CDATA[
Not an ip address string
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
String ID_MD5 = "1.2.840.113549.2.5";
String bar = "testing 1.2.3.4";
}
]]></code>
</test-code>
</test-data>

View File

@ -1025,7 +1025,7 @@ public class Test {
</description>
<priority>3</priority>
<properties>
<property name="pattern" description="Regular Expression" value="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"/>
<property name="pattern" description="Regular Expression" value='^"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"$'/>
</properties>
<example>
<![CDATA[