[ISSUE-#4306] StringJoiner should consider '@@'. (#5022)

* StringJoiner should consider '@@'.

* StringJoiner should consider '@@'.
This commit is contained in:
赵延 2021-03-08 11:43:26 +08:00 committed by GitHub
parent 63f7e337d9
commit b1c39a6354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -176,6 +176,8 @@ public class Constants {
public static final String SERVICE_INFO_SPLITER = "@@";
public static final int SERVICE_INFO_SPLIT_COUNT = 2;
public static final String NULL_STRING = "null";
public static final String NUMBER_PATTERN = "^\\d+$";

View File

@ -941,7 +941,7 @@ public class ServiceManager implements RecordListener<Service> {
if (StringUtils.isNotBlank(param)) {
StringJoiner regex = new StringJoiner(Constants.SERVICE_INFO_SPLITER);
for (String s : param.split(Constants.SERVICE_INFO_SPLITER)) {
for (String s : param.split(Constants.SERVICE_INFO_SPLITER, Constants.SERVICE_INFO_SPLIT_COUNT)) {
regex.add(StringUtils.isBlank(s) ? Constants.ANY_PATTERN
: Constants.ANY_PATTERN + s + Constants.ANY_PATTERN);
}