GitHub user BruceKuiLiu opened a pull request:

    https://github.com/apache/camel/pull/2023

    Replace the inefficient Double constructor with static Double.valueOf() 
method.

    
    Using new Double(double) is guaranteed to always result in a new object 
whereas Double.valueOf(double) allows caching of values to be done by the 
compiler, class library, or JVM.
    Using of cached values avoids object allocation and the code will be faster.
    http://findbugs.sourceforge.net/bugDescriptions.html#DM_FP_NUMBER_CTOR

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/BruceKuiLiu/camel master2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/2023.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2023
    
----
commit 1635b99b44dcfec294269ac140596e3b0849de33
Author: Kui LIU <[email protected]>
Date:   2017-10-11T08:44:43Z

    Replace the inefficient Double constructor with static Double.valueOf() 
method.
    
    Using new Double(double) is guaranteed to always result in a new object 
whereas Double.valueOf(double) allows caching of values to be done by the 
compiler, class library, or JVM.
    Using of cached values avoids object allocation and the code will be faster.
    http://findbugs.sourceforge.net/bugDescriptions.html#DM_FP_NUMBER_CTOR

----


---

Reply via email to