You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/07 19:39:11 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15366653#comment-15366653 ]
ASF GitHub Bot commented on GROOVY-7697:
----------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/groovy/pull/330
> 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
>
> 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)