Skip to content

Conversation

copybara-service[bot]
Copy link

Clarify @DoNotMock error message in ClassInstrumentor

Robolectric's ClassInstrumentor adds a @DoNotMock annotation to Android classes
that originally contained the 'final' modifier.

The warning message always suggested to create or enhance a Shadow for the
Android class being instrumented. However, there are cases when it is
preferable to create a Builder, such as when the class is a pure Java data
class.

Update the @DoNotMock message to include this nuance.

Note that this @DoNotMock annotation is purely informative and requires special
infrastructure to enforce, so it's not on by default for Gradle/third-party
projects.

Robolectric's ClassInstrumentor adds a @DoNotMock annotation to Android classes
that originally contained the 'final' modifier.

The warning message always suggested to create or enhance a Shadow for the
Android class being instrumented. However, there are cases when it is
preferable to create a Builder, such as when the class is a pure Java data
class.

Update the `@DoNotMock` message to include this nuance.

Note that this @DoNotMock annotation is purely informative and requires special
infrastructure to enforce, so it's not on by default for Gradle/third-party
projects.

PiperOrigin-RevId: 625720769
@copybara-service copybara-service bot merged commit f8bbdb1 into google Apr 17, 2024
@copybara-service copybara-service bot deleted the piper_625065769 branch April 17, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant