Skip to content
Permalink
Browse files

[JENKINS-37566] - Get rid of the dead store in RegExpClassFilter#add()

  • Loading branch information...
oleg-nenashev committed Nov 9, 2017
1 parent 49c67ee commit 1d3b294b29edb3e85d66885e336ba0ac5e29798a
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/hudson/remoting/ClassFilter.java
@@ -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);
}
}

0 comments on commit 1d3b294

Please sign in to comment.
You can’t perform that action at this time.