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 75584297cb34459cbcd195e926995a794279ef6c
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Tue Sep 27 15:56:29 2022 +0200

    Improve a confusing error message when a CRS authority code is not 
recognized.
---
 .../org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
index 417804cb6d..71499eaaae 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
@@ -1277,11 +1277,11 @@ public abstract class GeodeticAuthorityFactory extends 
AbstractFactory implement
             for (final String codespace : getCodeSpaces()) {
                 if (regionMatches(codespace, code, start, end)) {
                     final int n = code.indexOf(Constants.DEFAULT_SEPARATOR, s 
+ 1);
-                    if (n >= 0) {
+                    if (n >= 0 && code.indexOf(Constants.DEFAULT_SEPARATOR, n 
+ 1) < 0) {
                         /*
                          * The separator sometime appears twice, as in 
"EPSG::4326" or "EPSG:8.9:4326".
                          * The part between the two separators is the verion 
number, which we ignore in
-                         * this simple version.
+                         * this simple version provided that it is the last 
semi-colon.
                          */
                         s = n;
                     }

Reply via email to