All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avaje.ebean.enhance.agent.CLAwareClassWriter Maven / Gradle / Ivy

There is a newer version: 8.1.1
Show newest version
package com.avaje.ebean.enhance.agent;

import com.avaje.ebean.enhance.asm.ClassWriter;

/**
 * ClassWriter that uses a specific ClassLoader.
 * 

* The ClassLoader is used specifically to assist the inherited getCommonSuperClass() method. */ public class CLAwareClassWriter extends ClassWriter { protected final ClassLoader classLoader; /** * Construct with flags and a ClassLoader which is used for supporting the getCommonSuperClass() method. */ public CLAwareClassWriter(int flags, ClassLoader classLoader) { super(flags); this.classLoader = classLoader; } /** * Return the class using the supplied ClassLoader. */ @Override protected Class classForName(String name) throws ClassNotFoundException { try { return Class.forName(name, false, classLoader); } catch (Throwable e) { // ignore and just use Class.forName original behavior return super.classForName(name); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy