You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/03/15 08:11:31 UTC
[GitHub] [groovy] paulk-asert commented on a change in pull request #1192:
GROOVY-9468: Support running as Java code in the Groovy console
paulk-asert commented on a change in pull request #1192: GROOVY-9468: Support running as Java code in the Groovy console
URL: https://github.com/apache/groovy/pull/1192#discussion_r392651183
##########
File path: subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
##########
@@ -1136,13 +1142,25 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
return consoleControllers.find { it.consoleId == consoleId }
}
+ private enum SourceType {
+ GROOVY, JAVA
+ }
+
+ void runJava(EventObject evt = null) {
+ doRun(evt, SourceType.JAVA)
+ }
+
// actually run the script
void runScript(EventObject evt = null) {
Review comment:
Would it be better to use default params here?
`void runScript(EventObject evt = null, SourceType st = SourceType.GROOVY) {`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services