You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "John Wagenleitner (JIRA)" <ji...@apache.org> on 2016/07/07 20:34:11 UTC
[jira] [Resolved] (GROOVY-7697) GroovyScriptEngine.loadScriptByName
doesn't support environment variable "groovy.ast"
[ https://issues.apache.org/jira/browse/GROOVY-7697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Wagenleitner resolved GROOVY-7697.
---------------------------------------
Resolution: Fixed
Assignee: John Wagenleitner
Fix Version/s: 2.4.8
Merged PR from [~andresteingress]
Thanks for reporting the issue.
> GroovyScriptEngine.loadScriptByName doesn't support environment variable "groovy.ast"
> -------------------------------------------------------------------------------------
>
> Key: GROOVY-7697
> URL: https://issues.apache.org/jira/browse/GROOVY-7697
> Project: Groovy
> Issue Type: Bug
> Reporter: Marc Ewert
> Assignee: John Wagenleitner
> Fix For: 2.4.8
>
>
> When setting the environment variable "groovy.ast" to "xml" and calling GroovyScriptEngine.loadScriptByName a FileNotFoundException is thrown (which is caught internally), because a FileWriter is created from a String representation of an URI.
> In class SourceUnit method saveAsXML there should be some code added like:
> {code}
> FileWriter writer;
> if (name.startsWith("file:")) {
> writer = new FileWriter(new File(new URI(name + ".xml")));
> } else {
> writer = new FileWriter(name + ".xml")
> }
> ...
> {code}
> Or however URIs are handled in Groovy. Exception handling still has to be added.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)