JDK-4067842 : Float.valueOf() semantic change not for the better
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.1.3
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-07-28
  • Updated: 2001-11-02
  • Resolved: 2001-11-02
Related Reports
Relates :  
Description

Name: rlT66838			Date: 07/28/97


You have changed Float.valueOf() to parse the
entire string (rather than just the first n chars
that are numeric (or decimal).  I understand that
in some cases this is what you want, but I want to
parse off the number even though there is a non
numerical string immediately following it.  It is
especially frustrating becuase you dont offer
any sort of other primitive.  All the float
conversion logic is trapped inside this method with
a silly policy!

======================================================================

Comments
EVALUATION The methods in question only accept the exact strings. Using regular expressions, one can isolate the floating-point string of interest and then pass it to one of the string -> floating-point conversion routines. The current documenation for the Float and Double classes includes a grammar for the strings considered valid floating-point values. ###@###.### 2001-11-01
01-11-2001

WORK AROUND Name: rlT66838 Date: 07/28/97 ====================================================================== Use regular expressions to isloate floating-point string. ###@###.### 2001-11-01
01-11-2001