JPA Classes Generating Underscore class

  • Melloware Inc

    Melloware Inc - 2012-07-20

    For every one of my JPA classes I am seeing both Cobertura and Jacoco report two classes.  So for example if my JPA annotated class is called I will see Jacoco have two entries…


    When I click on the _ version of the report it simply says Missed Instructions 3 of 3 for a method like this…


    Is this the default constructor it is missing or something?

  • Marc R. Hoffmann

    Yes, if the class is called "HelloJpa_" the method shown in the report with name "HelloJpa_()" is the default constructor. Actually JaCoCo reporting uses a strategy to transform internal class files names (which would be "<init>") to more source-like names.

  • Melloware Inc

    Melloware Inc - 2012-07-23

    Is there anything I can do to make this behavior stop.  Even if I add my own default constructor and write a unit test that covers it this extra HelloJpa_ is still showing up and showing that it is "untested".  Any help would be appreciated!

  • Melloware Inc

    Melloware Inc - 2012-07-23

    I can attach a sample class if you want?

  • Marc R. Hoffmann

    You can filter those generated class files when generating a JaCoCo report. Simply add exclude="*_" to the class file set you supply to the Ant report task (or Maven goal). See documentation for details.

  • Melloware Inc

    Melloware Inc - 2012-07-26

    Perfect!  That solved my issue.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks