sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] branch geoapi-4.0 updated: Fix an exception when opening a netCDF file with UCAR library.
Date Thu, 17 Jan 2019 09:17: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


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 4d38cf8  Fix an exception when opening a netCDF file with UCAR library.
4d38cf8 is described below

commit 4d38cf84a8e7a24ba242b0b11bd1a4485b90e93e
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Jan 17 10:16:48 2019 +0100

    Fix an exception when opening a netCDF file with UCAR library.
---
 .../main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java | 2 ++
 .../main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java  | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
index acc53b7..4afcd83 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
@@ -108,6 +108,7 @@ public final class DecoderWrapper extends Decoder implements CancelTask
{
     public DecoderWrapper(final NetcdfFile file, final GeometryLibrary geomlib, final WarningListeners<DataStore>
listeners) {
         super(geomlib, listeners);
         this.file = file;
+        groups = new Group[1];
         initialize();
     }
 
@@ -125,6 +126,7 @@ public final class DecoderWrapper extends Decoder implements CancelTask
{
     {
         super(geomlib, listeners);
         file = NetcdfDataset.openDataset(filename, false, this);
+        groups = new Group[1];
         initialize();
     }
 
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
index 8eb744a..70bd8d0 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
@@ -284,8 +284,10 @@ public class NetcdfStoreProvider extends DataStoreProvider {
                 keepOpen = path;
             } catch (IOException | DataStoreException s) {
                 e.addSuppressed(s);
+                throw e;
+            } else {
+                throw e;
             }
-            throw e;
         } else {
             keepOpen = connector.getStorage();
             decoder = createByReflection(keepOpen, true, geomlib, listeners);


Mime
View raw message