sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Fix a never-ending loop when the file to open has a known extensions but is still not recognized as a known format. This happen in particular with XML files.
Date Sun, 17 Jun 2018 11:16:21 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 adce7d736fcc0af66eda70bd31aab3599a5cf629
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Jun 14 15:56:12 2018 +0200

    Fix a never-ending loop when the file to open has a known extensions but is still not
recognized as a known format.
    This happen in particular with XML files.
---
 .../src/main/java/org/apache/sis/storage/DataStoreRegistry.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
b/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
index ef81e33..2dc44de 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
@@ -243,11 +243,10 @@ search:     do {
                 /*
                  * If we filtered providers by the file extension without finding a suitable
provider,
                  * try again with all other providers (even if they are for another file
extension).
+                 * We do that by changing 'matchCondition' from TRUE to FALSE. In all other
cases,
+                 * we stop the search.
                  */
-                if (Boolean.TRUE.equals(matchCondition)) {
-                    matchCondition = Boolean.FALSE;
-                }
-            } while (matchCondition != null);
+            } while (matchCondition != null && (matchCondition = !matchCondition)
== false);
             /*
              * If a provider has been found, or if a provider returned UNDETERMINED, use
that one
              * for opening a DataStore. Note that if more than one provider returned UNDETERMINED,

-- 
To stop receiving notification emails like this one, please contact
desruisseaux@apache.org.

Mime
View raw message