dsmiley commented on a change in pull request #1963:
URL: https://github.com/apache/lucene-solr/pull/1963#discussion_r545935476



##########
File path: solr/solrj/src/java/org/apache/solr/common/util/PropertiesUtil.java
##########
@@ -22,17 +22,23 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
+import java.util.function.Function;
+
 
 /**
  * Breaking out some utility methods into a separate class as part of 
SOLR-4196. These utils have nothing to do with
  * the DOM (they came from DomUtils) and it's really confusing to see them in 
something labeled DOM
  */
 public class PropertiesUtil {
+  public static String substituteProperty(String value, Properties 
coreProperties) {
+    if(coreProperties == null) return substitute(value, null);
+    return substitute(value, coreProperties::getProperty);
+  }
   /*
   * This method borrowed from Ant's PropertyHelper.replaceProperties:
   *   
http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
   */
-  public static String substituteProperty(String value, Properties 
coreProperties) {
+  public static String substitute(String value, Function<String,String> 
coreProperties) {

Review comment:
       @noblepaul  FYI `java.util.function.UnaryOperator` is a Function over 
same-type.  No need to go change this now; it's a minor point.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to