fix #2774 Refactor variable name and update log message
This commit is contained in:
parent
9ff28a173d
commit
2a473626cd
1 changed files with 5 additions and 5 deletions
|
@ -38,7 +38,7 @@ public class PathMapping extends BsPathMapping {
|
|||
|
||||
protected Pattern regexPattern;
|
||||
|
||||
protected BiFunction<String, Matcher, String> pathMapper;
|
||||
protected BiFunction<String, Matcher, String> pathMapperFunc;
|
||||
|
||||
public String getId() {
|
||||
return asDocMeta().id();
|
||||
|
@ -62,14 +62,14 @@ public class PathMapping extends BsPathMapping {
|
|||
}
|
||||
final Matcher matcher = regexPattern.matcher(input);
|
||||
if (matcher.find()) {
|
||||
if (pathMapper == null) {
|
||||
if (pathMapperFunc == null) {
|
||||
final String replacement = StringUtil.isNotBlank(getReplacement()) ? getReplacement() : StringUtil.EMPTY;
|
||||
pathMapper = pathMappingHelper.createPathMatcher(matcher, replacement);
|
||||
pathMapperFunc = pathMappingHelper.createPathMatcher(matcher, replacement);
|
||||
}
|
||||
try {
|
||||
return pathMapper.apply(input, matcher);
|
||||
return pathMapperFunc.apply(input, matcher);
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to apply {}", pathMapper, e);
|
||||
logger.warn("Failed to apply {} to {}.", regexPattern.pattern(), input, e);
|
||||
}
|
||||
}
|
||||
return input;
|
||||
|
|
Loading…
Add table
Reference in a new issue