From 24c15f515691053dd2347cf92ac69b799b0394ad Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 3 Oct 2023 10:51:40 +0200 Subject: [PATCH] Specify behavior for records and sealed types Records and sealed types are valid bean types, but they are unproxyable. --- spec/src/main/asciidoc/core/definition.asciidoc | 2 +- spec/src/main/asciidoc/core/implementation.asciidoc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/src/main/asciidoc/core/definition.asciidoc b/spec/src/main/asciidoc/core/definition.asciidoc index 108028cd..47708466 100644 --- a/spec/src/main/asciidoc/core/definition.asciidoc +++ b/spec/src/main/asciidoc/core/definition.asciidoc @@ -81,7 +81,7 @@ The bean types of a bean are used by the rules of typesafe resolution defined in Almost any Java type may be a bean type of a bean: -* A bean type may be an interface, a concrete class or an abstract class, and may be declared final or have final methods. +* A bean type may be an interface, a concrete class or an abstract class or a record, may be declared sealed or non-sealed or final, and may have final methods. * A bean type may be a parameterized type with actual type parameters and type variables. * A bean type may be an array type. Two array types are considered identical only if the element type is identical. diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc index 4b41305b..1ae0e34c 100644 --- a/spec/src/main/asciidoc/core/implementation.asciidoc +++ b/spec/src/main/asciidoc/core/implementation.asciidoc @@ -662,6 +662,8 @@ Certain legal bean types cannot be proxied by the container: * classes which don't have a non-private constructor with no parameters, * classes which are declared final, * classes which have non-static, final methods with public, protected or default visibility, +* records, +* sealed classes and sealed interfaces, * primitive types, * and array types.