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

Simplify String concatenation #22593

Merged
merged 1 commit into from Mar 14, 2019
Merged

Conversation

stsypanov
Copy link
Contributor

In some cases we can skip creation of StringBuilder or use invokedynamic-based concatenation.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 14, 2019
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Mar 14, 2019
@sbrannen
Copy link
Member

@jhoeller, I've assigned this to you for consideration.

@jhoeller jhoeller removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 14, 2019
@jhoeller jhoeller added this to the 5.2 M1 milestone Mar 14, 2019
@jhoeller jhoeller added the type: task A general task label Mar 14, 2019
@jhoeller jhoeller merged commit 29f382b into spring-projects:master Mar 14, 2019
@izeye
Copy link
Contributor

izeye commented Apr 3, 2019

use invokedynamic-based concatenation

@stsypanov This doesn’t seem to be true unless the Spring Framework itself is compiled against Java 9+. Am I missing something?

@stsypanov stsypanov deleted the str-simp branch April 3, 2019 14:44
@stsypanov
Copy link
Contributor Author

Correct, as mentioned in https://openjdk.java.net/jeps/280 the byte code with indified concatenation is produced by javac of JDK 9. However as of current version (8) javac will produce new StringBuilder().append() implicitly, so explicit declaration of StringBuilder is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants