/** * {@inheritDoc} */ public boolean isValid() { for (StackManipulation stackManipulation : stackManipulations) { if (!stackManipulation.isValid()) { return false; } } return true; }
/** * {@inheritDoc} */ public boolean isValid() { return stackManipulation.isValid(); }
/** * {@inheritDoc} */ public boolean isValid() { return methodConstant.isValid(); }
/** * {@inheritDoc} */ public boolean isValid() { return fieldValue.isValid(); }
/** * {@inheritDoc} */ public boolean isValid() { return delegate.isValid(); }
/** * {@inheritDoc} */ public boolean isValid() { return delegate.isValid(); }
/** * {@inheritDoc} */ public boolean isValid() { return implementation.isValid(); }
/** * {@inheritDoc} */ public boolean isValid() { boolean result = methodInvocation.isValid() && terminatingStackManipulation.isValid(); Iterator<StackManipulation> assignment = parameterStackManipulations.iterator(); while (result && assignment.hasNext()) { result = assignment.next().isValid(); } return result; }
/** * {@inheritDoc} */ public boolean isValid() { for (StackManipulation stackManipulation : stackManipulations) { if (!stackManipulation.isValid()) { return false; } } return arrayCreator.isValid(); }
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = new StackManipulation.Compound( ClassConstant.of(instrumentedType), assigner.assign(TypeDescription.Generic.OfNonGenericType.ForLoadedType.CLASS, target.getType(), typing)); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign Class value to " + target); } return stackManipulation; }
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing) { StackManipulation assignment = assigner.assign(typeDefinition.asGenericType(), target.getType(), typing); if (!assignment.isValid()) { throw new IllegalStateException("Cannot assign " + target + " to " + typeDefinition); } return new StackManipulation.Compound(stackManipulation, assignment); } }
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = new StackManipulation.Compound(appender.toStackManipulation(instrumentedMethod, methodDescription, targetHandler), assigner.assign(methodDescription.getReturnType(), target.getType(), typing)); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign return type of " + methodDescription + " to " + target); } return stackManipulation; }
/** * {@inheritDoc} */ protected Resolved doResolve(StackManipulation access, TypeDescription.Generic type, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = assigner.assign(type, typeDescription.asGenericType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign " + type + " to " + typeDescription); } return new Resolved.Simple(new StackManipulation.Compound(access, stackManipulation), typeDescription); } }
/** * {@inheritDoc} */ protected Resolved doResolve(StackManipulation access, TypeDescription.Generic typeDescription, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = assigner.assign(typeDescription, this.typeDescription.asGenericType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign " + typeDescription + " to " + this.typeDescription); } return new Resolved.Simple(new StackManipulation.Compound(access, stackManipulation), this.typeDescription); } }
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = new StackManipulation.Compound( MethodVariableAccess.loadThis(), assigner.assign(instrumentedType.asGenericType(), target.getType(), typing)); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign " + instrumentedType + " to " + target); } return stackManipulation; }
@Override protected StackManipulation resolve(MethodDescription interceptedMethod, TypeDescription returnType, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = assigner.assign(returnType.asGenericType(), interceptedMethod.getReturnType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot return " + returnType + " from " + interceptedMethod); } return new StackManipulation.Compound(stackManipulation, MethodReturn.of(interceptedMethod.getReturnType())); } },
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(MethodDescription invokedMethod, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = assigner.assign(invokedMethod.getReturnType(), fieldDescription.getType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign result of " + invokedMethod + " to " + fieldDescription); } return new StackManipulation.Compound(stackManipulation, FieldAccess.forField(fieldDescription).write()); }
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = new StackManipulation.Compound( FieldAccess.forField(fieldDescription).read(), assigner.assign(fieldDescription.getType(), target.getType(), typing)); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign " + fieldDescription.getType() + " to " + target); } return stackManipulation; }
/** * {@inheritDoc} */ public StackManipulation toStackManipulation(MethodDescription invokedMethod, Assigner assigner, Assigner.Typing typing) { StackManipulation stackManipulation = assigner.assign(parameterDescription.getType(), invokedMethod.getDeclaringType().asGenericType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot invoke " + invokedMethod + " on " + parameterDescription.getType()); } return new StackManipulation.Compound(MethodVariableAccess.load(parameterDescription), stackManipulation); } }
/** * {@inheritDoc} */ public Resolved resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing) { FieldDescription fieldDescription = instrumentedType.getDeclaredFields().filter(named(name)).getOnly(); StackManipulation stackManipulation = assigner.assign(fieldDescription.getType(), fieldType.asGenericType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign " + fieldDescription + " to " + fieldType); } return new Resolved.Simple(new StackManipulation.Compound(FieldAccess.forField(fieldDescription).read(), stackManipulation), fieldDescription.getType().asErasure()); }