First general release.
Added several bug fixes for existing features. Beyond that the following features were added or changed:
- Changed the semantics of the
@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. - Added features for the interaction with Java 8 default methods. Refactored method lookup to extract invokable default methods.
- Refactored the invocation of super methods to be created by an
Instrumentation.Target
. For a future release, this hopefully allows for class redefinitions using today's API for creating subclasses. - Upgraded to ASM 5.0.3.
Added proper support for defining class initializers. Added support for field caching from method instrumentations,
mainly for allowing the reuse of Method
instances for the @Origin
annotation and the InvocationHandlerAdapter
.
- Added basic support for Java 7 types
MethodHandle
andMethodType
which are available from Java 7 for injection. - Added support for type redefinition and type rebasing.
- Added support for accessing a JVM's HotSwap features and a Java agent.
- Added latent a child-first
ClassLoadingStrategy
and manifest versions of theWRAPPER
andCHILD_FIRST
default class loading strategies.
- Added support for optionally specifying a
ProtectionDomain
for the built-inClassLoadingStrategy
implementations. - Fixed a bug in the resolution of resources of the
ByteArrayClassLoader
and its child-first implementation.
- Extended
Instrumentation.Context
to support field accessors. - Added the
TypePool
abstraction and added a default implementation. - Refactored annotations to have an intermediate form as
AnnotationDescription
which does not need to represent loaded values. - Refactored several built-in
Instrumentation
, among others, all implementations now supportTypeDescription
in addition to loadedClass
as their arguments - Added several annotations that apply to the
MethodDelegation
.
- Refactored the implementation of the
VoidAwareAssigner
which would otherwise cause unexpected behavior in its default state. - Added a missing boxing instruction to the
InvocationHandlerAdapter
.
- Added the
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 theObject
type. - Added
TypeInitializer
s in order to allowInstrumentation
s to define type initializer blocks. - Replaced the
MethodMatcher
API with theElementMatcher
API which allows for a more sophisticated matching DSL. - Added a
ClassLoadingStrategy
for Android in its own module. - Introduced an
AgentBuilder
API and implementation.
Added the andThen
method to the SuperMethodCall
instrumentation in order to allow for a more convenient
constructor interception where a hard-coded super method call is required by the Java verifier.
- Fixed a bug where interface generation would result in a
NullPointerException
. - Added additional
ElementMatcher
s that allow to identify class loaders.
- Changed the
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. - Added a
MethodCall
instrumentation that allows hard-coding a method call. - Added an
InvokeDynamic
instrumentation that allows runtime dispatching by bootstrap methods. - Fixed the default
TypePool
to retain generic signatures in order to avoid that agents delete such signatures. - Fixed a bug in all of the the default
ConstructorStrategy
that effectively prevented intercepting of constructors.
- Fixed missing retention of method annotations of instrumented types.
- Allowed dynamic lookup of methods for the
MethodCall
instrumentation.
- Retrofitted method parameters to be represented by
ParameterDescription
s 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. - Fixed a
NullPointerException
being thrown due to accidental return of anull
value from a method.
- Added possibility to write parameter meta information to created classes if it is fully available for a method.
No changes.