You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by BruceKuiLiu <gi...@git.apache.org> on 2017/10/11 08:46:44 UTC

[GitHub] camel pull request #2023: Replace the inefficient Double constructor with st...

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 <br...@gmail.com>
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

----


---

[GitHub] camel pull request #2023: Replace the inefficient Double constructor with st...

Posted by BruceKuiLiu <gi...@git.apache.org>.
Github user BruceKuiLiu closed the pull request at:

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


---