groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject incubator-groovy git commit: GROOVY-6669 - Compile in groovyConsole instantiates class (closes #163)
Date Wed, 28 Oct 2015 17:53:50 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/master d1979d119 -> 7048e31fe


GROOVY-6669 - Compile in groovyConsole instantiates class (closes #163)

For scripts that contain Class definitions the GroovyShell#parse calls InvokeHelper#createScript
which creates a new instance in order to bind properties.  The compile command should only
parse the class to make sure there are no syntax errors so this fix just calls the same parseClass
method that the GroovyShell#run command uses.


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/7048e31f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/7048e31f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/7048e31f

Branch: refs/heads/master
Commit: 7048e31fef7c0ab0232210f8092ddb83c8cf8b02
Parents: d1979d1
Author: John Wagenleitner <john.wagenleitner@gmail.com>
Authored: Tue Oct 27 21:00:01 2015 -0700
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Wed Oct 28 08:27:48 2015 +0100

----------------------------------------------------------------------
 .../groovy-console/src/main/groovy/groovy/ui/Console.groovy        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/7048e31f/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
index 0746803..40348ca 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
@@ -1091,7 +1091,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
         runThread = Thread.start {
             try {
                 SwingUtilities.invokeLater { showCompilingMessage() }
-                shell.parse(record.allText)
+                shell.getClassLoader().parseClass(record.allText)
                 SwingUtilities.invokeLater { compileFinishNormal() }
             } catch (Throwable t) {
                 SwingUtilities.invokeLater { finishException(t, false) }


Mime
View raw message