You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2009/08/05 02:44:49 UTC

Re: svn commit: r801035 - in /commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl: Interpreter.java JexlArithmetic.java

On 05/08/2009, Henrib <hb...@gmail.com> wrote:
>
>
>
>  sebb-3 wrote:
>  >
>  > Author: sebb
>  > Date: Wed Aug  5 00:08:11 2009
>  > New Revision: 801035
>  >
>  > URL: http://svn.apache.org/viewvc?rev=801035&view=rev
>  > Log:
>  > Make boxing explicit (use Integer.valueOf() for numbers that are likely to
>  > be small)
>  > Remove Long=>long conversions where the return value is Long anyway!
>  >
>  > Modified:
>  >
>  > commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/Interpreter.java
>  >
>  > commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
>  >
>  >
>
>
> The findbugs (maven plugin version) was flagging usage of new Long(...) as a
>  performance warning so I changed them to autoboxing which it seemed happy
>  with sometime ago.
>  Not sure if these have really an impact...
>

I think Findbugs is wrong about new Long() unless it is a small number.
[Henri Yandell and I did some tests a while back]

Probably best to suppress this warning. Maybe for Integer as well.

But Byte.valueOf() is definitely likely to be more efficient.

It appears that autoboxing uses Long.valueOf() (at least with Sun Java
1.5), which is why Findbugs did not complain (it looks at the compiled
code).

I added the new Double() etc. to various return statements because IMO
it is better to be explicit about the type that is being returned.

>  --
>  View this message in context: http://www.nabble.com/svn-commit%3A-r801035---in--commons-proper-jexl-branches-2.0-src-main-java-org-apache-commons-jexl%3A-Interpreter.java-JexlArithmetic.java-tp24818432p24818509.html
>  Sent from the Commons - Dev mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r801035 - in /commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl: Interpreter.java JexlArithmetic.java

Posted by Henrib <hb...@gmail.com>.
Ok, good to know; thanks for the explanation.

-- 
View this message in context: http://www.nabble.com/svn-commit%3A-r801035---in--commons-proper-jexl-branches-2.0-src-main-java-org-apache-commons-jexl%3A-Interpreter.java-JexlArithmetic.java-tp24818432p24819227.html
Sent from the Commons - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org