Skip to content
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

Remove String#toCharArray from ScriptUtils [SPR-15075] #19641

Closed
spring-issuemaster opened this issue Dec 31, 2016 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Dec 31, 2016

Philippe Marschall opened SPR-15075 and commented

ScriptUtils contains two calls to String#toCharArray for the sole purpose to iterating over all chars in a String. Not only is this unnecessary and can be replaced with String#charAt it also causes additional allocator and heap pressure because String#toCharArray rather than returning the backing array (which is gone in Java 9) creates a copy.


Referenced from: pull request #1280, and commits d912f77, 35bd00b, 131d2c2

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 31, 2016

Juergen Hoeller commented

Let's backport this to 4.3.6 as well.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 3, 2017

Stéphane Nicoll commented

PR merged and backported to 4.3.x. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.