[GitHub] [tomcat] FSchumacher commented on pull request #309: Allow recursive substitution of properties.

2020-06-26 Thread GitBox


FSchumacher commented on pull request #309:
URL: https://github.com/apache/tomcat/pull/309#issuecomment-650230095


   I tried to push to this PR branch directly, but I think I messed it up :( 
   The current change is not thread safe. I would go with a method parameter 
and a wrapper to count the iterations.
   ```
   public String method(String param) { return "something"; }
   ```
   to
   ```
   public String method(String param) { return method(param, 0); }
   private String method(String param, int depth) {
 if (depth > 5) { return param; }
 return method(param, depth+1);
   }
   ```



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:
us...@infra.apache.org



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



[GitHub] [tomcat] FSchumacher commented on pull request #309: Allow recursive substitution of properties.

2020-06-26 Thread GitBox


FSchumacher commented on pull request #309:
URL: https://github.com/apache/tomcat/pull/309#issuecomment-650099473


   That could lead to a StackOverflowError.
   ```
   @Test
   public void testReplacePropertiesRecursively() {
   Properties properties = new Properties();
   properties.setProperty("replaceMe", "something ${replaceMe}");
   IntrospectionUtils.replaceProperties("${replaceMe}", properties, null, 
null);
   }
   ```
   Perhaps we should add a max depth parameter here?



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:
us...@infra.apache.org



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