title: After and before constructor interceptor
body: <p>I know how to create a BEFORE constructor interceptor:</p>
  
  <pre><code>return builder.constructor(isDeclaredBy(typeDescription))
     .intercept(MethodDelegation.to(constructorInterceptor)
     .andThen(SuperMethodCall.INSTANCE));
  </code></pre>
  
  <p>I know how to create an AFTER constructor interceptor:</p>
  
  <pre><code>return builder.constructor(isDeclaredBy(typeDescription))
     .intercept(SuperMethodCall.INSTANCE
     .andThen(MethodDelegation.to(constructorInterceptor)));
  </code></pre>
  
  <p>With the following interceptor:</p>
  
  <pre><code>public void intercept(@Origin Constructor&lt;?&gt; constructor) {
      System.out.println("intercepted " + constructor.getName());
  }
  </code></pre>
  
  <p>However I don't know how to create a before/after interceptor. Here is what I tried (naive approach based on what already worked for methods):</p>
  
  <pre><code>return builder.constructor(isDeclaredBy(typeDescription))
      .intercept(MethodDelegation.to(constructorInterceptor));
  </code></pre>
  
  <p>With this method delegate:</p>
  
  <pre><code>public void intercept(@Origin Constructor&lt;?&gt; constructor, @SuperCall Callable&lt;?&gt; zuper) throws Exception {
      System.out.println("before " + constructor.getName());
  
      zuper.call();
  
      System.out.println("after " + constructor.getName());
  }
  </code></pre>
  
  <p>With this setup I get:</p>
  
  <pre><code>java.lang.ClassFormatError: Bad method name at constant pool index 23 in class file com/flow/agent/test/Foo$auxiliary$syFGNB3u
  </code></pre>
  
  <p>Full stack trace:</p>
  
  <pre><code>java.lang.IllegalStateException: Error invoking java.lang.ClassLoader#findClass
      at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Resolved.loadClass(ClassInjector.java:392)
      at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.inject(ClassInjector.java:201)
      at net.bytebuddy.agent.builder.AgentBuilder$InitializationStrategy$SelfInjection$Dispatcher$Split.register(AgentBuilder.java:1017)
      at net.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple$Resolution.apply(AgentBuilder.java:2795)
      at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:3081)
      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ...
  Caused by: java.lang.ClassFormatError: Bad method name at constant pool index 23 in class file com/flow/agent/test/Foo$auxiliary$syFGNB3u
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Resolved.loadClass(ClassInjector.java:388)
  </code></pre>