Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.6
-
None
-
Tested on windows XP SP3.
Description
it looks like when we create a variable with name "context" we break the shell.
To reproduce the error just create a variable called "context" and not will work.
If you set the context variable to null it will work again.
Example bellow.
Groovy Shell (1.6.0, JVM: 1.6.0_07)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000> //this works
===> true
groovy:000> a = 1
===> 1
groovy:000> //after this, error!!
===> true
groovy:000> context = "context"
===> context
ERROR org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast
object 'context' with class 'java.lang.String' to class 'groovy.lang.Binding'
at java_lang_Runnable$run.call (Unknown Source)
groovy:000> a = 1
===> 1
ERROR org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast
object 'context' with class 'java.lang.String' to class 'groovy.lang.Binding'
at java_lang_Runnable$run.call (Unknown Source)
groovy:000> purge all
ERROR org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast
object 'context' with class 'java.lang.String' to class 'groovy.lang.Binding'
at java_lang_Runnable$run.call (Unknown Source)
groovy:000>
Attachments
Issue Links
- is a clone of
-
GROOVY-3456 Error when creation a variable named "context"
- Closed