java.lang.Object
org.jruby.util.SafeFloatParser
Deprecated.
A safer way to parse float values
Prevents brute force attacks using the famous Java bug.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static final doubledecimalValue(Number number) Deprecated.protected static final doubledecimalValue(BigDecimal bigDecimal) Deprecated.protected static final DoubleDeprecated.static floatfloatValue(Number number) Deprecated.static floatfloatValue(BigDecimal bigDecimal) Deprecated.static FloatparseFloat(String s) Deprecated.static FloatDeprecated.
-
Constructor Details
-
SafeFloatParser
public SafeFloatParser()Deprecated.
-
-
Method Details
-
valueOf
Deprecated.Safe way of parsing a Float value from a String- Parameters:
s- The input String- Returns:
- the Float value
-
parseFloat
Deprecated.Safe way of parsing a Float value from a String- Parameters:
s- The input String- Returns:
- the Float value
-
floatValue
Deprecated.Safe way of getting the float value
prevents BigDecimal from calling Float.parseFloat()- Parameters:
number-- Returns:
- the float value
-
floatValue
Deprecated.Safe way of getting the float value
Prevents BigDecimal from calling Float.parseFloat()- Parameters:
bigDecimal-- Returns:
- the float value
-
decimalValueOf
Deprecated.Safe parsing of a String into a Double- Parameters:
s- The input String, can be null- Returns:
- The Double value
-
decimalValue
Deprecated.Safe way of getting the double value
prevents BigDecimal from calling Double.parseDouble()- Parameters:
number-- Returns:
- the double value
-
decimalValue
Deprecated.Safe way of getting the double value
Prevents BigDecimal from calling Double.parseDouble()- Parameters:
bigDecimal-- Returns:
- the double value
-