Incorrect Generics signature for javax.persistence.criteria.CriteriaBuilder.SimpleCase<C, R>

Description

if the CriteriaBuilder's signature for selectCase is:

<C, R> SimpleCase<C, R> selectCase(Expression<? extends C> expression);

then the SimpleCase's methods must also be:

SimpleCase<C, R> when(Expression<? extends C> condition, R result);
SimpleCase<C, R> when(Expression<? extends C> condition, Expression<? extends R> result);

instead of what is currently exposed.

The code is otherwise correct as the following double cast does work:

final SimpleCase<Expression<Double>, Double> consumecase =
(SimpleCase<Expression<Double>, Double>) (Object) cb.selectCase(onTime);

Environment

None

Assignee

Unassigned

Reporter

Rodolfo Hansen

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Time tracking

1h

Affects versions

Priority

Critical
Configure