Skip to content

Commit

Permalink
[JENKINS-37566] - Get rid of the dead store in RegExpClassFilter#add()
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Nov 9, 2017
1 parent 49c67ee commit 1d3b294
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/hudson/remoting/ClassFilter.java
Expand Up @@ -217,12 +217,13 @@ void add(String pattern) throws ClassFilterException {
// this is a simple startsWith test, no need to slow things down with a regex
blacklistPatterns.add(pattern.substring(3, pattern.length() - 4));
} else {
final Pattern regex;
try {
Pattern regex = Pattern.compile(pattern);
regex = Pattern.compile(pattern);
} catch (PatternSyntaxException ex) {
throw new ClassFilterException("Cannot add RegExp class filter", ex);
}
blacklistPatterns.add(Pattern.compile(pattern));
blacklistPatterns.add(regex);
}
}

Expand Down

0 comments on commit 1d3b294

Please sign in to comment.