Hi Stuart, Yes I am fine with the change. I can go back and do this after your push if you prefer, just let me know
Best Lance > On Apr 14, 2016, at 7:13 PM, Stuart Marks <[email protected]> wrote: > > > > On 4/14/16 8:30 AM, Paul Sandoz wrote: >> CachedRowSetImpl >> — >> >> 1966 return ((Float.valueOf(value.toString())).floatValue()); >> >> Use Float.parseFloat ? >> >> >> 2010 return >> ((Double.valueOf(value.toString().trim())).doubleValue()); >> >> Use Double.parseDouble ? > > I'm mostly reluctant to do general cleanups, as it can easily cause one to go > off into the weeds. However, I believe that changing > > new Float(str).floatValue() or > Float.valueOf(str).floatValue() to Float.parseFloat(str) > > and > > new Double(str).doubleValue() or > Double.valueOf(str).doubleValue() to Double.parseDouble(str) > > is generally safe. Essentially the string-arg versions of the constructors > and valueOf() methods just turn around and call parseFloat/Double internally > and store the primitive result in a field; and floatValue() and doubleValue() > simply get this field value. > > This is in Lance's area; Lance, are you OK with this? > >> ExpressionExecuter >> — >> >> 86 Double lval = >> Double.valueOf(((Number)evaluate(l)).doubleValue()); >> 87 Double rval = >> Double.valueOf(((Number)evaluate(r)).doubleValue()); >> 88 double result = op.eval(lval.doubleValue(), >> rval.doubleValue()); >> 89 if (debug) { >> 90 System.out.println("Performed Operation: " + lval + op >> + rval >> 91 + " = " + result); >> 92 } >> 93 return Double.valueOf(result); >> >> How about: >> >> double lval = ((Number)evaluate(l)).doubleValue(); >> double rval = ((Number)evaluate(r)).doubleValue(); >> double result = op.eval(lval, rval); > > Similar here. > > Yes, I'll go ahead and make these changes. > > s'marks <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 [email protected] <mailto:[email protected]>
