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
[ERROR] Failures:
[ERROR] me.chanjar.jacocobug.system.repo.DictionaryTypeRepositoryIT.testDictionaryTypeSort(me.chanjar.jacocobug.system.repo.DictionaryTypeRepositoryIT)
[INFO] Run 1: PASS
[ERROR] Run 2: DictionaryTypeRepositoryIT>AbstractTestNGSpringContextTests.run:180->testDictionaryTypeSort:31 » ArrayIndexOutOfBounds
Failsafe report:
testDictionaryTypeSort (me.chanjar.jacocobug.system.domain.DictionaryType@4057fa5f)
java.lang.ArrayIndexOutOfBoundsException: 23
at me.chanjar.jacocobug.system.domain.DictionaryType.setIsDataCenter(DictionaryType.java:100)
at me.chanjar.jacocobug.system.repo.DictionaryTypeRepository.createDictionaryType(DictionaryTypeRepository.java:42)
at me.chanjar.jacocobug.system.repo.DictionaryTypeRepository$$FastClassBySpringCGLIB$$9d92e7db.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at me.chanjar.jacocobug.system.repo.DictionaryTypeRepository$$EnhancerBySpringCGLIB$$7ea2705b.createDictionaryType(<generated>)
at me.chanjar.jacocobug.system.repo.DictionaryTypeRepositoryIT.testDictionaryTypeSort(DictionaryTypeRepositoryIT.java:31)
at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:180)
... Removed 32 stack frames
I suspect this bug related to reflection. If I comment out this line, no problem shows.
The text was updated successfully, but these errors were encountered:
chanjarster
changed the title
Jacoco ArrayIndexOutOfBoundException
ArrayIndexOutOfBoundsException
Jan 19, 2019
The code clearly shows that this is the problem described in our FAQ:
My code uses reflection. Why does it fail when I execute it with JaCoCo?
To collect execution data JaCoCo instruments the classes under test which adds two members to the classes: A private static field $jacocoData and a private static method $jacocoInit(). Both members are marked as synthetic.
Please change your code to ignore synthetic members. This is a good practice anyways as also the Java compiler creates synthetic members in certain situation.
Your example code iterates over all fields (including static and synthetic) ones.
Steps to reproduce
JaCoCo version: 0.8.2
Operating system: "mac os x", version: "10.14.2", arch: "x86_64", family: "mac"
Tool integration: Maven 3.5.4
Java version: java version "1.8.0_181"
mvn clean install
Expected behaviour
Everything goes fine.
Actual behaviour
Maven result:
Failsafe report:
I suspect this bug related to reflection. If I comment out this line, no problem shows.
The text was updated successfully, but these errors were encountered: