Skip to content

Add support for Java 28 preview feature: Value Classes and Objects (JEP 401) #2164

Description

@Godin

According to https://mail.openjdk.org/archives/list/[email protected]/thread/AIA3O3LHFZ6T7TIPH7KZT4WS4B6U72U5/#AIA3O3LHFZ6T7TIPH7KZT4WS4B6U72U5

Tentative schedule for integration is as follows:
...
Early July integration into OpenJDK mainline for JDK 28


https://gitlab.ow2.org/asm/asm/-/work_items/318046#note_122114

Java 28 is a bit special because it adds new features (see JEP 401),
it's more complex than just add a new version constant.
I have a huge patch to review.


Seems that some value classes can be supported even without ASM upgrade.

For example

value class C {
    public final int v;
    public C(int v) {
        this.v = v;  
    }
}

value record R(int x) {}

whereas not

public value class C {
    public final int v;
    public C(int v) {
        if (v < 0) {
            this.v = -v;
        } else {
            this.v = v;
        }
    }
}
Caused by: java.lang.IllegalArgumentException
	at org.jacoco.cli.internal.asm.ClassReader.readStackMapFrame(ClassReader.java:3364)
	at org.jacoco.cli.internal.asm.ClassReader.readCode(ClassReader.java:2087)
	at org.jacoco.cli.internal.asm.ClassReader.readMethod(ClassReader.java:1512)
	at org.jacoco.cli.internal.asm.ClassReader.accept(ClassReader.java:745)
	at org.jacoco.cli.internal.asm.ClassReader.accept(ClassReader.java:425)

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions