Skip to content

Class verification support for regulated constructor in Project Valhalla #18309

Closed
@hangshao0

Description

@hangshao0

In the latest JEP401, a "regulated" constructor is introduced:

The constructor of a value class is regulated, meaning that its body must not make any use of this, except to write to an instance field. This ensures a value object does not "escape" to the rest of the program during construction.

More details can be found in the JEP.

The regulated constructor will be represented by modifier 0x0800 in the class file.
Class format check should fail if a value class defines a non-regulated constructor. RT verification may need to be updated as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions