On JDK 21-ea+21, projection constructors relying on canonical record constructor result in all-null records

Description

It seems parameters of record canonical constructors are considired implicit (Parameter#isImplicit returns true) starting with JDK 21-ea+21, which causes this check to incorrectly assume these constructor parameters are for the surrounding instance in nested classes, leading to all parameters being set to null when projecting.

See also: https://ci.hibernate.org/job/hibernate-search/job/main/666/

14:09:20,303 (main) DEBUG PojoSearchQueryElementRegistryBuilder:89 - HSEARCH700117: Constructor projection for type 'org.hibernate.search.integrationtest.mapper.pojo.mapping.definition.ProjectionConstructorRecordIT$2MyProjection': valueCreateHandle: MethodHandleValueCreateHandle[public org.hibernate.search.integrationtest.mapper.pojo.mapping.definition.ProjectionConstructorRecordIT$2MyProjection(java.lang.String,java.lang.Integer)] innerDefinitions: - <null projection> - <null projection>

Activity

Show:
Fixed

Details

Assignee

Reporter

Sprint

Fix versions

Priority

Created May 11, 2023 at 12:08 PM
Updated June 2, 2023 at 1:33 PM
Resolved May 11, 2023 at 5:46 PM