Skip to content

Instantly share code, notes, and snippets.

@opengl-8080
Created October 18, 2014 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opengl-8080/910c0aa46c4afbeb5b63 to your computer and use it in GitHub Desktop.
Save opengl-8080/910c0aa46c4afbeb5b63 to your computer and use it in GitHub Desktop.
Groovyのクロージャを逆コンパイルした結果
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: script.groovy
import groovy.lang.*;
import java.io.File;
import java.lang.ref.SoftReference;
import org.codehaus.groovy.reflection.ClassInfo;
import org.codehaus.groovy.runtime.*;
import org.codehaus.groovy.runtime.callsite.CallSite;
import org.codehaus.groovy.runtime.callsite.CallSiteArray;
import org.codehaus.groovy.runtime.typehandling.ShortTypeHandling;
public class script extends Script
{
public script()
{
CallSite acallsite[] = $getCallSiteArray();
}
public script(Binding context)
{
CallSite acallsite[] = $getCallSiteArray();
ScriptBytecodeAdapter.invokeMethodOnSuperN(groovy/lang/Script, this, "setBinding", new Object[] {
context
});
}
public static transient void main(String args[])
{
CallSite acallsite[] = $getCallSiteArray();
acallsite[0].call(org/codehaus/groovy/runtime/InvokerHelper, script, args);
}
public Object run()
{
CallSite acallsite[] = $getCallSiteArray();
class _run_closure1 extends Closure
implements GeneratedClosure
{
public Object doCall(Object it)
{
CallSite acallsite1[] = $getCallSiteArray();
return acallsite1[0].callCurrent(this, acallsite1[1].call("it=", it));
}
protected MetaClass $getStaticMetaClass()
{
if(getClass() != script$_run_closure1)
return ScriptBytecodeAdapter.initMetaClass(this);
ClassInfo classinfo = $staticClassInfo;
if(classinfo == null)
$staticClassInfo = classinfo = ClassInfo.getClassInfo(getClass());
return classinfo.getMetaClass();
}
public static void __$swapInit()
{
CallSite acallsite1[] = $getCallSiteArray();
$callSiteArray = null;
}
private static void $createCallSiteArray_1(String as[])
{
as[0] = "println";
as[1] = "plus";
}
private static CallSiteArray $createCallSiteArray()
{
String as[] = new String[2];
$createCallSiteArray_1(as);
return new CallSiteArray(script$_run_closure1, as);
}
private static CallSite[] $getCallSiteArray()
{
CallSiteArray callsitearray;
if($callSiteArray == null || (callsitearray = (CallSiteArray)$callSiteArray.get()) == null)
{
callsitearray = $createCallSiteArray();
$callSiteArray = new SoftReference(callsitearray);
}
return callsitearray.array;
}
static Class _mthclass$(String s)
{
try
{
return Class.forName(s);
}
catch(ClassNotFoundException classnotfoundexception)
{
throw new NoClassDefFoundError(classnotfoundexception.getMessage());
}
}
private static ClassInfo $staticClassInfo;
public static transient boolean __$stMC;
private static SoftReference $callSiteArray;
static
{
__$swapInit();
}
public _run_closure1(Object _outerInstance, Object _thisObject)
{
CallSite acallsite[] = $getCallSiteArray();
super(_outerInstance, _thisObject);
}
}
Object closure = new _run_closure1(this, this);
Object _tmp = closure;
return acallsite[1].call(closure, "test");
}
public Object this$dist$invoke$3(String name, Object args)
{
CallSite acallsite[] = $getCallSiteArray();
return ScriptBytecodeAdapter.invokeMethodOnCurrentN(script, this, (String)ShortTypeHandling.castToString(new GStringImpl(new Object[] {
name
}, new String[] {
"", ""
})), ScriptBytecodeAdapter.despreadList(new Object[0], new Object[] {
args
}, new int[] {
0
}));
}
public void this$dist$set$3(String name, Object value)
{
CallSite acallsite[] = $getCallSiteArray();
Object obj = value;
ScriptBytecodeAdapter.setGroovyObjectProperty(obj, script, this, (String)ShortTypeHandling.castToString(new GStringImpl(new Object[] {
name
}, new String[] {
"", ""
})));
Object _tmp = obj;
}
public Object this$dist$get$3(String name)
{
CallSite acallsite[] = $getCallSiteArray();
return ScriptBytecodeAdapter.getGroovyObjectProperty(script, this, (String)ShortTypeHandling.castToString(new GStringImpl(new Object[] {
name
}, new String[] {
"", ""
})));
}
protected MetaClass $getStaticMetaClass()
{
if(getClass() != script)
return ScriptBytecodeAdapter.initMetaClass(this);
ClassInfo classinfo = $staticClassInfo;
if(classinfo == null)
$staticClassInfo = classinfo = ClassInfo.getClassInfo(getClass());
return classinfo.getMetaClass();
}
public static void __$swapInit()
{
CallSite acallsite[] = $getCallSiteArray();
$callSiteArray = null;
}
public Object super$3$getProperty(String s)
{
return super.getProperty(s);
}
public String super$1$toString()
{
return super.toString();
}
public void super$3$setProperty(String s, Object obj)
{
super.setProperty(s, obj);
}
public void super$1$notify()
{
super.notify();
}
public void super$3$println()
{
super.println();
}
public void super$1$notifyAll()
{
super.notifyAll();
}
public void super$3$print(Object obj)
{
super.print(obj);
}
public Object super$1$clone()
{
return super.clone();
}
public Object super$3$evaluate(String s)
{
return super.evaluate(s);
}
public void super$1$wait()
{
super.wait();
}
public MetaClass super$2$getMetaClass()
{
return super.getMetaClass();
}
public void super$1$wait(long l, int i)
{
super.wait(l, i);
}
public void super$2$setMetaClass(MetaClass metaclass)
{
super.setMetaClass(metaclass);
}
public Binding super$3$getBinding()
{
return super.getBinding();
}
public Class super$1$getClass()
{
return super.getClass();
}
public void super$1$finalize()
{
super.finalize();
}
public void super$3$printf(String s, Object aobj[])
{
super.printf(s, aobj);
}
public void super$3$printf(String s, Object obj)
{
super.printf(s, obj);
}
public void super$3$setBinding(Binding binding)
{
super.setBinding(binding);
}
public void super$1$wait(long l)
{
super.wait(l);
}
public Object super$3$evaluate(File file)
{
return super.evaluate(file);
}
public void super$3$run(File file, String as[])
{
super.run(file, as);
}
public void super$3$println(Object obj)
{
super.println(obj);
}
public boolean super$1$equals(Object obj)
{
return super.equals(obj);
}
public Object super$3$invokeMethod(String s, Object obj)
{
return super.invokeMethod(s, obj);
}
public int super$1$hashCode()
{
return super.hashCode();
}
private static void $createCallSiteArray_1(String as[])
{
as[0] = "runScript";
as[1] = "call";
}
private static CallSiteArray $createCallSiteArray()
{
String as[] = new String[2];
$createCallSiteArray_1(as);
return new CallSiteArray(script, as);
}
private static CallSite[] $getCallSiteArray()
{
CallSiteArray callsitearray;
if($callSiteArray == null || (callsitearray = (CallSiteArray)$callSiteArray.get()) == null)
{
callsitearray = $createCallSiteArray();
$callSiteArray = new SoftReference(callsitearray);
}
return callsitearray.array;
}
static Class _mthclass$(String s)
{
try
{
return Class.forName(s);
}
catch(ClassNotFoundException classnotfoundexception)
{
throw new NoClassDefFoundError(classnotfoundexception.getMessage());
}
}
private static ClassInfo $staticClassInfo;
public static transient boolean __$stMC;
public static long __timeStamp;
public static long __timeStamp__239_neverHappen1413600230062;
private static SoftReference $callSiteArray;
static
{
__$swapInit();
Long long1 = Long.valueOf(0L);
__timeStamp__239_neverHappen1413600230062 = long1.longValue();
Long _tmp = long1;
Long long2 = Long.valueOf(0x1492123baaeL);
__timeStamp = long2.longValue();
Long _tmp1 = long2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment