NullPointerException when using CriteriaBuilder.selectCase with CriteriaBuilder.equal

Description

Sample code:

It find that CriteriaBuilder.equal will throws NullPointerException, below is the stacktrace

After checking the source code, it suspected that there is a bug in

cause the selectCase.getJavaType() always return null.

The javaType override logic of SearchedCaseExpression actually do nothing:

I think it should call AbstractTupleElement.resetJavaType instead of adjustJavaType

Attachments

1

Activity

Show:

Vlad MihalceaApril 4, 2017 at 10:36 AM

Applied PR upstream after some minor modifications.

Paul NestFebruary 17, 2017 at 4:30 PM

I attached test case. Can you look at it?

Former userMay 16, 2016 at 11:59 PM

Please attach a runnable test case that reproduces your issue. See https://github.com/hibernate/hibernate-test-case-templates.

Fixed

Details

Assignee

Reporter

Labels

Original estimate

Time tracking

No time logged16h remaining

Components

Fix versions

Affects versions

Priority

Created May 5, 2016 at 9:28 AM
Updated April 14, 2017 at 10:13 AM
Resolved April 4, 2017 at 10:36 AM