Map factories = (Map)loaders.get(loader); if (factories == null) { loaders.put(loader, factories = new HashMap()); } Factory factory = (Factory)factories.get(key); if (factory == null) { Class clazz = new DelegatorGenerator(getNextName(), interfaces, loader).define(); try { factory = (Factory)clazz.getConstructor(Constants.TYPES_OBJECT_ARRAY). newInstance(new Object[]{ delegates }); factories.put(key, factory); return factory; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } } else { return factory.cglib_newInstance(delegates); }
return factory.cglib_newInstance(delegates);
    synchronized private static Object makeDelegatorHelper(Object key,                                                           Class[] interfaces,                                                           Object[] delegates,                                                           ClassLoader loader) {        if (loader == null) {            loader = defaultLoader;        }        Map factories = (Map)loaders.get(loader);        if (factories == null) {            loaders.put(loader, factories = new HashMap());        }        Factory factory = (Factory)factories.get(key);        if (factory == null) {            Class clazz = new DelegatorGenerator(getNextName(), interfaces, loader).define();            try {                factory = (Factory)clazz.getConstructor(Constants.TYPES_OBJECT_ARRAY).                    newInstance(new Object[]{ delegates });                factories.put(key, factory);                return factory;            } catch (RuntimeException e) {                throw e;            } catch (Exception e) {                throw new CodeGenerationException(e);            }        } else {            return factory.cglib_newInstance(delegates);        }    }