This fixes TransformationServicesHandler.alternate no using the second function if both are nonnull.
Before the first Optional.ofNullable() would return an Optional<Optional<R>> and as it's an optional, it should not be null and thus the orElseGet() will always return the value of the first function as an Optional and never the value from the supplier using the second function.
Optional doesn't check if there is any nested optional and that they are empty, they only check if the value is null or not.
@cpw This is a probably the fix to the current issue in #31 not calling the name -> URL resolver.
Heh. that probably explains it. Got my optionals confused with my optionals, and put optionals inside my optionals instead of putting optionals around my optionals.
This fixes
TransformationServicesHandler.alternate
no using thesecond
function if both are nonnull.Before the first
Optional.ofNullable()
would return anOptional<Optional<R>>
and as it's an optional, it should not be null and thus theorElseGet()
will always return the value of thefirst
function as an Optional and never the value from the supplier using thesecond
function. Optional doesn't check if there is any nested optional and that they are empty, they only check if the value isnull
or not.@cpw This is a probably the fix to the current issue in #31 not calling the
name -> URL
resolver.