[
https://issues.apache.org/jira/browse/GROOVY-7697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-7697.
-----------------------------
> 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.15#6346)