You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/06/29 06:13:59 UTC

[GitHub] [tomcat] jfclere commented on a change in pull request #309: Allow recursive substitution of properties.

jfclere commented on a change in pull request #309:
URL: https://github.com/apache/tomcat/pull/309#discussion_r446793598



##########
File path: java/org/apache/tomcat/util/IntrospectionUtils.java
##########
@@ -332,7 +341,15 @@ public static String replaceProperties(String value,
         }
         if (prev < value.length())
             sb.append(value.substring(prev));
-        return sb.toString();
+        String newval = sb.toString();
+        if (newval.indexOf('$') < 0) {
+            return newval;
+        }
+        if (newval.equals(value))
+            return value;
+        if (log.isDebugEnabled())
+            log.debug("IntrospectionUtils.replaceProperties iter on: " + newval);
+        return replaceProperties(newval, staticProp, dynamicProp, classLoader, iterationCount+1);

Review comment:
       A loop would work to but that is more changes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org