Examples of ClassTransformationException


Examples of com.cedarsoft.maven.instrumentation.plugin.ClassTransformationException

    try {
      doTransform( agent );
    } catch ( final MalformedURLException e ) {
      throw new RuntimeException( "Should not happen.  Could not create URL from file.", e );
    } catch ( final IOException e ) {
      throw new ClassTransformationException( "Failed to write transformed class file contents.", e );
    } catch ( final CannotCompileException e ) {
      throw new RuntimeException( "Should not happen. Failed to convert a valid compiled class into bytecode", e );
    } catch ( final IllegalClassFormatException e ) {
      throw new RuntimeException( "Should not happen.  The class file does not contain valid content", e );
    }
View Full Code Here

Examples of com.cedarsoft.maven.instrumentation.plugin.ClassTransformationException

    try {
      doTransform( agent );
    } catch ( final MalformedURLException e ) {
      throw new RuntimeException( "Should not happen.  Could not create URL from file.", e );
    } catch ( final IOException e ) {
      throw new ClassTransformationException( "Failed to write transformed class file contents.", e );
    } catch ( final CannotCompileException e ) {
      throw new RuntimeException( "Should not happen. Failed to convert a valid compiled class into bytecode", e );
    } catch ( final IllegalClassFormatException e ) {
      throw new RuntimeException( "Should not happen.  The class file does not contain valid content", e );
    }
View Full Code Here

Examples of com.cedarsoft.maven.instrumentation.plugin.ClassTransformationException

    try {
      doTransform( agent );
    } catch ( final MalformedURLException e ) {
      throw new RuntimeException( "Should not happen.  Could not create URL from file.", e );
    } catch ( final IOException e ) {
      throw new ClassTransformationException( "Failed to write transformed class file contents.", e );
    } catch ( final CannotCompileException e ) {
      throw new RuntimeException( "Should not happen. Failed to convert a valid compiled class into bytecode", e );
    } catch ( final IllegalClassFormatException e ) {
      throw new RuntimeException( "Should not happen.  The class file does not contain valid content", e );
    }
View Full Code Here

Examples of com.cedarsoft.maven.instrumentation.plugin.ClassTransformationException

    try {
      doTransform( agent );
    } catch ( final MalformedURLException e ) {
      throw new RuntimeException( "Should not happen.  Could not create URL from file.", e );
    } catch ( final IOException e ) {
      throw new ClassTransformationException( "Failed to write transformed class file contents.", e );
    } catch ( final CannotCompileException e ) {
      throw new RuntimeException( "Should not happen. Failed to convert a valid compiled class into bytecode", e );
    } catch ( final IllegalClassFormatException e ) {
      throw new RuntimeException( "Should not happen.  The class file does not contain valid content", e );
    }
View Full Code Here

Examples of com.cedarsoft.maven.instrumentation.plugin.ClassTransformationException

    try {
      doTransform( agent );
    } catch ( final MalformedURLException e ) {
      throw new RuntimeException( "Should not happen.  Could not create URL from file.", e );
    } catch ( final IOException e ) {
      throw new ClassTransformationException( "Failed to write transformed class file contents.", e );
    } catch ( final CannotCompileException e ) {
      throw new RuntimeException( "Should not happen. Failed to convert a valid compiled class into bytecode", e );
    } catch ( final IllegalClassFormatException e ) {
      throw new RuntimeException( "Should not happen.  The class file does not contain valid content", e );
    }
View Full Code Here

Examples of org.apache.drill.exec.exception.ClassTransformationException

    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.");
    return classFiles[0].toByteArray();
  }
View Full Code Here

Examples of org.apache.drill.exec.exception.ClassTransformationException

      Throwable c = e.getCause();
      if (c instanceof ClassTransformationException)
        throw (ClassTransformationException) c;
      if (c instanceof IOException)
        throw (IOException) c;
      throw new ClassTransformationException(c);
    }
  }
View Full Code Here

Examples of org.apache.drill.exec.exception.ClassTransformationException

          .setClassName(materializedClassName) //
          .setBody(internalClassBody) //
          .build();
      return getImplementationClass(classLoader, templateDefinition, classBody, materializedClassName);
    } catch (IOException | CompileException e) {
      throw new ClassTransformationException("Failure generating class body for runtime generated class.", e);
    }

  }
View Full Code Here

Examples of org.apache.drill.exec.exception.ClassTransformationException

      logger.debug(String.format("[Compile Time] Janino: %dms, Bytecode load and parse: %dms, Class Merge: %dms, Subclass remap and load: %dms.", t1.elapsed(TimeUnit.MILLISECONDS), t2.elapsed(TimeUnit.MILLISECONDS), t3.elapsed(TimeUnit.MILLISECONDS), t4.elapsed(TimeUnit.MILLISECONDS)));
      Class<?> c = classLoader.findClass(materializedClassName);
      if (templateDefinition.getExternalInterface().isAssignableFrom(c)) {
        return (T) c.newInstance();
      } else {
        throw new ClassTransformationException("The requested class did not implement the expected interface.");
      }
     
    } catch (CompileException | IOException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
      throw new ClassTransformationException(String.format(
          "Failure generating transformation classes for value: \n %s", entireClass), e);
    }

  }
View Full Code Here

Examples of org.apache.drill.exec.exception.ClassTransformationException

  private class ClassBytesCacheLoader extends CacheLoader<String, byte[]> {
    public byte[] load(String path) throws ClassTransformationException, IOException {
      URL u = this.getClass().getResource(path);
      if (u == null)
        throw new ClassTransformationException(String.format("Unable to find TemplateClass at path %s", path));
      return Resources.toByteArray(u);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.