Fix AbstractMethodError when opening the git panel - #82
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Opening the Git panel in the editor crashed the app:
GitPanelApi.Paneldeclared default argument values. For a@Composableinterface member, the Compose compiler emits aComposeDefaultImpls.Panel$defaultbridge that calls the abstract method with a synthesised signature. While the interface and its implementation lived in the same module that resolved fine. Once the interface moved to:feature:git:apiandGitPanelApiImplstayed in:feature:git, the bridge in one module no longer matched the override compiled in the other.It compiles cleanly, passes detekt, passes every unit test, and throws the first time the panel is composed. Nothing in the JVM test suite can see it.
What changed
Removed the default values from
GitPanelApi.Panel. The single call site inEditorDraweralready passed all eight arguments explicitly, so the defaults were never used — they were pure liability across a module boundary. A comment on the interface records why they must not come back.The
LongParameterListbaseline entry was re-keyed, since the signature string changed with the defaults removed.Behavior
Fixes a crash. The Git panel now opens.
Tests
Verification
Verified on an emulator (API 36, x86_64), which is how the bug was found in the first place:
FATAL EXCEPTION: AbstractMethodErrorAlso re-checked on device while here, all clean:
/storage/emulated/0/Documentsinto the Save location field, confirming saved-state result delivery through the feature-owned route key./gradlew test detekt verifyModuleBoundaries— BUILD SUCCESSFUL.