Rafael Winterhalter
Rafael Winterhalter
How did it not work?
This is hard for me to comment on. I suggest to create a minimal working example based on: https://github.com/raphw/byte-buddy/tree/master/byte-buddy-gradle-plugin/android-plugin From there, incrementally adjust to your own build.
The lambda insturmentation is unfortunately rather unstable. I have not tested it with the latest JVMs and I consider removing it.
If you create two classes with the same name multiple times, then loading it will cause the previously loaded class to be resolved. If the names of the fields are...
The loading can be configured to fail if a class already exists: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassLoadingStrategy.java#L168 By default, Byte Buddy assumes that a class with the same name is already the same class,...
Byte Buddy is using the class loading lock when interacting with a class loader: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java#L287 For lookups, this is not intended for the API, I was expecting the API to...
You can already return a `Throwable` from an `InstallationListener`, or throw an exception from `onError`. This error will be propagated to the invocation. As for the transformation, the current behavior...
Byte Buddy is implicitly calling the JDKs `retransformClasses0` where the exception is suppressed. You could, of course, manage some state and register a listener that adds the exception to it....
I'd suggest a `ThreadLocal` for collecting the errors, even though the JVM does not specify to avoid concurrent class transformation.
The problem is that JDK 8 is the newest JDK that supports Java 5 as a target. As of now, I still want to support it, and thus I am...