Skip to content

Conversation

@dkhawk
Copy link
Contributor

@dkhawk dkhawk commented Aug 26, 2025

This PR migrates the quadtree and geometry packages from Java to modern, idiomatic Kotlin.

Key Changes:

  • PointQuadTree to Kotlin: The core PointQuadTree class and its tests have been rewritten in Kotlin, improving conciseness and null safety.
  • Point and Bounds to Kotlin: The fundamental Point and Bounds classes in the geometry package have been ported to Kotlin.
    • Careful attention was paid to Java interoperability by using @JvmField and an open class with a manual copy() implementation for Point.
  • Enhanced Test Coverage: New, comprehensive unit tests were added for Point and Bounds, which previously had no dedicated test coverage.

Verification:

  • The entire test suite passes, confirming 100% compatibility with existing Java code.
  • All lint checks pass.

This work modernizes key, platform-independent parts of the library and sets a strong foundation for future Kotlin migrations.

dkhawk added 4 commits August 26, 2025 17:17
This commit migrates the `PointQuadTree` class and its corresponding test, `PointQuadTreeTest`, from Java to idiomatic Kotlin.

This conversion modernizes the codebase, improving its conciseness, readability, and null safety.

The key changes are:
- **`PointQuadTree` to Kotlin**: The core `PointQuadTree` class has been rewritten in Kotlin, leveraging features like primary constructors, companion objects, and stricter nullability.
- **`PointQuadTreeTest` to Kotlin**: The associated test class has also been ported to Kotlin, resulting in more streamlined test code.
- **Copyright Header Update**: The copyright year has been updated in the converted files.
This commit modernizes the `Point` and `Bounds` classes by converting them from Java to idiomatic Kotlin. This change improves code conciseness, readability, and null safety.

Key changes include:
- The `Point` and `Bounds` classes are now written in Kotlin.
- `@JvmField` annotations are used on properties to maintain binary compatibility for Java consumers.
- New unit tests, `PointTest.kt` and `BoundsTest.kt`, have been added to ensure the correctness of the ported classes.
@dkhawk dkhawk requested a review from kikoso August 26, 2025 23:47
@googlemaps-bot
Copy link
Contributor

googlemaps-bot commented Aug 26, 2025

Code Coverage

Overall Project 36.69% -0.3% 🍏
Files changed 89.94% 🍏

File Coverage
Bounds.kt 100% 🍏
Point.kt 94.23% -5.77% 🍏
PointQuadTree.kt 86.73% -13.27% 🍏

@kikoso
Copy link
Collaborator

kikoso commented Aug 27, 2025

Generally thinking: this would release a new version. I don't think this is intrinsically wrong, but wondering if we should instead annotate it with the prefix build" until we have more code written in Kotlin.

@dkhawk dkhawk changed the title feat(kotlin): Port geometry and quadtree packages to Kotlin build: Port geometry and quadtree packages to Kotlin Aug 27, 2025
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.

LGTM!

@dkhawk dkhawk merged commit 12c5a3b into main Aug 27, 2025
10 checks passed
@dkhawk dkhawk deleted the feat/more-ports-to-kotlin branch August 27, 2025 15:07
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 3.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 3.16.0 🎉

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.

3 participants