Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: IllegalArgumentException is clearer than ArrayIndexOutOfBounds #1241

Merged
merged 7 commits into from
Dec 20, 2023

Conversation

SseO-KR
Copy link
Contributor

@SseO-KR SseO-KR commented Oct 18, 2023

Motivation

KMZ with empty coordinates throw ArrayIndexOutOfBounds.

  • I think IllegalArgumentException is clearer than ArrayIndexOutOfBounds.

Modification

  • Add throw new IllegalArgumentException("It is wrong coordinate, latitude and longitude should be set"); when empty and wrong coordinates.

Result

  • We can identify more accurate errors when empty and wrong coordinates.



Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Edit the title of this pull request with a semantic commit prefix (e.g. "fix: "), which is necessary for automated release workflows to decide whether to generate a new release and what type it should be.
  • Will this cause breaking changes to existing Java or Kotlin integrations? If so, ensure the commit has a BREAKING CHANGE footer so when this change is integrated a major version update is triggered. See: https://www.conventionalcommits.org/en/v1.0.0/
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #1228 🦕

@google-cla
Copy link

google-cla bot commented Oct 18, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@SseO-KR SseO-KR changed the title fix : IllegalArgumentException is clearer than ArrayIndexOutOfBounds (#1228) fix: IllegalArgumentException is clearer than ArrayIndexOutOfBounds (#1228) Oct 18, 2023
@SseO-KR SseO-KR changed the title fix: IllegalArgumentException is clearer than ArrayIndexOutOfBounds (#1228) fix: IllegalArgumentException is clearer than ArrayIndexOutOfBounds Oct 18, 2023
@wangela wangela requested review from kikoso and wangela October 20, 2023 16:18
@injae-kim
Copy link

Gentle ping to @wangela , Hi! can you review this PR? I need to fix this. thanks! 🙇

@kikoso kikoso self-assigned this Nov 17, 2023
Copy link
Collaborator

@kikoso kikoso left a comment

Choose a reason for hiding this comment

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

Minor comment @SseO-KR , but looks good!

Co-authored-by: Enrique López Mañas <[email protected]>
@SseO-KR
Copy link
Contributor Author

SseO-KR commented Dec 14, 2023

Thanks to review! I updated error message @kikoso !

@wangela wangela merged commit 9c882be into googlemaps:main Dec 20, 2023
8 checks passed
googlemaps-bot pushed a commit that referenced this pull request Dec 20, 2023
## [3.8.2](v3.8.1...v3.8.2) (2023-12-20)

### Bug Fixes

* IllegalArgumentException is clearer than ArrayIndexOutOfBounds ([#1241](#1241)) ([9c882be](9c882be))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 3.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kmz with empty coordinates
5 participants