-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java] AvoidUsingHardCodedIP ignores match pattern #1323
Comments
@KroArtem thanks for spotting this one! That property is actually unused, and should be removed. It's legacy from back when the rule was a pure XPath rule: pmd/pmd-java/src/main/resources/category/java/bestpractices.xml Lines 229 to 231 in c6b529d
The one property that is actually honoured is the That property defaults to checking all, IPv4, IPv6 and IPv4 mapped IPv6. |
" |
"::bee" (two colons) is a valid IPv6 address, while ":bee" is not. Refs pmd#1323
Thanks a lot for explanation, updated pmd to 6.7.0, seems to be working ok now. |
Affects PMD Version:
6.5.0
Rule:
AvoidUsingHardCodedIP
Description:
AvoidUsingHardCodedIP reports that string ":bee" is a hardcoded IP. It looks like support for IPv6 was added but documentation is outdated.
Code Sample demonstrating the issue:
Leads to PMD reporting the following:
Running PMD through: Junit test runs pmd
Docs say pattern is
^"[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"$
The text was updated successfully, but these errors were encountered: