diff --git a/edexOsgi/com.raytheon.uf.common.datastorage/src/com/raytheon/uf/common/datastorage/StorageStatus.java b/edexOsgi/com.raytheon.uf.common.datastorage/src/com/raytheon/uf/common/datastorage/StorageStatus.java index dfde218953..03a1637c7e 100644 --- a/edexOsgi/com.raytheon.uf.common.datastorage/src/com/raytheon/uf/common/datastorage/StorageStatus.java +++ b/edexOsgi/com.raytheon.uf.common.datastorage/src/com/raytheon/uf/common/datastorage/StorageStatus.java @@ -20,7 +20,6 @@ package com.raytheon.uf.common.datastorage; import com.raytheon.uf.common.datastorage.IDataStore.StoreOp; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -36,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Dec 30, 2008 chammack Initial creation + * Jan 09, 2014 1998 bclement added hasExceptions method, removed ISerializableObject * * * @@ -43,7 +43,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize -public class StorageStatus implements ISerializableObject { +public class StorageStatus { private StorageException[] exceptions; @@ -104,4 +104,11 @@ public class StorageStatus implements ISerializableObject { this.indexOfAppend = indexOfAppend; } + /** + * @return true if exceptions field is populated + */ + public boolean hasExceptions() { + return exceptions != null && exceptions.length > 0; + } + } diff --git a/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java b/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java index a6986c3c30..020c8f032f 100644 --- a/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java +++ b/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java @@ -75,6 +75,7 @@ import com.raytheon.uf.edex.database.plugin.PluginDao; * Apr 29, 2013 1861 bkowal Refactor hdf5 filename generation during reads * into its own method so modelsounding dao can * override it. + * Jan 09, 2014 1998 bclement fixed NPE in persistToHDF5 when store failed * * * @@ -196,7 +197,8 @@ public abstract class PointDataPluginDao extends try { StorageStatus ss = ds.store(StoreOp.APPEND); - if (ss.getOperationPerformed() == StoreOp.APPEND) { + if (!ss.hasExceptions() + && ss.getOperationPerformed() == StoreOp.APPEND) { // increment the indices List views = containerMap.get(container); int idx = (int) ss.getIndexOfAppend()[0]; @@ -211,9 +213,8 @@ public abstract class PointDataPluginDao extends StorageStatus aggregatedStatus = new StorageStatus(); List se = new ArrayList(); for (StorageStatus ss : ssList) { - StorageException[] seArr = ss.getExceptions(); - if (seArr != null) { - se.addAll(Arrays.asList(seArr)); + if (ss.hasExceptions()) { + se.addAll(Arrays.asList(ss.getExceptions())); } }