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) {
|
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) {
|
protected boolean isIPv4(final char firstChar, final String s) {
|
||||||
@ -190,7 +190,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule {
|
|||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
// The last part can be a standard IPv4 address.
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
ipv4Mapped = true;
|
ipv4Mapped = true;
|
||||||
|
Reference in New Issue
Block a user