Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spotless
Browse files Browse the repository at this point in the history
laurit committed Nov 16, 2023

Verified

This commit was signed with the committer’s verified signature.
laurit Lauri Tulmin
1 parent 0556b38 commit 60c9424
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -567,7 +567,10 @@ private static void instrument(
Type returnType = Type.getReturnType(methodNode.desc);

// currently we don't support rewriting enter advice returning a primitive type
if (isEnterAdvice && !(returnType.getSort() == Type.VOID || returnType.getSort() == Type.OBJECT || returnType.getSort() == Type.ARRAY)) {
if (isEnterAdvice
&& !(returnType.getSort() == Type.VOID
|| returnType.getSort() == Type.OBJECT
|| returnType.getSort() == Type.ARRAY)) {
context.disableReturnTypeChange();
}
// context is shared by enter and exit advice, if entry advice was rejected don't attempt to
@@ -769,9 +772,9 @@ public void visitInsn(int opcode) {

/**
* If method is annotated with {@link Advice.OnMethodEnter} or {@link Advice.OnMethodExit} set
* {@code inline} attribute on the annotation to {@code false}.
* If method is annotated with {@link Advice.OnMethodEnter} and has {@code skipOn} attribute set
* {@code skipOnIndex} attribute on the annotation to {@code 0}.
* {@code inline} attribute on the annotation to {@code false}. If method is annotated with {@link
* Advice.OnMethodEnter} and has {@code skipOn} attribute set {@code skipOnIndex} attribute on the
* annotation to {@code 0}.
*/
private static MethodVisitor delegateAdvice(TransformationContext context, MethodVisitor target) {
return new MethodVisitor(Opcodes.ASM9, target) {

0 comments on commit 60c9424

Please sign in to comment.