parent
c1ff812d84
commit
ced37d53b4
|
@ -148,6 +148,7 @@ class AopProxyUtilsTests {
|
|||
sealed interface SealedInterface {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
static final class SealedClass implements SealedInterface {
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ public class BeanUtilsBenchmark {
|
|||
return BeanUtils.instantiateClass(this.constructor, 1, "str");
|
||||
}
|
||||
|
||||
static class TestClass1{
|
||||
};
|
||||
static class TestClass1 {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
static class TestClass2 {
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.lang.reflect.AnnotatedElement;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.cache.interceptor.CacheEvictOperation;
|
||||
|
@ -49,14 +48,7 @@ import org.springframework.util.StringUtils;
|
|||
@SuppressWarnings("serial")
|
||||
public class SpringCacheAnnotationParser implements CacheAnnotationParser, Serializable {
|
||||
|
||||
private static final Set<Class<? extends Annotation>> CACHE_OPERATION_ANNOTATIONS = new LinkedHashSet<>(8);
|
||||
|
||||
static {
|
||||
CACHE_OPERATION_ANNOTATIONS.add(Cacheable.class);
|
||||
CACHE_OPERATION_ANNOTATIONS.add(CacheEvict.class);
|
||||
CACHE_OPERATION_ANNOTATIONS.add(CachePut.class);
|
||||
CACHE_OPERATION_ANNOTATIONS.add(Caching.class);
|
||||
}
|
||||
private static final Set<Class<? extends Annotation>> CACHE_OPERATION_ANNOTATIONS = Set.of(Cacheable.class, CacheEvict.class, CachePut.class, Caching.class);
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.springframework.aot.hint.ReflectionHints;
|
||||
|
@ -39,7 +38,7 @@ import org.springframework.util.ReflectionUtils;
|
|||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Andy Wilkinson
|
||||
* since 6.0
|
||||
* @since 6.0
|
||||
*/
|
||||
public class ReflectiveRuntimeHintsRegistrar {
|
||||
|
||||
|
@ -92,13 +91,13 @@ public class ReflectiveRuntimeHintsRegistrar {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Entry createEntry(AnnotatedElement element) {
|
||||
List<Class<? extends ReflectiveProcessor>> processorClasses =
|
||||
List<ReflectiveProcessor> processors =
|
||||
MergedAnnotations.from(element, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY)
|
||||
.stream(Reflective.class).flatMap(annotation -> Stream.of(annotation.getClassArray("value")))
|
||||
.map(type -> (Class<? extends ReflectiveProcessor>) type).collect(Collectors.toList());
|
||||
List<ReflectiveProcessor> processors = processorClasses.stream().distinct()
|
||||
.map(processorClass -> this.processors.computeIfAbsent(processorClass, this::instantiateClass))
|
||||
.toList();
|
||||
.map(type -> (Class<? extends ReflectiveProcessor>) type)
|
||||
.distinct()
|
||||
.map(processorClass -> this.processors.computeIfAbsent(processorClass, this::instantiateClass))
|
||||
.toList();
|
||||
ReflectiveProcessor processorToUse = (processors.size() == 1 ? processors.get(0)
|
||||
: new DelegateReflectiveProcessor(processors));
|
||||
return new Entry(element, processorToUse);
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.io.IOException;
|
|||
import java.lang.annotation.Annotation;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -195,7 +194,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
|
|||
delimiter, EMPTY_BYTES);
|
||||
|
||||
return (prefix.length > 0 ?
|
||||
bufferFactory.join(Arrays.asList(bufferFactory.wrap(prefix), dataBuffer)) :
|
||||
bufferFactory.join(List.of(bufferFactory.wrap(prefix), dataBuffer)) :
|
||||
dataBuffer);
|
||||
})
|
||||
.switchIfEmpty(Mono.fromCallable(() -> bufferFactory.wrap(helper.getPrefix())))
|
||||
|
|
Loading…
Reference in New Issue