Skip to content

WMShell: fix instanceof-pattern syntax protologtool can't parse - #5

Open
deepsidhu1313 wants to merge 2 commits into
LineageOS-UL:lineage-21.0from
deepsidhu1313:fix-bubblestackview-protologtool-parse-error
Open

WMShell: fix instanceof-pattern syntax protologtool can't parse#5
deepsidhu1313 wants to merge 2 commits into
LineageOS-UL:lineage-21.0from
deepsidhu1313:fix-bubblestackview-protologtool-parse-error

Conversation

@deepsidhu1313

Copy link
Copy Markdown

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) 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 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.

aosp-builder 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.
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