Package java.lang.instrument

Examples of java.lang.instrument.IllegalClassFormatException.initCause()


          extractContracts(new ClassReader(contractBytecode));
      return instrumentWithContracts(bytecode, contracts);
    } catch (Throwable t) {
      /* If the class file contains errors, ASM will just crash. */
      IllegalClassFormatException e = new IllegalClassFormatException();
      e.initCause(t);
      throw e;
    }
  }

  /**
 
View Full Code Here


    try {
      return instrumentWithDebug(bytecode);
    } catch (Throwable t) {
      /* If the class file contains errors, ASM will just crash. */
      IllegalClassFormatException e = new IllegalClassFormatException();
      e.initCause(t);
      throw e;
    }
  }

  /**
 
View Full Code Here

    try {
      return new ClassReader(bytecode).getClassName();
    } catch (Throwable t) {
      /* If the class file contains errors, ASM will just crash. */
      IllegalClassFormatException e = new IllegalClassFormatException();
      e.initCause(t);
      throw e;
    }
  }
}
View Full Code Here

    } catch (final Exception ex) {
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      final IllegalClassFormatException wrapper = new IllegalClassFormatException(
          format("Error while instrumenting class %s.", classname));
      throw (IllegalClassFormatException) wrapper.initCause(ex);
    }
  }

  /**
   * Checks whether this class should be instrumented.
View Full Code Here

      return instrumenter.instrument(classfileBuffer);
    } catch (Throwable t) {
      final String msg = "Error while instrumenting class %s.";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname));
      ex.initCause(t);
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw ex;
    }
  }
View Full Code Here

    } catch (Throwable t) {
      final Long id = Long.valueOf(CRC64.checksum(classfileBuffer));
      final String msg = "Error while instrumenting class %s (id=%016x).";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname, id));
      ex.initCause(t);
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw ex;
    }
  }
View Full Code Here

    } catch (Throwable t) {
      final Long id = Long.valueOf(CRC64.checksum(classfileBuffer));
      final String msg = "Error while instrumenting class %s (id=%016x).";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname, id));
      ex.initCause(t);
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw ex;
    }
  }
View Full Code Here

      final String msg = "Error while instrumenting class %s.";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname));
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw (IllegalClassFormatException) ex.initCause(t);
    }
  }

  /**
   * Checks whether this class should be instrumented.
View Full Code Here

      final String msg = "Error while instrumenting class %s.";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname));
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw (IllegalClassFormatException) ex.initCause(t);
    }
  }

  /**
   * Checks whether this class should be instrumented.
View Full Code Here

    } catch (Throwable t) {
      final Long id = Long.valueOf(CRC64.checksum(classfileBuffer));
      final String msg = "Error while instrumenting class %s (id=0x%x).";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname, id));
      ex.initCause(t);
      // Force some output, as the exception is ignored by the JVM:
      ex.printStackTrace();
      throw ex;
    }
  }
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.