Catch class cast exceptions in EssentialsConf

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1491 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-15 16:26:34 +00:00
parent 410f174b23
commit c7208b9b42

View file

@ -186,7 +186,15 @@ public class EssentialsConf extends Configuration
public long getLong(String path, long def)
{
Number num = (Number)getProperty(path);
Number num;
try
{
num = (Number)getProperty(path);
}
catch(ClassCastException ex)
{
return def;
}
if (num == null)
{
return def;
@ -197,7 +205,15 @@ public class EssentialsConf extends Configuration
@Override
public double getDouble(String path, double def)
{
Number num = (Number)getProperty(path);
Number num;
try
{
num = (Number)getProperty(path);
}
catch(ClassCastException ex)
{
return def;
}
if (num == null)
{
return def;