Issue #1998 fixed NPE in PointDataPluginDao
StorageStatus was not being checked after operation Former-commit-id:152ecaada2
[formerly9686c8fab1
] [formerlyf0c1b109f8
] [formerlyf0c1b109f8
[formerly401cd813f1
]] [formerly1e6ae5a98e
[formerlyf0c1b109f8
[formerly401cd813f1
] [formerly1e6ae5a98e
[formerly 82736d581767831f426a17b0ee9d264fdda7dd64]]]] Former-commit-id:1e6ae5a98e
Former-commit-id: b05ca1d0f206b1ae613a397a0f0995544a7e602e [formerly 94475c71324a05087908449a3190bdfa39879b6a] [formerly6baf80fc5c
[formerly25765f2fb6
]] Former-commit-id:6baf80fc5c
Former-commit-id:7d7ce21036
This commit is contained in:
parent
7355393979
commit
fd535d14fc
2 changed files with 14 additions and 6 deletions
|
@ -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
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -196,7 +197,8 @@ public abstract class PointDataPluginDao<T extends PluginDataObject> extends
|
|||
|
||||
try {
|
||||
StorageStatus ss = ds.store(StoreOp.APPEND);
|
||||
if (ss.getOperationPerformed() == StoreOp.APPEND) {
|
||||
if (!ss.hasExceptions()
|
||||
&& ss.getOperationPerformed() == StoreOp.APPEND) {
|
||||
// increment the indices
|
||||
List<PointDataView> views = containerMap.get(container);
|
||||
int idx = (int) ss.getIndexOfAppend()[0];
|
||||
|
@ -211,9 +213,8 @@ public abstract class PointDataPluginDao<T extends PluginDataObject> extends
|
|||
StorageStatus aggregatedStatus = new StorageStatus();
|
||||
List<StorageException> se = new ArrayList<StorageException>();
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue