Rafael Winterhalter

Results 738 comments of Rafael Winterhalter

The transformer can be added in the `.method(...)....transform(...)` and `.field(...).transform(...)` steps. The idea is to return an alternative representation of the method or field that you'd like Byte Buddy to...

Try disabling annotation retention: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/AnnotationRetention.java#L34 Otherwise, Byte Buddy copies the original annotation to retain the definition of default values compared to explicitly set defaults.

Indeed, the problem happens in validation which is not aware of the visitor. Configure `ByteBuddy` with `TypeValidation.DISABLED` to avoid this error.

Yes, the visitor you implemented removes all annotations of the given type, if you added them or if they were added previously. The preexisting annotations will be visisted first, you...

Then you must cache values somewhere. Byte Buddy does not pool objects internally.

That's an adjustment that BB needs to make. If you want a reference to the original method, you can use `@SuperMethod` on a parameter of your delegation.

The JVM in versions 8- is a bit particular when it comes to attachment. It is only possible a single time for the entire VM. If there are multiple class...

Well, this one is a real PITA. Technically, this has nothing to do with Byte Buddy, but with binding native libraries that do not respect Java's class loader concept but...

It's classes in the net.bytebuddy.agent package, I think (without subpackages). Those are fairly stable, too. I'd have to experiment myself, to be honest before I can promise that this will...

Unfortunately, Byte Buddy cannot control the native code bits of tools.jar.