Skip to content

Instantly share code, notes, and snippets.

View wololock's full-sized avatar
🈷️
https://e.printstacktrace.blog

Szymon Stepniak wololock

🈷️
https://e.printstacktrace.blog
View GitHub Profile
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 {
[
{
"name":"RandomNumber$Foo",
"allDeclaredFields":true,
"allDeclaredMethods":true,
"allDeclaredConstructors":true
},
{
"name":"groovy.lang.Buildable",
import groovy.transform.Field
def foo(param) {
println "The param is ${param}"
}
@Field
def dict = [:]
def register(String key, Closure cl) {
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
@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 {
[
{
"name": "org.codehaus.groovy.runtime.dgm$0",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "org.codehaus.groovy.runtime.dgm$1",
import groovy.transform.CompileStatic
class WaitTest {
void testFail() {
Closure c = {
shout()
println toString()
println delegate.toString()
println this.toString()
//
// 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;
//
// 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;
final class WaitTest2 {
public static void main(String[] args) {
new WaitTest2().run();
}
void run() {
class Closure {
private final Runnable runnable;