GitHub user BruceKuiLiu opened a pull request:

    https://github.com/apache/poi/pull/75

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

    Using new NumberConstructor(num) is guaranteed to always result in a new 
object whereas Number.valueOf(num) 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_NUMBER_CTOR
    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/poi master

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

    https://github.com/apache/poi/pull/75.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 #75
    
----
commit b8105b6c54da21658dea7b00966a2d57eb33bc8c
Author: Kui LIU <[email protected]>
Date:   2017-10-12T21:47:27Z

    Replace the inefficient Number constructor with static Number.valueOf() 
method.
    
    Using new NumberConstructor(num) is guaranteed to always result in a new 
object whereas Number.valueOf(num) 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_NUMBER_CTOR
    http://findbugs.sourceforge.net/bugDescriptions.html#DM_FP_NUMBER_CTOR

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to