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

SpEL compiler creating bad byte code for some values that are added together via OpPlus [SPR-12426] #17032

Closed
spring-projects-issues opened this issue Nov 12, 2014 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 12, 2014

Andy Clement opened SPR-12426 and commented

There is a problem with compilation of operands for the plus operator. If the types of the operands at runtime are strings but the statically determinable types are not strings, then a CHECKCAST is missed out during code gen and a verify error results. Simply example:

public class Foo {
  public Object getObject() { return "hello"; }
}

and the expression object+' world'. The expression will be compiled such that getObject() is called but it is declared to return an Object. When this happens an extra CHECKCAST is necessary during byte code generation to ensure the JVM knows it is really a string.


Affects: 4.1.2

Issue Links:

Referenced from: commits 58756b0, e410129, 94ee763

Backported to: 4.1.9

@spring-projects-issues
Copy link
Collaborator Author

Andy Clement commented

There seems to have been some work on this previously but it wasn't quite done. I've completed it and verified the casts are included when necessary (and not included when not necessary).

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I'll backport this to 4.1.9 later this week, along with some other changes.

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.2.4 milestone Jan 11, 2019
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) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants