@Test public void testSuperTypeMethodIsInvokable() throws Exception { when(invokableMethod.isSpecializableFor(rawSuperClass)).thenReturn(true); Implementation.SpecialMethodInvocation specialMethodInvocation = makeImplementationTarget().invokeSuper(invokableToken); assertThat(specialMethodInvocation.isValid(), is(true)); assertThat(specialMethodInvocation.getMethodDescription(), is((MethodDescription) invokableMethod)); assertThat(specialMethodInvocation.getTypeDescription(), is(rawSuperClass)); MethodVisitor methodVisitor = mock(MethodVisitor.class); Implementation.Context implementationContext = mock(Implementation.Context.class); StackManipulation.Size size = specialMethodInvocation.apply(methodVisitor, implementationContext); verify(methodVisitor).visitMethodInsn(Opcodes.INVOKESPECIAL, BAR, FOO, QUX, false); verifyNoMoreInteractions(methodVisitor); verifyZeroInteractions(implementationContext); assertThat(size.getSizeImpact(), is(0)); assertThat(size.getMaximalSize(), is(0)); }
public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token) { MethodRebaseResolver.Resolution resolution = rebaseableMethods.get(token); return resolution == null ? invokeSuper(methodGraph.getSuperClassGraph().locate(token)) : invokeSuper(resolution); }
RebaseImplementationTarget extends Implementation.Target.AbstractBase { public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token) { MethodRebaseResolver.Resolution resolution = rebaseableMethods.get(token); return resolution == null ? invokeSuper(methodGraph.getSuperClassGraph().locate(token)) : invokeSuper(resolution); } }
RebaseImplementationTarget extends Implementation.Target.AbstractBase { public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token) { MethodRebaseResolver.Resolution resolution = rebaseableMethods.get(token); return resolution == null ? invokeSuper(methodGraph.getSuperClassGraph().locate(token)) : invokeSuper(resolution); } protected  RebaseImplementationTarget(TypeDescription instrumentedType,
                                         MethodGraph.Linked methodGraph,
                                         DefaultMethodInvocation defaultMethodInvocation,
                                         Map<MethodDescription.SignatureToken, MethodRebaseResolver.Resolution> rebaseableMethods); }
RebaseImplementationTarget extends Implementation.Target.AbstractBase { public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token) { MethodRebaseResolver.Resolution resolution = rebaseableMethods.get(token); return resolution == null ? invokeSuper(methodGraph.getSuperClassGraph().locate(token)) : invokeSuper(resolution); } protected  RebaseImplementationTarget(TypeDescription instrumentedType,
                                         MethodGraph.Linked methodGraph,
                                         DefaultMethodInvocation defaultMethodInvocation,
                                         Map<MethodDescription.SignatureToken, MethodRebaseResolver.Resolution> rebaseableMethods); Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token); TypeDescription getOriginType(); }
RebaseImplementationTarget extends Implementation.Target.AbstractBase { public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token) { MethodRebaseResolver.Resolution resolution = rebaseableMethods.get(token); return resolution == null ? invokeSuper(methodGraph.getSuperClassGraph().locate(token)) : invokeSuper(resolution); } protected  RebaseImplementationTarget(TypeDescription instrumentedType,
                                         MethodGraph.Linked methodGraph,
                                         DefaultMethodInvocation defaultMethodInvocation,
                                         Map<MethodDescription.SignatureToken, MethodRebaseResolver.Resolution> rebaseableMethods); Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token); TypeDescription getOriginType();  }