Remove outdated muzzle condition (#2906)
* Remove outdated muzzle condition * Remove outdated test
This commit is contained in:
parent
70c164216d
commit
690e3bdd16
|
@ -119,10 +119,6 @@ public final class ReferenceMatcher {
|
||||||
}
|
}
|
||||||
// helper classes get their own check: whether they implement all abstract methods
|
// helper classes get their own check: whether they implement all abstract methods
|
||||||
return checkHelperClassMatch(reference, typePool);
|
return checkHelperClassMatch(reference, typePool);
|
||||||
} else if (helperClassNames.contains(reference.getClassName())) {
|
|
||||||
// skip muzzle check for those helper classes that are not in instrumentation packages; e.g.
|
|
||||||
// some instrumentations inject guava types as helper classes
|
|
||||||
return emptyList();
|
|
||||||
} else {
|
} else {
|
||||||
TypePool.Resolution resolution = typePool.describe(reference.getClassName());
|
TypePool.Resolution resolution = typePool.describe(reference.getClassName());
|
||||||
if (!resolution.isResolved()) {
|
if (!resolution.isResolved()) {
|
||||||
|
|
|
@ -167,20 +167,6 @@ class ReferenceMatcherTest extends Specification {
|
||||||
"staticB" | Type.getType(MethodBodyAdvice.B).getDescriptor() | [STATIC, PROTECTED_OR_HIGHER] | MethodBodyAdvice.A | [] | "match static field"
|
"staticB" | Type.getType(MethodBodyAdvice.B).getDescriptor() | [STATIC, PROTECTED_OR_HIGHER] | MethodBodyAdvice.A | [] | "match static field"
|
||||||
}
|
}
|
||||||
|
|
||||||
def "should ignore helper classes from third-party packages"() {
|
|
||||||
given:
|
|
||||||
def emptyClassLoader = new URLClassLoader(new URL[0], (ClassLoader) null)
|
|
||||||
def reference = new Reference.Builder("com.google.common.base.Strings")
|
|
||||||
.build()
|
|
||||||
|
|
||||||
when:
|
|
||||||
def mismatches = createMatcher([reference], [reference.className])
|
|
||||||
.getMismatchedReferenceSources(emptyClassLoader)
|
|
||||||
|
|
||||||
then:
|
|
||||||
mismatches.empty
|
|
||||||
}
|
|
||||||
|
|
||||||
def "should not check abstract #desc helper classes"() {
|
def "should not check abstract #desc helper classes"() {
|
||||||
given:
|
given:
|
||||||
def reference = new Reference.Builder(className)
|
def reference = new Reference.Builder(className)
|
||||||
|
|
Loading…
Reference in New Issue