This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 12ec341ad1b Refactor NodePathSearchCriteria (#34753)
12ec341ad1b is described below
commit 12ec341ad1bd0388c69eecff37703e5a93f6f3d8
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Feb 23 00:39:01 2025 +0800
Refactor NodePathSearchCriteria (#34753)
---
.../apache/shardingsphere/mode/node/path/NodePathSearchCriteria.java | 2 +-
.../org/apache/shardingsphere/mode/node/path/NodePathSearcher.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearchCriteria.java
b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearchCriteria.java
index e977cb753e0..0c064defcf6 100644
---
a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearchCriteria.java
+++
b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearchCriteria.java
@@ -27,7 +27,7 @@ import lombok.RequiredArgsConstructor;
@Getter
public final class NodePathSearchCriteria {
- private final NodePath nodePathExample;
+ private final NodePath searchExample;
private final boolean trimEmptyNode;
diff --git
a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearcher.java
b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearcher.java
index f1c14c6813c..f9f37b5e1c7 100644
---
a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearcher.java
+++
b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePathSearcher.java
@@ -39,7 +39,7 @@ public final class NodePathSearcher {
* @return found node segment
*/
public static Optional<String> find(final String path, final
NodePathSearchCriteria criteria) {
- Matcher matcher = createPattern(criteria.getNodePathExample(),
criteria.isTrimEmptyNode(), criteria.isContainsChildPath()).matcher(path);
+ Matcher matcher = createPattern(criteria.getSearchExample(),
criteria.isTrimEmptyNode(), criteria.isContainsChildPath()).matcher(path);
return matcher.find() ?
Optional.of(matcher.group(criteria.getSearchSegmentIndex())) : Optional.empty();
}
@@ -51,7 +51,7 @@ public final class NodePathSearcher {
* @return is matched path or not
*/
public static boolean isMatchedPath(final String path, final
NodePathSearchCriteria criteria) {
- return createPattern(criteria.getNodePathExample(),
criteria.isTrimEmptyNode(),
criteria.isContainsChildPath()).matcher(path).find();
+ return createPattern(criteria.getSearchExample(),
criteria.isTrimEmptyNode(),
criteria.isContainsChildPath()).matcher(path).find();
}
private static Pattern createPattern(final NodePath nodePathCriteria,
final boolean trimEmptyNode, final boolean containsChildPath) {