Skip to content

Conversation

@pq
Copy link
Collaborator

@pq pq commented May 23, 2025

Back In 2019, we added some logic to reflectively access a not-yet public "GRADLE_SYNC_TOPIC" on GradleSyncState subscribing a listener that called GradleUtils.checkDartSupport() on all sync events.

Sometime since then, the field has gone away entirely and we are not getting these notifications. What makes this interesting is how our use of reflection masked the failure.

Luckily, an inspection flagged the unsafe check, spamming our logs at runtime:

image

My first attempt was to fix the cast but I'm glad I embraced the yak shave. "Safe" reflective access in this case would still have obscured the unnecessariness of this code.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

@pq pq requested review from helin24 and jwren May 23, 2025 16:32
@pq pq merged commit 41befe0 into flutter:master May 23, 2025
7 checks passed
@pq pq deleted the cq_uncheckedReflection branch May 23, 2025 18:29
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.

2 participants