You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a simple step with lambda-expression inside:
public class WhenStage<SELF extends WhenStage<SELF>> extends Stage<SELF> {
public SELF test() {
doAnswer(invocationOnMock -> null).when(mockedObject).myMethod();
return self();
}
When I launch the test, the following exception occurs:
[Stack Trace]
java.lang.ArrayIndexOutOfBoundsException: 19562
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.accept(BytecodeReadingParanamer.java:563)
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.access$200(BytecodeReadingParanamer.java:338)
at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:103)
at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:69)
at com.tngtech.jgiven.impl.util.ScenarioUtil.getParameterNames(ScenarioUtil.java:51)
at com.tngtech.jgiven.impl.util.ScenarioUtil.mapArgumentsWithParameterNames(ScenarioUtil.java:32)
at com.tngtech.jgiven.impl.ScenarioExecutor$MethodHandler.handleMethod(ScenarioExecutor.java:131)
at com.tngtech.jgiven.impl.intercept.StepMethodInterceptor.intercept(StepMethodInterceptor.java:44)
at
But if I replace lambda expression with anonymous class, all works fine.
The text was updated successfully, but these errors were encountered:
Ok. I have fixed the issue. However, it has a little drawback. In order to work for Java 8 correctly, you have to compile your test classes with the -parameters option of javac.
I have implemented a simple step with lambda-expression inside:
When I launch the test, the following exception occurs:
[Stack Trace]
java.lang.ArrayIndexOutOfBoundsException: 19562
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.accept(BytecodeReadingParanamer.java:563)
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.access$200(BytecodeReadingParanamer.java:338)
at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:103)
at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:69)
at com.tngtech.jgiven.impl.util.ScenarioUtil.getParameterNames(ScenarioUtil.java:51)
at com.tngtech.jgiven.impl.util.ScenarioUtil.mapArgumentsWithParameterNames(ScenarioUtil.java:32)
at com.tngtech.jgiven.impl.ScenarioExecutor$MethodHandler.handleMethod(ScenarioExecutor.java:131)
at com.tngtech.jgiven.impl.intercept.StepMethodInterceptor.intercept(StepMethodInterceptor.java:44)
at
But if I replace lambda expression with anonymous class, all works fine.
The text was updated successfully, but these errors were encountered: