sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 03/04: Fix an `IndexOutOfBoundsException` when CRS has more dimensions than the dimensions for which a precision has been specified.
Date Thu, 07 Jan 2021 18:08:32 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit e9ea08a99eb502daccf4d6bb50299852140e11ce
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Jan 7 16:59:23 2021 +0100

    Fix an `IndexOutOfBoundsException` when CRS has more dimensions than the dimensions for
which a precision has been specified.
---
 .../src/main/java/org/apache/sis/geometry/CoordinateFormat.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java
b/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java
index 1b23db2..0731a84 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java
@@ -1079,7 +1079,7 @@ abort:  if (dimensions != 0 && groundAccuracy != null) try {
     private void updateAccuracyVisibility() {
         isAccuracyVisible = (accuracyText != null);
         if (isAccuracyVisible && desiredPrecisions != null) {
-            long dimensions = groundDimensions;
+            long dimensions = groundDimensions & (Numerics.bitmask(desiredPrecisions.length)
- 1);
             if (dimensions != 0) {
                 isAccuracyVisible = false;
                 do {


Mime
View raw message