New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline instrumentation should not damage module-info #634

merged 2 commits into from Dec 28, 2017


2 participants

Godin commented Dec 26, 2017


$ mkdir -p src/org/example

$ cat <<END > src/
module org.example {

$ cat <<END > src/org/example/
package org.example;

class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello, World");

$ javac -d mods/org.example \
        src/ \

after #600 we are able to instrument module-info.class

$ java -jar jacococli.jar \
       instrument mods \
       --dest mods-instrumented

and after #565 execute instrumented module using --add-reads

$ java \
       --module-path mods-instrumented:jacocoagent.jar \
       --add-modules org.jacoco.agent.rt \
       --add-reads org.example=org.jacoco.agent.rt \
       --module org.example/org.example.HelloWorld

however test #608 lacks such execution and following exception went unnoticed

Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: mods-instrumented/org.example
Caused by: java.lang.module.InvalidModuleDescriptorException: Bad #fields

cause of exception

$ javap -p mods-instrumented/org.example/module-info.class
Compiled from ""
module org.example {
  requires java.base;
  private static transient boolean[] $jacocoData;
  private static boolean[] $jacocoInit();

@Godin Godin self-assigned this Dec 23, 2017

@Godin Godin added this to TODO in Java 9 Dec 23, 2017

Godin added some commits Dec 26, 2017


This comment has been minimized.

Show comment
Hide comment

Godin Dec 26, 2017


@marchof could you please review? If all fine, I'll squash and merge.


Godin commented Dec 26, 2017

@marchof could you please review? If all fine, I'll squash and merge.

@Godin Godin requested a review from marchof Dec 26, 2017



@Godin Godin added this to the 0.8.0 milestone Dec 28, 2017

@Godin Godin moved this from TODO to DONE in Java 9 Dec 28, 2017

@Godin Godin merged commit 7f7c246 into master Dec 28, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@Godin Godin deleted the issue-634 branch Dec 28, 2017

@jacoco jacoco locked as resolved and limited conversation to collaborators Jan 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.