Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Kui-Liu
Copy link
Contributor

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

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
Contributor

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

@Kui-Liu
Copy link
Contributor Author

Kui-Liu commented Oct 11, 2017

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