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 7ccfb5a03bbe78135ef1f2e5ac5285e74a1f00d3
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Thu Apr 14 20:12:39 2022 +0200

    Fix a hole in localization of `GridExtent` string representation.
    This is necessary for platform-independent tests.
---
 .../main/java/org/apache/sis/coverage/grid/GridExtent.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java 
b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java
index 90430252dc..935149a81c 100644
--- 
a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java
+++ 
b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.awt.Rectangle;
 import org.opengis.util.FactoryException;
+import org.opengis.util.InternationalString;
 import org.opengis.geometry.Envelope;
 import org.opengis.geometry.DirectPosition;
 import org.opengis.metadata.spatial.DimensionNameType;
@@ -1610,8 +1611,14 @@ public class GridExtent implements GridEnvelope, 
LenientComparable, Serializable
         final TableAppender table = new TableAppender(out, "");
         final int dimension = getDimension();
         for (int i=0; i<dimension; i++) {
-            CharSequence name;
-            if ((types == null) || (name = Types.getCodeTitle(types[i])) == 
null) {
+            String name = null;
+            if (types != null) {
+                final InternationalString title = Types.getCodeTitle(types[i]);
+                if (title != null) {
+                    name = title.toString(vocabulary.getLocale());
+                }
+            }
+            if (name == null) {
                 name = vocabulary.getString(Vocabulary.Keys.Dimension_1, i);
             }
             final long lower = coordinates[i];

Reply via email to