[java code coverage] Re: $jacocoData column is added in excel sheet

141 views
Skip to first unread message

Vikas Gupta

unread,
Feb 8, 2022, 7:39:42 AM2/8/22
to JaCoCo and EclEmma Users
Hi Team,

While parsing the excel file in Java, I am getting Null Pointer Exception because [java code coverage] Re: $jacocoData column is added in the excel sheet.

This issue is faced while writing a test case for the ExcelService Class.

The above issue is very critical. So, need urgent help ASAP.


Thank,
Vikas Gupta

Marc Hoffmann

unread,
Feb 8, 2022, 8:54:36 AM2/8/22
to jac...@googlegroups.com
Hi Vikas,

in this case I urge you to ASAP have a look at our very critical FAQ: https://www.jacoco.org/jacoco/trunk/doc/faq.html

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. 


Regards,
-marc



--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/e50d58b3-53fa-4baa-90c1-be67d121831an%40googlegroups.com.

Vikas Gupta

unread,
Feb 8, 2022, 3:23:48 PM2/8/22
to jac...@googlegroups.com
Hi, 

I discuss with my colleague and he said we can not change this into service class because I am writing only test case so is there any way that we can change in test class file or in excel file? 

Thanks & Regards
Vikas Gupta

Vikas Gupta

unread,
Feb 8, 2022, 3:25:32 PM2/8/22
to jac...@googlegroups.com, hoff...@mountainminds.com

Vikas Gupta

unread,
Feb 8, 2022, 3:26:41 PM2/8/22
to jac...@googlegroups.com, hoff...@mountainminds.com
Hi, 

I discuss with my colleague and he said we can not change this into service class because I am writing only test case so is there any way that we can change in test class file or in excel file? 

Thanks & Regards
Vikas Gupta

On Tue, 8 Feb, 2022, 7:24 PM Marc Hoffmann, <hoff...@mountainminds.com> wrote:

Marc Hoffmann

unread,
Feb 8, 2022, 3:56:43 PM2/8/22
to jac...@googlegroups.com
No.

On 8. Feb 2022, at 21:26, Vikas Gupta <guptav...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages