aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java')
-rw-r--r--src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java b/src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java
index 7ba362e..c9c9c3c 100644
--- a/src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java
+++ b/src/net/java/sip/communicator/impl/configuration/JdbcConfigService.java
@@ -595,6 +595,35 @@ public final class JdbcConfigService
* (non-Javadoc)
*
* @see
+ * org.jitsi.service.configuration.ConfigurationService#getDouble(java.lang
+ * .String, double)
+ */
+ @Override
+ public double getDouble(String propertyName, double defaultValue)
+ {
+ Object value = this.getProperty(propertyName);
+ if (value == null || "".equals(value.toString()))
+ {
+ return defaultValue;
+ }
+
+ try
+ {
+ return Double.parseDouble(value.toString());
+ }
+ catch (NumberFormatException ex)
+ {
+ logger.error(String.format(
+ "'%s' for property %s not a double, returning default (%s)",
+ value, propertyName, defaultValue), ex);
+ return defaultValue;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
* org.jitsi.service.configuration.ConfigurationService#getLong(java.lang
* .String, long)
*/