Fix #3865
This commit is contained in:
parent
b3ddc95545
commit
2007f093f6
1 changed files with 11 additions and 6 deletions
|
@ -188,12 +188,17 @@ public class Postcode {
|
|||
if (isCountryKnown(country)) {
|
||||
String replacement = rules.get(country).get(1);
|
||||
Matcher matcher = getMatcher(postcode, country);
|
||||
result = matcher.replaceAll(replacement);
|
||||
if (!result.equals(postcode)) {
|
||||
log.info("Normalize " + country + "'s postcode: " + postcode + " -> " + result);
|
||||
}
|
||||
if (!matcher.matches()) {
|
||||
log.info("Not matches " + country + "'s postcode regex: " + postcode);
|
||||
if (matcher != null) {
|
||||
String res = matcher.replaceAll(replacement);
|
||||
if (res != null) {
|
||||
result = res.replaceAll("null", "");
|
||||
if (!result.equals(postcode)) {
|
||||
log.info("Normalize " + country + "'s postcode: " + postcode + " -> " + result);
|
||||
}
|
||||
if (!matcher.matches()) {
|
||||
log.info("Not matches " + country + "'s postcode regex: " + postcode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue