import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import java.util.function.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.math.*;
import org.apache.bcel.classfile.ClassParser;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.Const;
import org.apache.bcel.generic.*;
import static x30_pkg.x30_util.DynamicObject;
import java.awt.geom.*;
public class main {
public static void main(final String[] args) throws Exception {
ClassGen cg = new ClassGen("User123", "java.lang.Object", null, Const.ACC_PUBLIC, new String[] { className(IF0.class) });
cg.addEmptyConstructor(Const.ACC_PUBLIC);
var m = new MethodMaker(cg, "get", Object.class);
int buffer = m.newLocalVar();
m.newObject(StringBuffer.class).astore(buffer);
for (var string : ll("Hello ", "world")) {
m.aload(buffer).stringConstant(string);
m.il.append(m.factory.createAppend(org.apache.bcel.generic.Type.OBJECT));
}
m.aload(buffer);
m.invokeVirtual(StringBuffer.class, "toString", String.class);
m.areturn().done();
JavaClass baked = cg.getJavaClass();
print(baked);
for (var method : baked.getMethods()) {
print("\n" + method);
print(method.getCode());
}
byte[] bytes = baked.getBytes();
var cl = new InMemoryClassLoader(myClassLoader());
long _startTime_0 = sysNow();
Class extends IF0> c = (Class extends IF0>) (cl.defineAClass("User123", bytes));
done2_always("Defining class", _startTime_0);
print(c);
IF0 f = newInstance(c);
print(f);
assertEqualsVerbose("Hello world", f.get());
}
static public String className(Object o) {
return getClassName(o);
}
static public List ll(A... a) {
ArrayList l = new ArrayList(a.length);
if (a != null)
for (A x : a) l.add(x);
return l;
}
static volatile public StringBuffer local_log = new StringBuffer();
static public boolean printAlsoToSystemOut = true;
static volatile public Appendable print_log = local_log;
static volatile public int print_log_max = 1024 * 1024;
static volatile public int local_log_max = 100 * 1024;
static public boolean print_silent = false;
static public Object print_byThread_lock = new Object();
static volatile public ThreadLocal