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-projects-issues opened this issue Dec 31, 2016 · 2 comments
Closed

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

spring-projects-issues opened this issue Dec 31, 2016 · 2 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues 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-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 31, 2016

Juergen Hoeller commented

Let's backport this to 4.3.6 as well.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 3, 2017

Stéphane Nicoll commented

PR merged and backported to 4.3.x. Thanks!

@spring-projects-issues spring-projects-issues added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3.6 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants