Skip to content

[google_maps_flutter] Fix various Java warnings#11516

Merged
auto-submit[bot] merged 4 commits intoflutter:mainfrom
stuartmorgan-g:maps-android-warning-fixes
Apr 17, 2026
Merged

[google_maps_flutter] Fix various Java warnings#11516
auto-submit[bot] merged 4 commits intoflutter:mainfrom
stuartmorgan-g:maps-android-warning-fixes

Conversation

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

Fixes various warnings and suggestions that show up in Android Studio:

  • Adopt pattern and switch expressions now that we require Java 17
  • Add some missing nullability annotations
  • Removes some dead code left over from before the Pigeon migration
  • Fixes typos

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

Fixes various warnings and suggestions that show up in Android Studio:
- Adopt pattern and switch expressions now that we require Java 17
- Add some missing nullability annotations
- Removes some dead code left over from before the Pigeon migration
- Fixes typos
@flutter-dashboard
Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator Author

test-exempt: code refactor with no semantic change

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator Author

There are still a lot of warnings about potential NPEs (mostly, but not all, in cases where we'd have to call native methods in the wrong order for them to happen), but I didn't try to address those here since those would be much more involved fixes. These are almost all just auto-apply of IDE fixes.

@stuartmorgan-g stuartmorgan-g changed the title [google_maps_flutter] Fix Java warnings [google_maps_flutter] Fix various Java warnings Apr 15, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Android Google Maps implementation to resolve Java warnings and modernize the code. Significant changes include the adoption of Java 17 features such as pattern matching for instanceof and switch expressions, the use of try-with-resources for InputStream handling, and the addition of nullability annotations across multiple classes. The PR also removes unused imports, methods, and the ProxyLifecycleProvider class, while fixing minor typos in parameter names. Review feedback highlights opportunities to improve consistency by placing nullability annotations before access modifiers and ensuring all relevant fields are annotated.

@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label Apr 15, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 17, 2026
@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label Apr 17, 2026
@stuartmorgan-g
Copy link
Copy Markdown
Collaborator Author

Oops, I had commits that were supposed to be a follow-up PR that I apparently landed in this branch. I'll fix and force-push shortly.

@stuartmorgan-g stuartmorgan-g force-pushed the maps-android-warning-fixes branch from a60deda to a498ee7 Compare April 17, 2026 14:00
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 17, 2026
@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Apr 17, 2026
@auto-submit auto-submit Bot merged commit 934ba21 into flutter:main Apr 17, 2026
82 checks passed
pull Bot pushed a commit to Klomgor/flutter that referenced this pull request Apr 20, 2026
…er#185287)

flutter/packages@c2e3d1f...01c505f

2026-04-20 engine-flutter-autoroll@skia.org Roll Flutter from
8e8a194 to 2844af6 (13 revisions) (flutter/packages#11531)
2026-04-17 stuartmorgan@google.com [google_maps_fluter] Switch to Kotlin
Pigeon (flutter/packages#11522)
2026-04-17 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
db50e20 to cc0734a (8 revisions) (flutter/packages#11525)
2026-04-17 engine-flutter-autoroll@skia.org Roll Flutter from
31f1802 to 8e8a194 (22 revisions) (flutter/packages#11523)
2026-04-17 stuartmorgan@google.com [google_maps_flutter] Fix various
Java warnings (flutter/packages#11516)
2026-04-16 srawlins@google.com [google_maps_flutter] Use super
parameters in more places in examples (flutter/packages#11517)
2026-04-16 engine-flutter-autoroll@skia.org Roll Flutter from
c1b14e9 to 31f1802 (46 revisions) (flutter/packages#11518)
2026-04-15 stuartmorgan@google.com [tool] Update java formatter
(flutter/packages#11508)
2026-04-15 stuartmorgan@google.com [quick_actions] Remove manual thread
hop in Android response (flutter/packages#11445)
2026-04-15 49699333+dependabot[bot]@users.noreply.github.com Bump
lewagon/wait-on-check-action from 1.6.0 to 1.7.0 in the
all-github-actions group (flutter/packages#11510)
2026-04-14 magder@google.com Skip dependabot updates for minor versions
of gradle and kotlin (flutter/packages#11509)
2026-04-14 chick.developer@gmail.com [go_router] Fix pop() restoring
stale configuration when route has onExit (flutter/packages#11241)
2026-04-14 stuartmorgan@google.com [url_launcher] Switch to Kotlin
Pigeon (flutter/packages#11473)
2026-04-14 okorohelijah@google.com [pr-fix] Run all flutter/packages
macOS tests using Xcode 26 and iOS 26 simulator (flutter/packages#10635)
2026-04-14 bolling.ludwig@gmail.com [camera_platform_interface] Add
setJpegImageQuality method (flutter/packages#11454)
2026-04-14 engine-flutter-autoroll@skia.org Roll Flutter from
2fa45e0 to c1b14e9 (19 revisions) (flutter/packages#11506)
2026-04-14 stuartmorgan@google.com [local_auth] Switch to Kotlin Pigeon
(flutter/packages#11482)
2026-04-13 fluttergithub-bot@google.com Sync release-go_router to main
(flutter/packages#11499)
2026-04-13 slater.jay@gmail.com [mustache_template] Fix auto-generated
specification tests, run with `dart test` (flutter/packages#11056)
2026-04-13 engine-flutter-autoroll@skia.org Roll Flutter from
bf18e39 to 2fa45e0 (19 revisions) (flutter/packages#11497)
2026-04-10 engine-flutter-autoroll@skia.org Roll Flutter from
81c87ea to bf18e39 (18 revisions) (flutter/packages#11488)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: google_maps_flutter platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants