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

Prefer non-synthetic constructors in MockMethodAdvice.ConstructorShortcut #2045

Closed
wants to merge 1 commit into from

Commits on Sep 16, 2020

  1. Prefer non-synthetic constructors in MockMethodAdvice.ConstructorShor…

    …tcut
    
    After moving spy creation to instrumenting constructor chains in
    ByteBuddyMockMaker, creating spies for Robolectric-instrumented Android
    classes started failing in some situations due to fields not being
    copied on base classes (specifically, ContextWrapper.mBase). The problem
    is that AsmVisitorWrapper.ForDeclaredMethods does not visit the
    synthetic constructrs that are added by Robolectric during runtime.
    While the visibility issuer is still being explored, a workaround is to
    prefer non-synthetic constructors when selecting which parent
    constructor to call in MockMethodAdvice.ConstructorShortcut.
    
    Fixes mockito#2040
    hoisie committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    6c220a1 View commit details
    Browse the repository at this point in the history