Skip to content

Conversation

hduelme
Copy link
Contributor

@hduelme hduelme commented Feb 11, 2023

Integer.valueOf returns an Integer. In this case the target type is int. So Integer.parseInt prevents unnecessary boxing.

new Integer(42) is deprecated and auto boxing will be used to convert from an int to an Integer if needed.

@gregturn gregturn changed the title remove unnecessary boxing for integers Remove unnecessary boxing for integers Apr 10, 2023
@gregturn gregturn closed this in 315eb2b Apr 10, 2023
gregturn pushed a commit that referenced this pull request Apr 10, 2023
@gregturn
Copy link
Contributor

Thanks @hduelme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants