Refactor an agent usage, and fix logic issue
This commit is contained in:
parent
e65177a143
commit
75af71584c
|
@ -133,9 +133,10 @@ public interface Instrumenter {
|
||||||
*/
|
*/
|
||||||
final ReferenceMatcher muzzle = getInstrumentationMuzzle();
|
final ReferenceMatcher muzzle = getInstrumentationMuzzle();
|
||||||
if (null != muzzle) {
|
if (null != muzzle) {
|
||||||
final List<Reference.Mismatch> mismatches =
|
final boolean isMatch = muzzle.matches(classLoader);
|
||||||
muzzle.getMismatchedReferenceSources(classLoader);
|
if (!isMatch) {
|
||||||
if (mismatches.size() > 0) {
|
final List<Reference.Mismatch> mismatches =
|
||||||
|
muzzle.getMismatchedReferenceSources(classLoader);
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(
|
log.debug(
|
||||||
"Instrumentation muzzled: {} -- {} on {}",
|
"Instrumentation muzzled: {} -- {} on {}",
|
||||||
|
@ -153,7 +154,7 @@ public interface Instrumenter {
|
||||||
Instrumenter.Default.this.getClass().getName(),
|
Instrumenter.Default.this.getClass().getName(),
|
||||||
classLoader);
|
classLoader);
|
||||||
}
|
}
|
||||||
return mismatches.size() == 0;
|
return isMatch;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class ReferenceMatcher
|
||||||
}
|
}
|
||||||
|
|
||||||
mismatchCache.put(loader, mismatches);
|
mismatchCache.put(loader, mismatches);
|
||||||
return true;
|
return mismatches.size() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue