/** * {@inheritDoc} */ @Override protected void onMethodEnter() { generateBeforeBodyCall(); // start our try block visitLabel(tryBlockStart); }
/** * {@inheritDoc} */ @Override protected void onMethodEnter() { generateBeforeBodyCall(); // start our try block visitLabel(tryBlockStart); }
/** * {@inheritDoc} */ @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { // calling super to ensure the visitor pattern super.visit(version, access, name, signature, superName, interfaces); loaderAwareClassWriter.setClassName(name); loaderAwareClassWriter.setSuperClassName(superName); }
protected void prepareWriter(ClassReader cr, ClassLoader classLoader, boolean enhancedExceptionSensor, MethodInstrumentationConfig... configs) { classWriter = new LoaderAwareClassWriter(cr, ClassWriter.COMPUTE_FRAMES, classLoader); classInstrumenter = new ClassInstrumenter(instrumenterFactory, classWriter, Arrays.asList(configs), enhancedExceptionSensor); }
/** * Creates class from given bytes. Class will have the given FQN. Class will be created with the * {@link InstrumentingClassLoader}, thus not the same class loader as the one test class is * loaded. */ protected Class<?> createClass(String className, byte[] bytes) throws InstantiationException, IllegalAccessException, ClassNotFoundException { return new InstrumentingClassLoader().findClass(className, bytes); }
public InstrumentationExceptionTestClass(String message) throws MyTestException { try { throw new MyTestException(message); } catch (MyTestException e) { } }
/** * Test interface to be used during * {@link rocks.inspectit.agent.java.instrumentation.asm.ClassAnalyzerTest}. */ @TestAnnotation @SuppressWarnings("PMD") interface TestInterface extends Serializable { @TestAnnotation String method1(int i, long[] j, String s, Object[][][] array3Dim); }
public void callsMethodWithException() { try { throwsAnException(); } catch (MyTestException exception) { } }
public static void callsStaticMethodWithException() { try { InstrumentationExceptionTestClass.staticThrowsAnException(); } catch (MyTestException exception) { } }
protected Class<?> findClass(String name, byte[] bytes) throws ClassNotFoundException { return defineClass(name, bytes, 0, bytes.length); } }
/** * Creates instance of a class defined by given bytes. Class will be created with * {@link #createClass(String, byte[])} method. */ protected Object createInstance(String className, byte[] bytes) throws InstantiationException, IllegalAccessException, ClassNotFoundException { return createClass(className, bytes).newInstance(); }
protected void prepareWriter(ClassReader cr, ClassLoader classLoader, boolean enhancedExceptionSensor, MethodInstrumentationConfig... configs) { classWriter = new LoaderAwareClassWriter(cr, ClassWriter.COMPUTE_FRAMES, classLoader); classInstrumenter = new ClassInstrumenter(instrumenterFactory, classWriter, Arrays.asList(configs), enhancedExceptionSensor); }
public void throwsAndHandlesException() { try { throw new MyTestException(); } catch (MyTestException e) { } }
@Override @TestAnnotation protected void method0() { }
public void callsMethodWithExceptionAndTryCatchFinally() { try { throwsAnException(); } catch (MyTestException e) { } finally { } } }
public void throwsAnException() throws MyTestException { throw new MyTestException(); }
@TestAnnotation String method1(int i, long[] j, String s, Object[][][] array3Dim);
public InstrumentationExceptionTestClass(int i) throws MyTestException { throwsAnException(); }
public static void staticThrowsAnException() throws MyTestException { throw new MyTestException(); }
public void createsExceptionObject() { new MyTestException(); }