Optional and Type Annotations

Description

While playing around with Java 8 Optionals and validation I've encountered some cases I think the validation does not behave as intended.

It might be that this is related to the somewhat special meaning of an Optional, but the problem relies in such cases when I want to validate the container (the Optional) separate from the actual value. I've tried to use the new type annotations to do so.

So without further ado I redirect you to my branch containing the test cases showing what I think is not intended behavior. I've added a JavaDoc for the failing test cases.

If you want I can add a textual description for the failing test cases in this ticket, too.

Click here to see test cases concerning this ticket.

Environment

None

Assignee

Davide D'Alto

Reporter

Lukas Niemeier

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Minor
Configure