library/src/main/java/com/alibaba/dcm/internal/JavaVersion.java
private static float toFloat(final String str, final float defaultValue) {
        if (str == null) {
            return defaultValue;
        }
        try {
            return Float.parseFloat(str);
        } catch (final NumberFormatException nfe) {
            return defaultValue;
        }
    }
/**
     * <p>Convert a {@code String} to a {@code float}, returning a
     * default value if the conversion fails.</p>
     *
     * <p>If the string {@code str} is {@code null}, the default
     * value is returned.</p>
     *
     * <pre>
     *   NumberUtils.toFloat(null, 1.1f)   = 1.0f
     *   NumberUtils.toFloat("", 1.1f)     = 1.1f
     *   NumberUtils.toFloat("1.5", 0.0f)  = 1.5f
     * </pre>
     *
     * @param str          the string to convert, may be {@code null}
     * @param defaultValue the default value
     * @return the float represented by the string, or defaultValue
     * if conversion fails
     * @since 2.1
     */
Convert a  String to a  float, returning a
default value if the conversion fails.

If the string  str is  null, the default
value is returned.



@param str          the string to convert, may be  null
@param defaultValue the default value
@return the float represented by the string, or defaultValue
if conversion fails
@since 2.1
Convert a String to a float returning a default value if the conversion fails . If the string str is null the default value is returned . @param str the string to convert may be null @param defaultValue the default value @return the float represented by the string or defaultValue if conversion fails @since 2 . 1
private static float toFloat(final String str, final float defaultValue) {
        if (str == null) {
            return defaultValue;
        }
        try {
            return Float.parseFloat(str);
        } catch (final NumberFormatException nfe) {
            return defaultValue;
        }
    }
private static float toFloat ( final String str , final float defaultValue ) { if ( str == null ) { return defaultValue ; } try { return Float . parseFloat ( str ) ; } catch ( final NumberFormatException nfe ) { return defaultValue ; } }
<p>Convert a {@code String} to a {@code float}, returning a
 default value if the conversion fails.</p>
<p > Convert a { @code String } to a { @code float } returning a default value if the conversion fails . < / p >