Parcourir la source

fix #2774 Refactor variable name and update log message

Shinsuke Sugaya il y a 1 an
Parent
commit
2a473626cd

+ 5 - 5
src/main/java/org/codelibs/fess/es/config/exentity/PathMapping.java

@@ -38,7 +38,7 @@ public class PathMapping extends BsPathMapping {
 
 
     protected Pattern regexPattern;
     protected Pattern regexPattern;
 
 
-    protected BiFunction<String, Matcher, String> pathMapper;
+    protected BiFunction<String, Matcher, String> pathMapperFunc;
 
 
     public String getId() {
     public String getId() {
         return asDocMeta().id();
         return asDocMeta().id();
@@ -62,14 +62,14 @@ public class PathMapping extends BsPathMapping {
         }
         }
         final Matcher matcher = regexPattern.matcher(input);
         final Matcher matcher = regexPattern.matcher(input);
         if (matcher.find()) {
         if (matcher.find()) {
-            if (pathMapper == null) {
+            if (pathMapperFunc == null) {
                 final String replacement = StringUtil.isNotBlank(getReplacement()) ? getReplacement() : StringUtil.EMPTY;
                 final String replacement = StringUtil.isNotBlank(getReplacement()) ? getReplacement() : StringUtil.EMPTY;
-                pathMapper = pathMappingHelper.createPathMatcher(matcher, replacement);
+                pathMapperFunc = pathMappingHelper.createPathMatcher(matcher, replacement);
             }
             }
             try {
             try {
-                return pathMapper.apply(input, matcher);
+                return pathMapperFunc.apply(input, matcher);
             } catch (final Exception e) {
             } catch (final Exception e) {
-                logger.warn("Failed to apply {}", pathMapper, e);
+                logger.warn("Failed to apply {} to {}.", regexPattern.pattern(), input, e);
             }
             }
         }
         }
         return input;
         return input;