Remove outdated muzzle condition (#2906)

* Remove outdated muzzle condition

* Remove outdated test
This commit is contained in:
Trask Stalnaker 2021-05-05 00:33:28 -07:00 committed by GitHub
parent 70c164216d
commit 690e3bdd16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 18 deletions

View File

@ -119,10 +119,6 @@ public final class ReferenceMatcher {
}
// helper classes get their own check: whether they implement all abstract methods
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 {
TypePool.Resolution resolution = typePool.describe(reference.getClassName());
if (!resolution.isResolved()) {

View File

@ -167,20 +167,6 @@ class ReferenceMatcherTest extends Specification {
"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"() {
given:
def reference = new Reference.Builder(className)