Fix issue with analysis of IPv6 mapper IPv4
This commit is contained in:
@ -108,7 +108,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule {
|
||||
}
|
||||
|
||||
protected boolean isHexCharacter(char c) {
|
||||
return isLatinDigit(c) || 'A' <= c && c <= 'F' || 'a' <= c && c <= 'f';
|
||||
return isLatinDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
|
||||
}
|
||||
|
||||
protected boolean isIPv4(final char firstChar, final String s) {
|
||||
@ -190,7 +190,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule {
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// The last part can be a standard IPv4 address.
|
||||
if (i != parts.length - 1 || !isIPv4(firstChar, part)) {
|
||||
if (i != parts.length - 1 || !isIPv4(part.charAt(0), part)) {
|
||||
return false;
|
||||
}
|
||||
ipv4Mapped = true;
|
||||
|
Reference in New Issue
Block a user