release-notes.md
Accidental release during rework of release pipeline. Functional, but with incorrect suffices.
Advice that were missing.module-info class files and ModuleDescriptions.ByteBuddy API.ResettableClassFileTransformer that implicitly delegates to correct transformer method.LazinessMode for TypePool and add convenience support to AgentBuilder.AnnotationRemoval visitor for removing or replacing annotations.SafeVarargs plugin.SafeVarargs annotations.MemberSubstitution API.MemberSubstitution were argument indices were resolved by one digit off.MemberSubstitution to also allow for intercepting invokedynamic instructions.@Handle annotations to allow for injecting constant pool-stored method handle in Advice, MemberSubstitution and MethodDelegation.@DynamicConstant annotations to allow for injecting constant pool-stored dynamic constants in Advice, MemberSubstitution and MethodDelegation.TypePool.Advice within instrumented class.Advice post-processing to allow for erasure of bootstrapped methods.Plugin.Engine to retain folders.CachedReturnPlugin on precompiled class files.NOP instruction when Advice is used on void methods as those might be empty which results on a frame being written to the same offset, causing an exception.Plugin.Engine to link files instead of copying.File[] to Plugin constructors.ClassInjector API to support lazy resolution of class files.DynamicType API to support lazy resolution of auxiliary types.AgentBuilder.Transformer.ForAdvice to support injection of new classes by their name.ClassFileLocators and Plugin.Engine.Default.ByteBuddyJarsTask.JarFile when extracting individual entries.ByteBuddyMojo.EntryPoint for Android Gradle plugin to use DECORATE unless explicitly specified due to many generic type errors in Kotlin classes.AsmClassWriter and AsmClassReader abstractions that allow for plugging different implementations of readers and writers.TypeNotPresentException upon discovering undeclared type variables as it was recently fixed on the JVM.MemberSubstitution.ByteBuddyAgent from non-obfuscated name if obfuscation is used.CircularityLock implementations never load classes during locking.@MaybeNull annotation.TypePool in AgentBuilder to avoid parsing of types ignored by name.MemberSubstitution.Plugin.Engine.PatchMode.SUBSTITUTE and ResettableClassFileTransformer.Substitutable for in-order patching.AgentBuilder.TypePool that is passed to TypeWriter.MethodGraph.Compiler failsafe when processing incomplete methods.Advice.skipOn and repeatOn which resolves the checked value from a returned array.Step.Factory.ForDelegation in MemberSubstitution that allows for delegation similar to MethodDelegation but in-code.MethodDelegation and Advice that leverage method handles for field access and self-invocation.Step.Factory for type assignment that allows casting the return value from a previous step to another type.URL class loader as it is deprecated, and use newer method if available.MemberSubstitution API which now retains the original instruction for invocation.MethodGraph.Compiler using an ElementMatcher.ClassFileLocator.ClassFileVersion.ConstantValue API.ToThrown assignment on void methods.MemberSubstitution.ClassFileLocator to AgentBuilder to append boot-injected types.RenamingPlugin that allows for migration of names using the build plugin.ForAdvice transformation to allow for easier wrapping.Steps to MemberSubstitution to reduce need for custom bytecode generation.MethodHandle and MethodType in Advice.Origin annotation.MethodHandles.Lookup in Origin and Advice.Origin annotations.TypeDescription subtypes.Advice in constructor, as byte code allows it.Advice.EntryPoint in Android Gradle plugin.PatchMode on AgentBuilder patching to allow for control over overlap.ClassVisitorFactory which allows to translate to and from class wrappers in a different ASM namespace.ClassVisitors.wrap method to DynamicType.Builder that allows for the representation of a dynamic type via a ClassVisitor.ClassVisitorFactory that allows to translate between Byte Buddy's, the original, or other shaded representations of ASM.Plugins when using Maven.Plugins to define new types prior to transformation.Advice.Step type in MemberSubstitution public as intended.ArrayDeque instead of LinkedList if the used JVM supports it (Java 6+).TypeReferenceAdjustment.ElementType when checking compatibility as the current VM might not provide all constants.equals method as @MaybeNull.ElementMatcher as @UnknownNull.HashCodeEqualsPlugin to allow for inclusion of custom annotation type on equals method parameter.Nexus or Installer.MemberSubstitution to include newly added properties in its description.BaseNameResolver for suffixing naming strategy.Advice.PostProcessor to emit frames.Advice.AssignReturned to suppress exceptions.AsScalar annotation to assign default value instead of ignoring it.Advice.AssignReturned post processor to allow for assigning values from Advice that uses delegation rather than inlining.Advice.Local values from both enter and exit advice.Repeatable annotations without requiring a JDK 8+.Advice to avoid incorrect offsets in stack map frames.MethodGraph.Compiler API to accept generic types.Proxied annotations to all proxied methods of a dispatcher. This avoids problems in obfuscators.Nexus.MethodDelegation.Invoker to avoid breakage if Byte Buddy is shaded into another module with different package exports.JavaDispatcher to require specific privilege but use Byte Buddy's protection domain for dispatchers, once acquired.InvocationHandlerAdapter to use null for methods without parameters as specified by contract.null for MethodDelegation and Advice if method has no parameters.ByteBuddyAgent.warmUp to further avoid circularities when using AgentBuilder.AgentBuilder to include jdk.internal.reflect package by default.JavaDispatcher when a method potentially checks the access context via a security manager.adjustmentPostProcessor to manually add task dependencies.NoSuchTypeException on non-resolved types rather then IllegalStateException.MethodCall.JavaDispatcher class when Byte Buddy is used as a module.Class values of a loaded dynamic type.JavaDispatcher that works on Android and other platforms that do not support dynamic class definitions.AccessController API to replace with weaved access control via AccessControllerPlugin.Plugins.TypeDescription.Generic to a builder.AccessControllerPlugin to weave use of AccessController only if available.InvokeDynamic.JavaDispatcher utility.TypeVariables are AnnotatedElements to support Java 7 and earlier.JavaConstant.MethodCall and identifying a method via a matcher.ClassInjector for use if JNA is already available.HashCodeEqualsPlugin to derive hash code from instrumented type rather then lowest type in hierarchy.AnnotationDescription for TypePool to mirror JVM behavior if annotation properties are changed inconsistently.StackManipulations for common operations.Instrumentation API from JavaModule type.JavaDispatcher API which also allows for custom generation of proxies without use of reflection.JavaConstant API to integrate with Java's ConstantDesc API and to allow for production of such descriptions.JavaConstant API and fix handle resolution.MethodCall.MethodCall.TypePool.Boolean wrapper properties.net.bytebuddy.renamed package in Byte Buddy agent.MethodCall bug when loading arguments from array.private final as required by the JVM when using a native method preifx.MethodCall validation.InstrumentType's method modifiers.AgentBuilder's resubmission feature.nameOf matcher for more efficient string matching based on a hash set.Advice.@AllArguments parameter.Advice.VirtualMachine.Module from boot loader to avoid loading pseudo compiler target bundled with NetBeans.java.instrument module to avoid errors if the module is not present on a JVM.AgentBuilder.Listener during retransformation.AndroidClassLoadingStrategy to work with newer API level.VirtualMachine API emulation.jdk.internal.misc.Unsafe to support agents on platforms that do not include jdk.unsupported.AgentBuilder.InjectionStrategy to allow usage of internal injection API.AgentBuilder if from and to edges are added.VirtualMachine API to include other methods.VirtualMachine API.VirtualMachine API.MemberAttributeExtension.AnnotationDescription API to emulate JVM error handling for incorrect or inconsistent values.Assigner.ByteArrayClassLoader when used from boot class loader.MethodCall to allow for loading target from StackManipulation.MultipleParentClassLoader.AgentBuilder.MethodCall to better reuse intermediates. This implies some API changes in the customization API.AgentBuilder to customize class file transformer.FieldAccessor.MemberSubstitutions.FieldAccessor and MethodCall.MethodDelegation.MemberSubstitution to allow for delegating to matched member.Plugin.Engine.Source to allow for closing resources that need to be opened.MethodCall.ClassInjector API to allow supplying string to byte array mappings.Plugin.Engine to allow simple static enhancements and rework build plugins for Maven and Gradle to use it.AsmVisitorWrapper.ForDeclaredMethods to only instrument methods on .method but offer .invokable for anthing.EnclosedMethod property upon redefinition to avoid error with Groovy which often gets the propery wrong.MethodCall.MethodCalls.MethodCalls.putBoolean.0.getDefinedPackage on Java 8 IBM VMs.MemberSubstitution::relaxed.clone method.toString method to ClassFileVersion.ClassFileInjection.Default.INJECTION in Java 11+ via fallback onto Unsafe::putBoolean.Instrumentation::getAllLoadedClasses.Method constants.getMethod instead of getDeclaredMethod for method lookup if possible.net.bytebuddy.experimental is set.AgentBuilder.net.bytebuddy.dump is set.Implementation.Compound.null.Advice.Exit annotation and allow for method repetition based on exit advice value.Advice.Local annotation to allow for stack allocation of additional variables.toString implementation for parameterized types to the changed OpenJDK 8+ behavior.TypeDescription to avoid overallocation.Advice.ClassWriterStrategy that allows controlling how the constant pool is copied.InjectionClassLoader to avoid abuse.ClassFileBufferStrategy to agent builder.equals and hashCode methods being generated based on the fixes in the previous version.net.bytebuddy.experimental.Object on interfaces to not specialize on the interface type. The latter is also failing verification on Android.EqualsMethod.HashCodeMethod, EqualsMethod and ToStringMethod including build tool plugins.Advice to allow for handling of methods with inconsistent stack map frames if the method arguments are copied.Advice.Advice argument handling to be controlled by a dedicated structure.Advice.ClassReloadingStrategy to allow specification of explicit redefinition strategy. Change default redefinition strategy.Advice.MemberSubstitution.MethodCall.volatile.Advice.String::format.RAW_TYPES mode for loaded types where properties were resolved incorrectly.net.bytebuddy.raw to allow for suppress generic type navigation.null in custom bound Advice.TypePool to use within Advice.MethodDelegation.DiscoveryStrategy for redefinition to determine types to be redefined.net.bytebuddy.nexus.disabled to allow disabling Nexus mechanism.ProtectionDomain when using Nexus class.Advice class custom bindings via opening internally used OffsetMapping API. Remove CustomValue binding which is less powerful.transient with volatile modifier.MemberRemoval component for removing fields and/or methods.MemberSubstituion class for replacing field/method access.AgentBuilder listener API.RawMatcher.Advice.InstallationListener API.InstallationListener in favor of InstallationStrategy and allow resubmission strategy to hook into it in order to cancel submitted jobs.ClassFileTransformer in byte array class loader.ByteBuddyAgent API.Resubmitter to a DSL-step within the redefinition configuration.Resubmitter configuration.AgentBuilder.Transformation.ForAdvice to allow for simple creation of Advice classes from Java agents.toString representations.loaded property for listener on agent builder.@Pipe for method invokability.ClassInjector and class loading strategy.InjectingClassLoader with class loading strategy that allows for reflection-free loading.@SuperMethod and @DefaultMethod annotations for MethodDelegation.AsmVisitorWrapper to accept a list of fields and methods that are intercepted. This allows to use the wrapper also for methods that are overridden.MethodGraph.Compiler.ForDeclaredMethods to avoid processing full type hierarchy if only type enhancement should be done without declaring new methods on a type. This should be used in combination with Advice instead of MethodGraph.Empty as those methods are supplied to the ASM visitor wrappers.MethodDelegation to precompile records for all candidates to avoid duplicate annotation processing.MultipleParentClassLoader to use other loader than bootstrap loader as a parent which is not always legal, e.g. on Android.ClassInjector use official class loading lock if one is available.ClassInjector use getDefinedPackage instead of getPackage if available.sun.misc.Unsafe for class definition if reflective access to the protected ClassLoader methods is not available which are required for the injection strategy.DescriptorStrategy for agent builder.MethodCall for invocation target.TypeCache.null to SuperCall and DefaultCall if assignment is impossible.Forwarding in favor of MethodCall.MethodCall.TargetType in Advice.FieldValue.MethodCall.FieldAccessor to allow reading FieldDescriptions directly.ByteBuddyAgent.MethodCall to allow custom definition of fields.Pipe.Advice classes.Advice to use stack manipulations and Assigner.Advice to use Return instead of BoxedReturn and added AllArguments instead of BoxedArguments in conjunction with allowing to use dynamic typing for assignments via the annotation.Nexus and allow registration of a ReferenceQueue.MethodCall API.AsmVisitorWrapper API.Advice to allow usage as a wrapper for an Implementation. This allows chaining of such advices.FieldDescription or ParameterDescription from a custom Advice annotation which binds the field or parameter value.invokeSelf option to MethodCall instrumentation.FieldAccessor to allow more flexible creation of getters and setters of particular parameters.@Advice.Origin.Instrumentations to only delegate to fields instead of requiring their definition. The defineField API should be generally preferred for defining fields as it is much richer and therefore easier to extend.IMITATE_SUPER_CLASS_OPENING as a default constructor strategy.ConstructorStrategy for inheriting constructors but make them public.CircularityLock on all AgentBuilders by default to avoid that Byte Buddy agents introduce circularities to different agents.Advice as Implementation.FixedValue.self() and added FieldPersistence for describing volatile fields.BatchAllocator.ClassCircularityError from an AgentBuilder by adding thread-local locking.AgentBuilder to fix a regression of 1.4.27.AgentBuilder retransformation mechanism to allow for custom recovery and batch strategies.Note: Currently, it seems like the new retransformation mechanism introduces a racing condition in class loading resulting in some classes not being instrumented
skipOn property of Advice component.Method/Constructor property from Advice.DynamicType builder.byte-buddy-agent to allow agent attachment with explicit argument.Advice more flexible to allow skipping of instrumented method for complex advice method return types.AgentBuilder produce ResettableClassFileTransformers which can undo their transformation.TypeDescription.ForLoadedType serializable for better alignment with reflection API.Instrumentation API for Java 9.AnnotationValue to apply Java 9 specific string rendering on Java 9 VMs.toString representation of parameterized types on Java 9 VMs.final modifier.Advice adjustment of local variable index for debugging information (improves Java agent compatibility).TypeLocator to PoolStrategy to avoid confusion with the names.DescriptionStrategys that rely on fallback-description as those do not properly fallback for meta data.FallbackStrategy as a replacement which allows to reattempt a transformation without using loaded type information.@StubValue and @Unused annotations to Advice component.AdviceFieldProxy.Binder to allow for a single accessor interface.Advice component.jdk.internal namespace by default.sun.reflect namespace by default from AgentBuilder to avoid error messages.POOL_LAST_DEFERRED and POOL_LAST_FALLBACK description strategy.void methods without regular return in Advice.TypeValidation for Java 8 interfaces not allowing private methods.AccessController usage.Advice component.AccessController. Added privileged handling to AgentBuilder.ByteBuddy creation more robust by adding a default fallback for unknown VMs.Implementation.Target and Implementation.Context in case of a type inlining to provide correct feature set. Added validation if this constraint is broken.TypePool using an eager TypeDescription more robust towards errors.Advice component to clear the stack upon a return. Without this, if code would return without leaving the stack empty, a verifier error would be thrown. This typically is only a problem when processing code that was produced by other code generation libraries.TypeLocator to share a key for the system and bootstrap class loader.DescriptionStrategy for POOL_LAST and POOL_FIRST resolution.Advice via entry advice indicated by return value.Transformer API to be shared for methods, fields and type variables.Advice methods over multiple classes.AsmVisitorWrappers for declared fields and methods.Advice class for byte code parsing.TypePool that allows for lazy resolution of referenced types. This can both be a performance improvement and allows working with optional types as long as they are not directly required within a transformation. This type pool is now used by default.ByteBuddy::makeInterface.TypeResolutionStrategy to allow for active resolution via the Nexus also from outside the AgentBuilder.ClassLoadingStrategy to not resolve types during loading.ClassLoadingStrategy.ClassFileLocator for a class loader that only references it weakly.TypePool and ClassFileLocator separately within an AgentBuilder.MethodPool sensitive to bridge methods which should only be added to classes of a version older than Java 4.ClassFileTransformer to only apply on Java 9 VMs.InstallationStrategy to AgentBuilder that allows customization of error handling.net.bytebuddy qualifier when logging.net.bytebuddy.dump system property for specifying a location for writing all created class files.MultipleParentClassLoader where class loaders were no longer filtered properly.DescriptionStrategy customizable.Advice methods to avoid polluting the local variable array when dealing with nested exception handlers.ElementMatcher as a wrapping matcher.AgentBuilder.DescriptionStrategy that allows not using reflection in case that a class references non-available classes.MethodCall instrumentation for number of arguments provided to a method.BinaryLocator and changed its name to TypeLocator.MultipleParentClassLoader to support usage as being a parent itself.AgentBuilder to ignore synthetic types.MethodCall to add all arguments of the instrumented method.optional attribute to Advice.This.TypePool is no longer parameterized for a static inner type.forName lookups.MethodHandle and MethodType handling as JavaInstance.AgentBuilder to allow for transformations that apply fall-through semantics, i.e. work as a decorator.BinaryLocator.Advice components if class file version is above 1.5.@BoxedReturn value to change the returned value.Advice component storing serializable values that cannot be represented in the constant pool as encodings in the constant pool.Advice method.Advice computation.Advice component.Advice now appends handlers to an existing exception handler instead of prepending them. Before, existing exception handlers were shadowed when applying suppression or exit advice on an exception.Advice such as @Advice.BoxedReturn and @Advice.BoxedArguments for more generic advice. Added possibility to write to fields from advice.Advice that map compile-time constants.MethodDelegation mapping.Advice component when suppression were not catched for an exit advice.Advice when exception is not catched.disableClassFormatChanges for AgentBuilder.Advice.Advice.Advice once to reduce amount of added bytes to avoid size explosion when a method supplied several exits.Advice injection to only add advice infrastructure if entry/exit advice is supplied.Advice to only be applied when exceptions are catched.AsmVisitorWrapper.Advice method parser respect ASM reader flags for expanding frames.Advice exit method without return value and accessing @Advice.Thrown.@Advice.Ignored and @Advice.Origin.Advice method to reuse existing frame information instead of recomputing it.FieldLocator.AgentBuilder API to allow for more flexible matching and ignoring types.Advice.FieldValue annotation for reading fields from advice.TypePool.Throwable from advice methods when using the Advice instrumentation.Advice adapter for ASM.Advice adapter for ASM.AsmVisitorWrapper registration to be stacked instead of replacing a previous value.static fields. Clarified javadoc.AgentBuilder where transformations were applied twice.ClassLoader as a third argument for the AgentBuilder.Transformer.AgentBuilder API to be more streamlined with the general API and improved documentation.AgentBuilder. By default, synthetic types are ignored.TargetType.TypeDescriptions. This allows for resolution of variables on these types as erasures rather than their unresolved form. Refactored naming of generic types to the common naming scheme with nested classes.MethodCall implementation to include shortcuts for executing Runnable and Callable instances.failSafe matcher that returns false for types that throw exceptions during navigation.ClassReloadingStrategy.InitiailizationStrategys for self-injection where the new default strategy loads types that are independent of the instrumented type before completing the instrumentation. This way, the resolution does not fail for types that are accessed via reflection before initializing the types if a executingTransformer is rebased.@Origin for constructors and added possibility to use the Executable type.@Super.TypePool that returns precomputed TypeDescriptions for given types.@Super when the instrumented type is instrumented to see changed state on a redefinition.Nexus injection to attempt lookup of already loaded class if resource cannot be located.TypePool that falls back to class loading if a class cannot be located.TypeDescription.Nexus and Installer types to a package-level to avoid illegal outer and inner class references which could be resolved eagerly.Premature initialization strategy for optimistically loading auxiliary types.ClassVisitorWrapper for translating Java class files prior to Java 5 to use explicit class loading rather than class pool constants.ClassFileLocators and refactored class file lookup to always use these locators.AgentBuilder.Default to delay auxiliary type injection until load time to avoid premature loading by reference from auxiliary types.Nexus to allow for multiple registrations of self initializers if multiple agents are registered via Byte Buddy.AgentBuilder.Default to delegate exceptions during redefinitions to listener instead of throwing them.Instrumentation API when building agents.<clinit> blocks in interface types.Implementation.Context that is configurable. This way, it is possible to avoid a rebase of a type initializer which is not always possible.AgentBuilder how it should redefine or rebase a class that is intercepted.TypeDescription instances where type variables of members were not resolved.ClassReader and ClassWriter instances.Nexus instances of the Byte Buddy agents from the enclosing class loader rather than from the system class loader. This allows for their usage from OSGi environments and for user with other custom class loaders.ByteArrayClassLoader.MethodGraph to only represent virtual methods.@Super and @Default annotations.AmbigouityResolver.MethodLookupEngine with MethodGraph.Compiler to provide a richer data structure.ElementMatchers to allow for matching generic types.ModifierResolver with a more general MethodTransformer.ClassFileLocators for locating jar files in folders and jar files.@StubValue and @FieldValue annotations.Corrected incorrect deployment of version 0.6.7 which does not use a dependency reduced POM for the byte-buddy module.
Warning: The byte-buddy artifact of version 0.6.7 is accidentally deployed with a defect POM file which does not exclude the shaded resources.
TargetType pseudo-variable when used as component type of an array.@Origin annotation to allow for accepting modifiers.TypeDescription.ForLoadedType class loader agnostic. Before, a class that was loaded by multiple class
loaders would have been considered inequal what is not true for the byte code level.Assigner singleton.AnnotationDescription.Builder to allow easy definition of annotation values without loading any values.MethodCall and InvokeDynamic implementations.Instrumentation interface to Implementation to avoid naming conflicts with Java types.Field annotation to FieldProxy to avoid naming conflicts with Java types.TypeWriter, MethodRegistry and other supporting infrastructure to make the code simpler.ParameterDescriptions and added possibility to extract names
and modifiers for these parameters, either by using the Java 8 API (if available) or by reading this information
from the underlying class file.NullPointerException being thrown due to accidental return of a null value from a method.MethodCall instrumentation.SuperMethodCall instrumentation to fall back to a default method call if required. A different
behavior was found to surprise users and would introduce subtle bugs in user code as the super method instrumentation
would always work with subclassing due to Java super method call semantics.MethodCall instrumentation that allows hard-coding a method call.InvokeDynamic instrumentation that allows runtime dispatching by bootstrap methods.TypePool to retain generic signatures in order to avoid that agents delete such signatures.ConstructorStrategy that effectively prevented intercepting of constructors.NullPointerException.ElementMatchers that allow to identify class loaders.Added the andThen method to the SuperMethodCall instrumentation in order to allow for a more convenient
executingTransformer interception where a hard-coded super method call is required by the Java verifier.
DeclaringTypeResolver as a component in the default chain which selects the most specific method out
of two. This is mainly meant to avoid the accidental matching of the methods that are declared by the Object type.TypeInitializers in order to allow Instrumentations to define type initializer blocks.MethodMatcher API with the ElementMatcher API which allows for a more sophisticated matching DSL.ClassLoadingStrategy for Android in its own module.AgentBuilder API and implementation.VoidAwareAssigner which would otherwise cause unexpected behavior in its
default state.InvocationHandlerAdapter.Instrumentation.Context to support field accessors.TypePool abstraction and added a default implementation.AnnotationDescription which does not need to
represent loaded values.Instrumentation, among others, all implementations now support TypeDescription
in addition to loaded Class as their argumentsMethodDelegation.ProtectionDomain for the built-in ClassLoadingStrategy implementations.ByteArrayClassLoader and its child-first implementation.MethodHandle and MethodType which are available from Java 7 for injection.ClassLoadingStrategy and manifest versions of the WRAPPER and CHILD_FIRST default
class loading strategies.Method instances for the @Origin annotation and the InvocationHandlerAdapter.@SuperCall to be only bindable, if a super method can be invoked. Before, an
exception was thrown if only a non-existent or abstract super method was found.Instrumentation.Target. For a future release,
this hopefully allows for class redefinitions using today's API for creating subclasses.