Skip to content

Commit

Permalink
Fix mapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Mar 3, 2018
1 parent ba63513 commit 40bd2f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ public int prepare(MethodVisitor methodVisitor) {

@Override
public int argument(int offset) {
return offset > instrumentedMethod.getStackSize()
? offset + enterType.getStackSize().getSize()
: offset;
return offset < instrumentedMethod.getStackSize()
? offset
: offset + enterType.getStackSize().getSize();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class AdviceOffsetHandlerTest {
public void testShortMethod() throws Exception {
Class<?> type = new ByteBuddy()
.redefine(ShortMethod.class)
.visit(DebuggingWrapper.makeDefault(true))
.visit(Advice.to(EmptyAdvice.class).on(named(FOO)).readerFlags(ClassReader.SKIP_DEBUG))
.make()
.load(ClassLoadingStrategy.BOOTSTRAP_LOADER, ClassLoadingStrategy.Default.WRAPPER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ public void testAdviceWithOptionalThisReferenceOptional() throws Exception {
public void testAdviceWithEntranceValue() throws Exception {
Class<?> type = new ByteBuddy()
.redefine(Sample.class)
.visit(DebuggingWrapper.makeDefault(false))
.visit(Advice.to(EntranceValueAdvice.class).on(named(FOO)))
.make()
.load(ClassLoadingStrategy.BOOTSTRAP_LOADER, ClassLoadingStrategy.Default.WRAPPER)
Expand Down

0 comments on commit 40bd2f5

Please sign in to comment.