Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
p = [1,2,3]
pp = '' + p
obj = new GroovyShell().evaluate(pp)
print obj
– the above works
p = [1,2,3]
obj = new GroovyShell().evaluate("${p}")
print obj
– produces argument mismatch exception.
The reason seems to be that the evaluate() takes a String, rather than GString. The Strange thing is that it somehow still prints the value, in spite of the exception.
Attachments
Issue Links
- duplicates
-
GROOVY-309 GString is not always converted to String when calling a Java method
- Closed