Skip to content

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

Closed
Kui-Liu wants to merge 1 commit into
apache:masterfrom
Kui-Liu:master2
Closed

Replace the inefficient Double constructor with static Double.valueOf() method.#2023
Kui-Liu wants to merge 1 commit into
apache:masterfrom
Kui-Liu:master2

Conversation

@Kui-Liu

@Kui-Liu Kui-Liu commented Oct 11, 2017

Copy link
Copy Markdown
Contributor

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

…() 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
@davsclaus

Copy link
Copy Markdown
Contributor

Thanks for the PR it has been merged. Do you mind closing this?

@Kui-Liu

Kui-Liu commented Oct 11, 2017

Copy link
Copy Markdown
Contributor Author

Thanks.

@Kui-Liu Kui-Liu closed this Oct 11, 2017
Croway pushed a commit to Croway/camel that referenced this pull request Mar 14, 2024
…uteConcurrentBigTest

ENTESB-19254 Lower the number of operators an XPath expression can con…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants