WMShell: fix instanceof-pattern syntax protologtool can't parse - #5
Open
deepsidhu1313 wants to merge 2 commits into
Open
Conversation
added 2 commits
September 7, 2026 20:29
BubbleStackView.java used `instanceof View view` (Java 16 instanceof pattern matching). javac itself compiles this fine, but the WMShell module's protolog genrules (generate-wm_shell_protolog.json, gen-wmshell.protolog.pb) run protologtool over every source file in :wm_shell-sources looking for ProtoLog.* calls, using its own bundled Java parser -- which doesn't support this syntax and fails the whole module's build with a parse error at this file, even though this file has nothing to do with ProtoLog. Confirmed via grep this was the only instanceof-pattern occurrence in the module. Rewrote as a classic instanceof + explicit cast; behavior is identical.
Follow-up to 301830f6ac09 -- that fix only addressed the first of three identical `instanceof View view` occurrences in this file (grep -l only reports a filename once per match, which hid the other two). Rewrote onUnstuckFromTarget() and onReleasedInTarget() the same way: classic instanceof + explicit cast, since protologtool's bundled Java parser can't handle Java 16 instanceof pattern variables. Confirmed via a full grep of the file that all remaining instanceof usages are already classic-style -- none left to fix.
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.
Found while building lineage-21.0 for flo/flox (Nexus 7 2013) via LineageOS-UL -- but this bug isn't device-specific at all.
BubbleStackView.java used
instanceof View view(Java 16 instanceof pattern matching) in three places. javac compiles this fine, but the WMShell module's protolog genrules (generate-wm_shell_protolog.json, gen-wmshell.protolog.pb) runprotologtoolover every source file in:wm_shell-sourceslooking for ProtoLog.* calls, using its own bundled Java parser -- which doesn't support this syntax and fails the entire module's build with a parse error at this file, even though the file has nothing to do with ProtoLog. Any build environment where javac accepts Java 16+ syntax (which is the norm now) would hit this on any device building WindowManager Shell, not just this one.Rewrote all three occurrences as classic instanceof + explicit cast; behavior is identical. Confirmed via a full grep of the file that these were the only instanceof-pattern occurrences remaining.