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

ASM 8.0 does not preserve empty Record attribute in absence of record components #1037

Closed
Godin opened this issue Mar 31, 2020 · 0 comments · Fixed by #1043
Closed

ASM 8.0 does not preserve empty Record attribute in absence of record components #1037

Godin opened this issue Mar 31, 2020 · 0 comments · Fixed by #1043
Assignees
Labels
component: core type: bug 🐛 Something isn't working
Milestone

Comments

@Godin
Copy link
Member

Godin commented Mar 31, 2020

For following Example.java

record Example() {
    public static void main(String[] args) {
        System.out.println(Example.class.isRecord());
        System.out.println(Example.class.getRecordComponents().length);
    }
}

execution of

javac --release 14 --enable-preview Example.java
java -javaagent:jacocoagent.jar --enable-preview Example

using JaCoCo 0.8.5 prints

true
0

while using JaCoCo 0.8.6-SNAPSHOT

false
Exception in thread "main" java.lang.NullPointerException
        at Example.main(Example.java:4)

Class file instrumented by 0.8.5 contains empty Record attribute, while class file instrumented by 0.8.6-SNAPSHOT does not - see output of

java -jar jacoco-0.8.5/lib/jacococli.jar instrument Example.class --dest before
java -jar jacoco-0.8.6-20200329.124051-45/lib/jacococli.jar instrument Example.class --dest after
javap -v -p before/Example.class > before.txt
javap -v -p after/Example.class > after.txt
diff before.txt after.txt

This regression was introduced by the upgrade of ASM to 8.0 (#1032) - see https://mail.ow2.org/wws/arc/asm/2020-03/msg00001.html

@Godin Godin added the type: bug 🐛 Something isn't working label Mar 31, 2020
@Godin Godin added this to the 0.8.6 milestone Mar 31, 2020
@Godin Godin self-assigned this Mar 31, 2020
@Godin Godin added this to Candidates in Current work items via automation Mar 31, 2020
Current work items automation moved this from Candidates to Done Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core type: bug 🐛 Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

1 participant