Skip to content

Commit

Permalink
Generified fixed value dynamic value.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Nov 17, 2016
1 parent be85507 commit a6746ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions byte-buddy-dep/src/main/java/net/bytebuddy/asm/Advice.java
Expand Up @@ -8618,14 +8618,16 @@ StackManipulation resolve(TypeDescription instrumentedType,
* The mapped value must be a constant value that can be embedded into a Java class file. This holds for all primitive types,
* instances of {@link String} and for {@link Class} instances as well as their unloaded {@link TypeDescription} representations.
* </p>
*
* @param <S> The annotation type.
*/
abstract class ForFixedValue implements DynamicValue<Annotation> {
abstract class ForFixedValue<S extends Annotation> implements DynamicValue<S> {

@Override
public StackManipulation resolve(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
ParameterDescription.InDefinedShape target,
AnnotationDescription.Loadable<Annotation> annotation,
AnnotationDescription.Loadable<S> annotation,
Assigner assigner,
boolean initialized) {
Object value = doResolve(instrumentedType, instrumentedMethod, target, annotation, assigner, initialized);
Expand Down Expand Up @@ -8683,14 +8685,14 @@ public StackManipulation resolve(TypeDescription instrumentedType,
protected abstract Object doResolve(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
ParameterDescription.InDefinedShape target,
AnnotationDescription.Loadable<Annotation> annotation,
AnnotationDescription.Loadable<S> annotation,
Assigner assigner,
boolean initialized);

/**
* A fixed value binding for a constant pool value.
*/
protected static class OfConstant extends ForFixedValue {
protected static class OfConstant extends ForFixedValue<Annotation> {

/**
* The constant value being bound.
Expand Down Expand Up @@ -8750,7 +8752,7 @@ public String toString() {
/**
* A dynamic value binding for an annotation property of an annotation on the bound parameter.
*/
protected static class OfAnnotationProperty extends ForFixedValue {
protected static class OfAnnotationProperty extends ForFixedValue<Annotation> {

/**
* The annotation property to bind.
Expand Down

0 comments on commit a6746ea

Please sign in to comment.