cw.visitEnd();
// create the class
byte[] bytes = cw.toByteArray();
Class newClass;
JRubyClassLoader loader;
if (superClass.getClassLoader() instanceof JRubyClassLoader) {
loader = new JRubyClassLoader(superClass.getClassLoader());
} else {
loader = new JRubyClassLoader(ruby.getJRubyClassLoader());
}
try {
newClass = loader.loadClass(name);
} catch (ClassNotFoundException cnfe) {
newClass = loader.defineClass(name, cw.toByteArray());
}
if (DEBUG) {
FileOutputStream fos = null;
try {