public byte[] getClassByteCode(final String className, final String code) throws CompileException, IOException, ClassNotFoundException, ClassTransformationException {
if(logger.isDebugEnabled()){
logger.debug("Compiling:\n {}", prefixLineNumbers(code));
}
StringReader reader = new StringReader(code);
Scanner scanner = new Scanner((String) null, reader);
Java.CompilationUnit compilationUnit = new Parser(scanner).parseCompilationUnit();
ClassFile[] classFiles = new UnitCompiler(compilationUnit, compilationClassLoader).compileUnit(this.debugSource,
this.debugLines, this.debugVars);
if (classFiles.length != 1)
throw new ClassTransformationException("Only one class file should have been generated from source code.");