Package java.lang.instrument

Examples of java.lang.instrument.IllegalClassFormatException


    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void test_compatibilitySerialization() throws Exception {
        IllegalClassFormatException object = new IllegalClassFormatException();
        SerializationTest.verifyGolden(this, object);       
    }
View Full Code Here


    /**
     * @tests serialization/deserialization compatibility.
     */
    public void test_serialization() throws Exception {
        IllegalClassFormatException object = new IllegalClassFormatException();
        SerializationTest.verifySelf(object);
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void test_compatibilitySerialization() throws Exception {
        IllegalClassFormatException object = new IllegalClassFormatException();
        SerializationTest.verifyGolden(this, object);       
    }
View Full Code Here

    /**
     * @tests java.lang.instrument.IllegalClassFormatException#
     *        IllegalClassFormatException(java.lang.String)}
     */
    public void test_IllegalClassFormatException_LString() {
        IllegalClassFormatException object = new IllegalClassFormatException(
                "Some Error Message");
        assertEquals("Wrong message from constructor(String)",
                "Some Error Message", object.getMessage());
    }
View Full Code Here

    try {
      classFileDumper.dump(classname, classfileBuffer);
      return instrumenter.instrument(classfileBuffer, classname);
    } catch (final Exception ex) {
      final IllegalClassFormatException wrapper = new IllegalClassFormatException(
          ex.getMessage());
      wrapper.initCause(ex);
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(wrapper);
      throw wrapper;
    }
  }
View Full Code Here

    try {
      return classTransformer.transform( loader, className, classBeingRedefined,
          protectionDomain, classfileBuffer );
    }
    catch (Exception e) {
      throw new IllegalClassFormatException( e.getMessage() );
    }
  }
View Full Code Here

            } else {
                log.fine(className + " is already transformed with " + getClass().getSimpleName());
            }
            return clazz.toBytecode();
        } catch (Exception e) {
            throw new IllegalClassFormatException(e.getMessage());
        } finally {
            Thread.currentThread().setContextClassLoader(previous);
        }
    }
View Full Code Here

        loader = Thread.currentThread().getContextClassLoader();
      }
      return enhancer.enhance(loader, className);
    } catch (Exception e) {
      logger.error("Failed while transforming the class " + className, e);
      throw new IllegalClassFormatException(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of java.lang.instrument.IllegalClassFormatException

Copyright © 2018 www.massapicom. 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.