Skip to content
Permalink
Browse files
[JENKINS-41653] static pattern compilation
  • Loading branch information
escoem committed Oct 24, 2017
1 parent 2f01d2c commit 484b700e203ef1cafcc26b8696de92e92f9f3bfa
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java
@@ -38,6 +38,7 @@
*/
protected static final String SECRET_MARKER = "#secret#";
public static final String OUTPUT_ENCODING = "UTF-8";
public static final Pattern SECRET_PATTERN = Pattern.compile(">\\{(.*)\\}<|>(.*)\\=<");

/**
* find the secret in the xml file and replace it with the place holder
@@ -100,7 +101,7 @@ public void characters(char[] ch, int start, int length) throws SAXException {


private static String findSecretFallback(String xml) {
Matcher matcher = Pattern.compile(">\\{(.*)\\}<|>(.*)\\=<").matcher(xml);
Matcher matcher = SECRET_PATTERN.matcher(xml);
while(matcher.find()) {
String secret = matcher.group();
if(secret.length() > 1)

0 comments on commit 484b700

Please sign in to comment.