Dedupe simulator paint-scope leak warnings (#5102)#5111
Merged
Conversation
The paint-scope checks added for #5058 fire on every offending repaint, so framework components that routinely leak harmless state (BGPainter, Toolbar, Button, TextArea, the simulator's own SelectedComponentGlassPane) flooded the EDT log at ~60Hz and burned CPU formatting it. Track a (owner-class, leak-kinds) signature per warning and only emit the first occurrence. Auto-restore still runs every time so on-device behavior is unchanged. Also fix SelectedComponentGlassPane to actually save/restore color and alpha around its highlight fill. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 11 screenshots: 11 matched. |
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 46 screenshots: 46 matched. |
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 120 screenshots: 120 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
This was referenced May 30, 2026
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.
Summary
BGPainter,Toolbar,Button,TextArea, and the simulator's ownComponentTreeInspector$SelectedComponentGlassPane) caused the EDT log to flood at ~60Hz and burned CPU formatting it -- this is the spam reported in Debug trace repeating (and eating up the cpu ;-) #5102.JavaSEPort.endPaintScopenow builds an(owner-class, leak-kinds)signature for each leak and only logs the first occurrence per signature ("Further occurrences of this leak shape are suppressed."). Auto-restore still runs on every leak so on-device behavior is unchanged.ComponentTreeInspector.SelectedComponentGlassPane.paintnow save/restores color and alpha around its highlight fill, removing one real leak that was contributing to the noise.PaintScopeTest.repeatedLeakLogsOncePerSignatureinstalls a capturingLog, repeats the same leak 5 times (expects 1 message), runs a second leak on a different owner class (expects 2 messages total), and confirms auto-restore still fires when the warning is suppressed.Fixes #5102.
Test plan
mvn -pl javase test -Dtest=PaintScopeTest— 7/7 pass.BGPainter) and confirm each unique leak shape appears at most once in the log.🤖 Generated with Claude Code