Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.0-JSR-6
-
None
Description
my groovy script contains the following lines:
if (true)
{
String = "myPrice"
}
When performing evaluate I would expect to get CompilationFailedException (because a value is being put into java.lang.String and not to a variable) but I get:
java.lang.VerifyError: (class: Script1, method: run signature: ()Ljava/lang/Object Inconsistent stack height 2 != 0
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
at java.lang.Class.getConstructor0(Class.java:1930)
at java.lang.Class.newInstance0(Class.java:278)
at java.lang.Class.newInstance(Class.java:261)
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:529)
at groovy.lang.GroovyShell.parse(GroovyShell.java:526)
at groovy.lang.GroovyShell.parse(GroovyShell.java:506)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:484)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:460)
The interesting thing is when writing:
String = "myPrice" (not inside a condition)
then the evaluate succeeds and there is no error.
Attachments
Issue Links
- is duplicated by
-
GROOVY-1626 Inconsitent stack height when using super
- Closed
-
GROOVY-1566 problems with if statements not returning correctly
- Closed