This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.sun.net.httpserver.HttpExchange | |
import com.sun.net.httpserver.HttpHandler | |
import com.sun.net.httpserver.HttpServer | |
import groovy.transform.CompileStatic | |
import groovy.transform.TypeChecked | |
@CompileStatic | |
@TypeChecked | |
class GroovyHttpServer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name":"RandomNumber$Foo", | |
"allDeclaredFields":true, | |
"allDeclaredMethods":true, | |
"allDeclaredConstructors":true | |
}, | |
{ | |
"name":"groovy.lang.Buildable", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.Field | |
def foo(param) { | |
println "The param is ${param}" | |
} | |
@Field | |
def dict = [:] | |
def register(String key, Closure cl) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Char | |
import Data.Word | |
executeString :: String -> String -> Maybe String | |
executeString source input = process (0,0, repeat (0 :: Word8), [], input) | |
where | |
-- ip - instruction pointer | |
-- dp - data pointer | |
-- reg - data registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group = "org.reflections", module = "reflections", version = "0.9.11") | |
@Grab(group = "org.slf4j", module = "slf4j-simple", version = "1.7.25") | |
import groovy.json.JsonOutput | |
import org.codehaus.groovy.reflection.GeneratedMetaMethod | |
import org.reflections.Reflections | |
def reflections = new Reflections("org.codehaus.groovy.runtime") | |
def json = reflections.getSubTypesOf(GeneratedMetaMethod).collect { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "org.codehaus.groovy.runtime.dgm$0", | |
"allDeclaredConstructors": true, | |
"allPublicConstructors": true, | |
"allDeclaredMethods": true, | |
"allPublicMethods": true | |
}, | |
{ | |
"name": "org.codehaus.groovy.runtime.dgm$1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.CompileStatic | |
class WaitTest { | |
void testFail() { | |
Closure c = { | |
shout() | |
println toString() | |
println delegate.toString() | |
println this.toString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Source code recreated from a .class file by IntelliJ IDEA | |
// (powered by Fernflower decompiler) | |
// | |
import groovy.lang.Closure; | |
import groovy.lang.GroovyObject; | |
import groovy.lang.MetaClass; | |
import org.codehaus.groovy.runtime.GeneratedClosure; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Source code recreated from a .class file by IntelliJ IDEA | |
// (powered by Fernflower decompiler) | |
// | |
import groovy.lang.Closure; | |
import groovy.lang.GroovyObject; | |
import groovy.lang.MetaClass; | |
import org.codehaus.groovy.runtime.GeneratedClosure; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class WaitTest2 { | |
public static void main(String[] args) { | |
new WaitTest2().run(); | |
} | |
void run() { | |
class Closure { | |
private final Runnable runnable; |