Repository navigation
fix: avoid false removal warnings for shared StringBuilder blocks - #3040
Open
David-the-happy-piglet wants to merge 1 commit into
Open
David-the-happy-piglet wants to merge 1 commit into
David-the-happy-piglet wants to merge 1 commit into
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.
Description
Fixes #2904.
A StringBuilder chain in a basic block shared by two regions can be simplified correctly while still producing
Instruction removed from duplicated block. Use block-local cleanup only when every removed instruction is physically in the same block as the replacementtoStringcall, so both generated occurrences receive the same replacement.Other chains, including those spanning blocks, retain the existing cleanup path and diagnostics. The separate
Code duplicatedwarning remains unchanged.Add Raung regressions for the shared-block false warning, ordinary single-entry simplification, and a cross-block case that must retain the removal warning.
Validation
Build environment
Validated on macOS arm64 with Oracle JDK 25.0.1 running Gradle 9.8.2 and
JADX_BUILD_JAVA_VERSION=11selecting Temurin 11.0.32.1+1 for compilation and tests.The initial
clean build distattempts encountered Eclipse formatter class-loading errors and a macOS packaging failure because the selected Java 11 toolchain lacksjpackage. Rerunning without build-cache reuse and parallel projects resolved the formatter errors. SettingBADASS_RUNTIME_JAVA_HOMEto the installed JDK 25 resolved runtime-image creation and packaging, while compilation and tests remained on Java 11.All clean build checks and distribution tasks were completed across these retries. The final
build distsucceeded and produced ZIP and macOS DMG artifacts. No source/build configuration was changed to address these environment issues, and no checks were excluded.Not verified
The original APK/dex2jar flow, physical Android devices, interactive GUI behavior, Windows/Linux execution, or installer execution. The 3 existing skips are one Java 17 profile test under Java 11 and two disabled network update checks.