Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-25365] - Get rid of error-prone regexps in MacroString…
…Helper

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information
oleg-nenashev committed Oct 30, 2014
1 parent a14b1bb commit 816a741
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -193,7 +193,7 @@ private static String substituteParametersNoCheck(
* @return true if the string
*/
public static boolean containsMacro(@CheckForNull String str) {
return str != null && str.matches(".*\\$\\{.*\\}.*");
return str != null && str.contains("${");
}

/**
Expand All @@ -203,7 +203,7 @@ public static boolean containsMacro(@CheckForNull String str) {
* @return true if the string contains the specified variable
*/
public static boolean containsVariable(@CheckForNull String str, @Nonnull String variableName) {
return str != null && str.matches(".*\\$\\{" + variableName + "\\}.*");
return str != null && str.contains("${" + variableName + "}");
}

/**
Expand Down

0 comments on commit 816a741

Please sign in to comment.