This commit is contained in:
Lukas Eder 2025-08-29 13:15:25 +02:00
parent 14a4f1e84a
commit c2bb7ffde0

View File

@ -1652,6 +1652,14 @@ final class Tools {
return configuration(scope != null ? scope.configuration() : null);
}
/**
* Allows <code>null</code> arguments, unlike
* {@link ContextConverter#scoped(Converter)}.
*/
static final <T, U> ContextConverter<T, U> scoped(Converter<T, U> converter) {
return converter != null ? ContextConverter.scoped(converter) : null;
}
/**
* Get a converter from a {@link ConverterProvider} or <code>null</code> if
* no converter could be provided.
@ -1669,7 +1677,7 @@ final class Tools {
if (result == null && tType == Converters.UnknownType.class)
result = converter(configuration, instance, (Class<T>) (instance == null ? Object.class : instance.getClass()), uType);
return result == null ? null : scoped(result);
return scoped(result);
}
/**