catches a overseen RuntimeException; see #654

This commit is contained in:
hneemann 2021-02-16 21:49:22 +01:00
parent 59a1577782
commit 160f9e80e8

View File

@ -145,10 +145,14 @@ public final class Bits {
if (str.indexOf(':') >= 0)
return decodeFixed(str);
if (str.indexOf('.') > -1) {
if (str.endsWith("d") || str.endsWith("D"))
return Double.doubleToLongBits(Double.parseDouble(str.substring(0, str.length() - 1)));
else
return Float.floatToIntBits(Float.parseFloat(str));
try {
if (str.endsWith("d") || str.endsWith("D"))
return Double.doubleToLongBits(Double.parseDouble(str.substring(0, str.length() - 1)));
else
return Float.floatToIntBits(Float.parseFloat(str));
} catch (java.lang.NumberFormatException e) {
throw new NumberFormatException(str, 0);
}
}
int p = 0;