diff options
author | Ocke.Janssen <Ocke.Janssen@oracle.com> | 2010-11-04 12:25:08 +0100 |
---|---|---|
committer | Ocke.Janssen <Ocke.Janssen@oracle.com> | 2010-11-04 12:25:08 +0100 |
commit | 0d57cd758e98f54529d50447112ddae0835f0394 (patch) | |
tree | 5afd6855d64f3181ef6959ab6ef04d0a1ba88051 | |
parent | 7a4c1bac8d258cb755e26ed9a46c391f76ee3508 (diff) |
dba34b: #i115145# catch numberformatexception when creating bigdecimal
-rw-r--r-- | reportbuilder/java/com/sun/star/report/SDBCReportData.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportData.java b/reportbuilder/java/com/sun/star/report/SDBCReportData.java index 769657aa6bf5..a759b1712fe9 100644 --- a/reportbuilder/java/com/sun/star/report/SDBCReportData.java +++ b/reportbuilder/java/com/sun/star/report/SDBCReportData.java @@ -47,7 +47,6 @@ import com.sun.star.util.Time; import java.sql.Timestamp; - public class SDBCReportData implements DataSource { @@ -349,7 +348,7 @@ public class SDBCReportData implements DataSource private Object convertObject(final int type, final Object obj) { - final Object ret; + Object ret; switch (type) { case DataType.DATE: @@ -365,7 +364,14 @@ public class SDBCReportData implements DataSource case DataType.NUMERIC: if (!(obj instanceof Any)) { - ret = new java.math.BigDecimal((String) obj); + try + { + ret = new java.math.BigDecimal(String.valueOf(obj)); + } + catch (NumberFormatException ex) + { + ret = obj; + } } else { |