package me.tomassetti.turin.classloading;

import me.tomassetti.turin.classloading.ClassFileDefinition;
import me.tomassetti.jvm.JvmNameUtils;

/**
 * ClassLoader used to load classes compiled from Turin.
 */
public class TurinClassLoader extends ClassLoader {

    public Class<?> addClass(ClassFileDefinition classFileDefinition){
        return addClass(classFileDefinition.getName(), classFileDefinition.getBytecode());
    }

    public Class<?> addClass(String name, byte[] bytecode){
        if (!JvmNameUtils.isValidQualifiedName(name)) {
            throw new IllegalArgumentException();
        }
        return defineClass(name, bytecode, 0, bytecode.length);
    }

}

@@ -40,69 +40,8 @@
 g;%0A%0A
-import me.tomassetti.turin.classloading.ClassFileDefinition;%0A
 impo

remove unused import