Check for java concurrent classes prefixes match only if class was not whitelisted already

This commit is contained in:
Nikolay Martynov 2018-06-06 15:51:30 -04:00
parent bbcc2882ab
commit d6aaee1bee
1 changed files with 7 additions and 4 deletions

View File

@ -112,10 +112,13 @@ public final class ExecutorInstrumentation extends Instrumenter.Configurable {
public boolean matches(final TypeDescription target) {
boolean whitelisted = WHITELISTED_EXECUTORS.contains(target.getName());
for (String name : WHITELISTED_EXECUTORS_PREFIXES) {
if (target.getName().startsWith(name)) {
whitelisted = true;
break;
// Check for possible prefixes match only if not whitelisted already
if (!whitelisted) {
for (String name : WHITELISTED_EXECUTORS_PREFIXES) {
if (target.getName().startsWith(name)) {
whitelisted = true;
break;
}
}
}