Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #2040
- Loading branch information