FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix #158: Enforce unique inputs in cellsToMultiPolygon by requiring Set by dyrpsf · Pull Request #208 · uber/h3-java · GitHub

/ h3-java Public

Fix #158: Enforce unique inputs in cellsToMultiPolygon by requiring Set - #208

Open
dyrpsf wants to merge 1 commit into
uber:masterfrom
dyrpsf:fix-158-cellstomultipolygon-set
Open

Fix #158: Enforce unique inputs in cellsToMultiPolygon by requiring Set#208
dyrpsf wants to merge 1 commit into
uber:masterfrom
dyrpsf:fix-158-cellstomultipolygon-set

Conversation

dyrpsf commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #158.

As discussed in the issue, passing duplicate hexagon indices into cellsToMultiPolygon can cause a SIGSEGV crash in the underlying C library.

This PR enforces uniqueness at the API level by updating the method signatures in H3Core to require a Set instead of a Collection.

Changes included:

  • Updated cellsToMultiPolygon and cellAddressesToMultiPolygon in H3Core.java to require Set.
  • Updated the H3CoreV3 backward-compatibility layer to wrap incoming Collections in a HashSet before delegating to the core API, ensuring legacy users don't experience breaking API changes.
  • Updated the test suite (swapped ImmutableList for ImmutableSet and wrapped legacy list variables) to compile against the new stricter API.

Testing

Local Java compilation succeeds. Relying on CI to execute the test suite against the compiled native binaries.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

About Handling Error in cellsToMultiPolygon

1 participant


Back | FazBrowse Home | New Git URL