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

Remove enforcing array consistency from CoordinateArraySequence #584

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

jodygarnett
Copy link
Contributor

@jodygarnett jodygarnett commented Aug 26, 2020

Removes check on array used for CoordinateArraySequence, documenting instead that the array must be consistent with the dimension and measures provided. Refactored the protected enforceConsistency method out to the Coordintes utility class for any client code that ends up working with mixed coordines.

@jodygarnett jodygarnett force-pushed the enforceArrayConsistency branch from 90a63e4 to 53735a8 Compare August 26, 2020 23:57
@jodygarnett jodygarnett force-pushed the enforceArrayConsistency branch from 53735a8 to ba136ff Compare August 27, 2020 00:04
@jodygarnett
Copy link
Contributor Author

Thanks for review everyone

* array is not copied).
* of {@link Coordinate}s (the array is not copied).
* <p>
* Ensure the array is of the indicated dimension and measures. The method
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... I wonder if this explanation should be expanded.

The word "Ensure" is throwing me here. Read quickly, could one think that the method is ensuring consistency? (Like it was previously?)

Also, if the requirement is on the inputs, it seems like it'd be better on the description of the coordinates variable.

Honestly, mixing Coordinates and using the common ordinates ought to be fine. Right?

As a concrete suggestion how about something this:

"CoordinateArray should likely contain consistent implementations of the Coordinate for most uses. Mixing types may lead to issues. Callers can create such consistent arrays using {@link CoordinateArrays#enforceConsistency(Coordinate[])}."

@jodygarnett
Copy link
Contributor Author

@jnh5y I have improved the javadoc, David also found a some code improvements to be made. Please merge when the automated checks are passed.

@dr-jts dr-jts changed the title Enforce array consistency Remove enforcing array consistency from CoordinateArraySequence Aug 27, 2020
@dr-jts dr-jts marked this pull request as draft August 27, 2020 20:55
@jodygarnett jodygarnett marked this pull request as ready for review August 27, 2020 21:06
@jodygarnett
Copy link
Contributor Author

Hold up I see Martin marked this as draft, sadly I removed that before noticing he just did so 10 mins ago.

@dr-jts what is up?

Utility method provided for client code working with inconsistent content in the same array

Signed-off-by: Jody Garnett <[email protected]>
@jodygarnett jodygarnett force-pushed the enforceArrayConsistency branch from e01cf23 to 85ea515 Compare August 27, 2020 21:14
@dr-jts
Copy link
Contributor

dr-jts commented Aug 27, 2020

Hold up I see Martin marked this as draft, sadly I removed that before noticing he just did so 10 mins ago.

@dr-jts what is up?
Well it appears to still be changing. But I guess as a result of review. Is there a way to sign off on review?

@jnh5y jnh5y merged commit 23de3b4 into locationtech:master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants