Closed
Description
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:
- VerifyError when trying to compile constructor invocation with SpEL [SPR-13781] #18355 VerifyError when trying to compile constructor invocation with SpEL
Referenced from: commits 58756b0, e410129, 94ee763
Backported to: 4.1.9