NullPointerException when using case on select clause using JPA Criteria API

Description

I have a complex query created using JPA criteria API that worked on previous versions (tested on 5.3.7 and 5.2.15). It doesn't work on 5.4.0.

The query contains a select case statement inside the select clause, as this simplified example:

The example works when using HQL:

I've attached a simple test case.

Environment

None

Assignee

Guillaume Smet

Reporter

Ricardo de Souza Ribeiro

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.7

Components

Affects versions

Priority

Major
Configure