Skip to content

Commit

Permalink
Fix the problem of CacheListener#getGroup logic error (#7742)
Browse files Browse the repository at this point in the history
  • Loading branch information
BurningCN authored May 13, 2021
1 parent b0732e9 commit e419a2f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ private String getGroup(String path) {
if (!StringUtils.isEmpty(path)) {
int beginIndex = path.indexOf(rootPath + PATH_SEPARATOR);
if (beginIndex > -1) {
int endIndex = path.indexOf(PATH_SEPARATOR, beginIndex);
if (endIndex > beginIndex) {
return path.substring(beginIndex, endIndex);
String remain = path.substring((rootPath + PATH_SEPARATOR).length());
int endIndex = remain.lastIndexOf(PATH_SEPARATOR);
if (endIndex > -1) {
return remain.substring(0, endIndex);
}
}
}
Expand Down

0 comments on commit e419a2f

Please sign in to comment.