diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 20d271891b..e57d2c2032 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -17,6 +17,7 @@ import java.util.Map; import java.util.ResourceBundle; import java.util.StringTokenizer; import java.util.SimpleTimeZone; +import java.util.Map.Entry; import java.util.logging.Logger; import java.util.logging.Level; import java.util.regex.Matcher; @@ -31,6 +32,36 @@ import org.apache.tools.ant.BuildException; * @author Kohsuke Kawaguchi */ public class Util { + + /** + * Replaces the occurence of '$key' by properties.get('key'). + * + *
+ * This is a rather naive implementation that causes somewhat unexpected
+ * behavior when the expansion contains other macros.
+ */
+ public static String replaceMacro(String s, Map