Simplify GenericConversionService.getMatchableConverters()
Closes gh-24403
This commit is contained in:
parent
a36168c972
commit
550f13e8ed
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -519,12 +519,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
|||
}
|
||||
|
||||
private ConvertersForPair getMatchableConverters(ConvertiblePair convertiblePair) {
|
||||
ConvertersForPair convertersForPair = this.converters.get(convertiblePair);
|
||||
if (convertersForPair == null) {
|
||||
convertersForPair = new ConvertersForPair();
|
||||
this.converters.put(convertiblePair, convertersForPair);
|
||||
}
|
||||
return convertersForPair;
|
||||
return this.converters.computeIfAbsent(convertiblePair, k -> new ConvertersForPair());
|
||||
}
|
||||
|
||||
public void remove(Class<?> sourceType, Class<?> targetType) {
|
||||
|
|
Loading…
Reference in New Issue