Skip to content

Commit

Permalink
[ISSUE-#4306] StringJoiner should consider '@@'. (#5022)
Browse files Browse the repository at this point in the history
* StringJoiner should consider '@@'.

* StringJoiner should consider '@@'.
  • Loading branch information
horizonzy committed Mar 8, 2021
1 parent 63f7e33 commit b1c39a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/src/main/java/com/alibaba/nacos/api/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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+$";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ public int getPagedService(String namespaceId, int startPage, int pageSize, Stri

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);
}
Expand Down

0 comments on commit b1c39a6

Please sign in to comment.