Skip to content

Avoid unexpected array mutation in CoordinateArraySequence creation #372

Description

@dr-jts

The CoordinateArraySequence enforceArrayConsistency method can create or mutate coordinates in the client Coordinate array.

I'm not sure this is good behaviour because:

  • It hides errors due to uninitialized null coordinates
  • It mutates the passed-in coordinate array, which may introduce unexpected aliasing errors in the client
  • It also creates a throw-away Coordinate object, which is slightly inefficient

It would be better to check Coordinate consistency and throw an exception if they are not consistent.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions