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: problems using primitives with instanceof operator [SPR-14250] #18823

Closed
spring-issuemaster opened this issue May 4, 2016 · 1 comment
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 4, 2016

Andy Clement opened SPR-14250 and commented

These two expressions generate bad code when compiled, for slightly different reasons:

3 instanceof T(Integer)
'foo' instanceof T(int)

The first because we didn't box the 3 in the OperatorInstanceOf.generateCode method. The second because primitive types used with instanceof need special handling. (Uncovered whilst testing some docs that Stephane referenced in another bug #18816)


Affects: 4.3 RC1

Issue Links:

  • #18816 Review SpeL relational operators documentation

Referenced from: commits a31f0bb

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 5, 2016

Andy Clement commented

Fixes pushed. All scenarios now handled better:

  • primitive on left of instanceof
  • right hand side is a primitive type reference
  • right hand side is not a 'direct' type reference (but instead something indirect like a variable reference).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.