Skip to content
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

Add support for Java 11 and 12 class files with "preview features" #743

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

Godin
Copy link
Member

@Godin Godin commented Aug 18, 2018

See JEP 12 (Preview Language and VM Features). I'm not aware of any preview features for JDK 11, however --enable-preview flag is available in JDK 11 EA. And as of today there is at least one preview feature scheduled for JDK 12 - JEP 325 (Switch Expressions).


Before this change:

$ cat <<END > Example.java
class Example {
  public static void main(String[] args) {
  }
}
END

$ javac --enable-preview --release 12 Example.java

$ java --enable-preview -javaagent:before/lib/jacocoagent.jar Example

$ java -jar before/lib/jacococli.jar execinfo jacoco.exec            
[INFO] Loading exec file jacoco.exec.
CLASS ID         HITS/PROBES   CLASS NAME
Session "godin-laptop2-5141427c": Sat Aug 18 23:39:49 CEST 2018 - Sat Aug 18 23:39:49 CEST 2018
4091363f4c5d7293    1 of   2   Example

$ java -jar before/lib/jacococli.jar report jacoco.exec --classfiles Example.class
[INFO] Loading execution data file /tmp/jacoco/jacoco.exec.
[INFO] Analyzing 0 classes.

After this change:

$ java -jar after/lib/jacococli.jar report jacoco.exec --classfiles Example.class
[INFO] Loading execution data file /tmp/jacoco/jacoco.exec.
[INFO] Analyzing 1 classes.

@Godin Godin added this to the 0.8.2 milestone Aug 18, 2018
@Godin Godin self-assigned this Aug 18, 2018
@Godin Godin added this to Review in Current work items via automation Aug 18, 2018
@Godin Godin requested a review from marchof August 18, 2018 22:08
@Godin Godin changed the title Add support for Java 11 and 12 class files compiled with --enable-preview Add support for Java 11 and 12 class files with "preview features" Aug 18, 2018
(GitHub <a href="https://github.com/jacoco/jacoco/issues/719">#719</a>).</li>
<li>Experimental support for Java 12 class files
(GitHub <a href="https://github.com/jacoco/jacoco/issues/738">#738</a>).</li>
<li>Experimental support for Java 11 and Java 12 class files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "... including JEP 12 preview versions"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marchof added

, including JEP 12 "preview features"

@marchof marchof merged commit 6bbb012 into jacoco:master Aug 20, 2018
Current work items automation moved this from Review to Done Aug 20, 2018
@Godin Godin deleted the jep12 branch August 20, 2018 11:10
@jacoco jacoco locked as resolved and limited conversation to collaborators Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants