From 37dcb6f254c4fef890069f0865be429f66814446 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Fri, 20 May 2016 15:31:15 +0200 Subject: [PATCH] Granule parsing: Cast float into double. --- src/main/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrl.java b/src/main/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrl.java index dbc32c1..fdb3837 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrl.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrl.java @@ -97,7 +97,13 @@ public class GranuleCtrl { private Double parseDouble(int rowId, GranuleEnum granule) { Double d = null; try { - d = (Double) data.getCell(rowId, granule.toString()); + Object lObj = data.getCell(rowId, granule.toString()); + if (lObj instanceof Double) { + d = (Double) lObj; + } + if (lObj instanceof Float) { + d = new Double((Float) lObj); + } } catch (IllegalArgumentException e) { LOGGER.log(Level.WARNING, String.format(ERROR_MSG, granule, rowId, "double.NaN"), e); } -- libgit2 0.21.2