Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit instrumentation on interfaces #6866

Merged
merged 1 commit into from Nov 17, 2021
Merged

Limit instrumentation on interfaces #6866

merged 1 commit into from Nov 17, 2021

Commits on Nov 17, 2021

  1. Limit instrumentation on interfaces

    Previously, Robolectric enabled some of its instrumentation on interfaces
    in order to support hooking up interceptors on default interface methods.
    This is because there are now some default interface methods that invoke
    System.logW (e.g. android.compat.Compatibility$BehaviorChangeDelegate)
    
    However, the instrumentation step that makes classes public
    was also applied to interfaces, and this seems to confuse Mockito/ByteBuddy,
    but only in certain environments.
    
    As a fix, restrict the instrumentation to only rewrite interface method
    bodies, as well as extends 'InstrumentedInterface', so Robolectric does
    not re-instrument interfaces when the preinstrumented jars are used.
    
    A test case will be added after the preinstrumented jar version is
    bumped.
    
    Fixes #6858
    
    PiperOrigin-RevId: 410440888
    hoisie committed Nov 17, 2021
    Copy the full SHA
    0f1c9be View commit details
    Browse the repository at this point in the history