/* * Decompiled with CFR 0.152. */ package com.tridium.util; import com.tridium.asm.Assembler; import com.tridium.asm.Code; import com.tridium.asm.ConstantPool; import com.tridium.asm.MethodInfo; import com.tridium.asm.OpCodes; import com.tridium.sys.module.AutoClassLoader; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashMap; /* * Illegal identifiers - consider using --renameillegalidents true */ public class AbstractStubGen implements OpCodes { public static final HashMap cache = new HashMap(); Class cls; Assembler asm; ConstantPool cp; int init; static /* synthetic */ Class class$javax$baja$sys$BObject; /* * WARNING - Removed try catching itself - possible behaviour change. * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation */ public static Class getConcreteClass(Class clazz) throws Exception { if (!AbstractStubGen.isAbstract(clazz) && !clazz.isInterface()) { return clazz; } HashMap hashMap = cache; synchronized (hashMap) { Class clazz2 = (Class)cache.get(clazz); if (clazz2 == null) { clazz2 = new AbstractStubGen(clazz).generate(); cache.put(clazz, clazz2); } return clazz2; } } public Class generate() throws Exception { Object object; String string = null; if (!this.cls.isInterface()) { object = this.cls.getName().replace('.', '/'); string = "auto/" + (String)object + "Stub"; int n = 33; this.asm = new Assembler(string, (String)object, n, null); this.cp = this.asm.cp; } else { Class clazz = class$javax$baja$sys$BObject; if (clazz == null) { clazz = class$javax$baja$sys$BObject = AbstractStubGen.class("[Ljavax.baja.sys.BObject;", false); } object = clazz.getName().replace('.', '/'); string = "auto/" + this.cls.getName().replace('.', '/') + "BObjectStub"; String[] stringArray = new String[]{this.cls.getName().replace('.', '/')}; int n = 33; this.asm = new Assembler(string, (String)object, n, stringArray); this.cp = this.asm.cp; } this.genConstants(); this.genConstructor(); object = AutoClassLoader.load(this.cls, string.replace('/', '.'), this.asm.compile()); return object; } private final void genConstants() { this.init = this.cp.utf(""); } private final void genConstructor() { Code code = new Code(this.asm); code.add(42); code.add(183, code.cp.method(this.asm.superClass, this.init, "()V")); code.add(177); this.asm.addMethod(new MethodInfo(this.asm, this.init, "()V", 1, code)); } public static boolean isAbstract(Class clazz) { return Modifier.isAbstract(clazz.getModifiers()); } public static boolean isAbstract(Method method) { return Modifier.isAbstract(method.getModifiers()); } static /* synthetic */ Class class(String string, boolean bl) { try { Class clazz = Class.forName(string); if (!bl) { clazz = clazz.getComponentType(); } return clazz; } catch (ClassNotFoundException classNotFoundException) { throw new NoClassDefFoundError(classNotFoundException.getMessage()); } } public AbstractStubGen(Class clazz) { this.cls = clazz; } }