Issue Description: Failing while building mockito-inline version 4.6.1 using ./gradlew build (org.mockito:mockito-inline:4.6.1)
JDK Version: 1.8
Build CMD: ./gradlew build
MVN Version: NA
gradle version - NA
Error Log:
org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubsConcurrentTest > given_mock_with_returns_deep_stubswhen_called_concurrentlythen_does_not_throw_concurrent_modification_exception FAILED
java.lang.ArrayIndexOutOfBoundsException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)
at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)
at java.util.stream.ForEachOps$ForEachOp$OfInt.evaluateParallel(ForEachOps.java:188)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at java.util.stream.IntPipeline.forEach(IntPipeline.java:427)
at java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:584)
at org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubsConcurrentTest.given_mock_with_returns_deep_stubswhen_called_concurrentlythen_does_not_throw_concurrent_modification_exception(ReturnsDeepStubsConcurrentTest.java:22)
Caused by:
java.lang.ArrayIndexOutOfBoundsException: 0
at java.util.LinkedList.toArray(LinkedList.java:1053)
at java.util.LinkedList.addAll(LinkedList.java:408)
at java.util.LinkedList.addAll(LinkedList.java:387)
at java.util.LinkedList.<init>(LinkedList.java:119)
at org.mockito.internal.stubbing.InvocationContainerImpl.getStubbingsAscending(InvocationContainerImpl.java:157)
at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:96)
at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:34)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:82)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:56)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor$DispatcherDefaultingToRealMethod.interceptAbstract(MockMethodInterceptor.java:161)
at org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubsConcurrentTest$Service$MockitoMock$6LpIhAmi.doSomething(Unknown Source)
at org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubsConcurrentTest.lambda$given_mock_with_returns_deep_stubs__when_called_concurrently__then_does_not_throw_concurrent_modification_exception$0(ReturnsDeepStubsConcurrentTest.java:22)
Package artifact id: org.mockito
source code url: https://github.com/mockito/mockito/releases/tag/v4.6.1
Issue Description: Failing while building mockito-inline version 4.6.1 using ./gradlew build (org.mockito:mockito-inline:4.6.1)
JDK Version: 1.8
Build CMD: ./gradlew build
MVN Version: NA
gradle version - NA
Error Log:
org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubsConcurrentTest > given_mock_with_returns_deep_stubswhen_called_concurrentlythen_does_not_throw_concurrent_modification_exception FAILED java.lang.ArrayIndexOutOfBoundsException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598) at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677) at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735) at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159) at java.util.stream.ForEachOps$ForEachOp$OfInt.evaluateParallel(ForEachOps.java:188) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) at java.util.stream.IntPipeline.forEach(IntPipeline.java:427) at java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:584) at org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubsConcurrentTest.given_mock_with_returns_deep_stubswhen_called_concurrentlythen_does_not_throw_concurrent_modification_exception(ReturnsDeepStubsConcurrentTest.java:22)
org.mockitousage.bugs.ConcurrentModificationExceptionOnMultiThreadedVerificationTest > shouldSuccessfullyVerifyConcurrentInvocationsWithTimeout FAILED org.mockito.exceptions.verification.TooFewActualInvocations: iTarget.targetMethod("a
attachement: build log attached (jdk 1.8) Failed_jdk_8.txt
OS: windows 10