Class SafeFloatParser

java.lang.Object
org.jruby.util.SafeFloatParser

@Deprecated(since="10.0.3.0") public final class SafeFloatParser extends Object
Deprecated.
A safer way to parse float values

Prevents brute force attacks using the famous Java bug.

  • Constructor Details

    • SafeFloatParser

      public SafeFloatParser()
      Deprecated.
  • Method Details

    • valueOf

      @Deprecated(since="10.0.3.0") public static Float valueOf(String s)
      Deprecated.
      Safe way of parsing a Float value from a String
      Parameters:
      s - The input String
      Returns:
      the Float value
    • parseFloat

      @Deprecated(since="10.0.3.0") public static Float parseFloat(String s)
      Deprecated.
      Safe way of parsing a Float value from a String
      Parameters:
      s - The input String
      Returns:
      the Float value
    • floatValue

      @Deprecated(since="10.0.3.0") public static float floatValue(Number number)
      Deprecated.
      Safe way of getting the float value
      prevents BigDecimal from calling Float.parseFloat()
      Parameters:
      number -
      Returns:
      the float value
    • floatValue

      @Deprecated(since="10.0.3.0") public static float floatValue(BigDecimal bigDecimal)
      Deprecated.
      Safe way of getting the float value
      Prevents BigDecimal from calling Float.parseFloat()
      Parameters:
      bigDecimal -
      Returns:
      the float value
    • decimalValueOf

      @Deprecated(since="10.0.3.0") protected static final Double decimalValueOf(String s)
      Deprecated.
      Safe parsing of a String into a Double
      Parameters:
      s - The input String, can be null
      Returns:
      The Double value
    • decimalValue

      @Deprecated(since="10.0.3.0") protected static final double decimalValue(Number number)
      Deprecated.
      Safe way of getting the double value
      prevents BigDecimal from calling Double.parseDouble()
      Parameters:
      number -
      Returns:
      the double value
    • decimalValue

      @Deprecated(since="10.0.3.0") protected static final double decimalValue(BigDecimal bigDecimal)
      Deprecated.
      Safe way of getting the double value
      Prevents BigDecimal from calling Double.parseDouble()
      Parameters:
      bigDecimal -
      Returns:
      the double value