parent
b9c304b890
commit
644887e094
|
|
@ -25,6 +25,7 @@ import java.util.Collections;
|
|||
import java.util.Comparator;
|
||||
import java.util.Deque;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
|
|
@ -494,12 +495,11 @@ class ConfigurationClassParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns {@code @Import} class, considering all meta-annotations.
|
||||
* Returns {@code @Import} classes, considering all meta-annotations.
|
||||
*/
|
||||
private Set<SourceClass> getImports(SourceClass sourceClass) throws IOException {
|
||||
Set<SourceClass> imports = new LinkedHashSet<>();
|
||||
Set<SourceClass> visited = new LinkedHashSet<>();
|
||||
collectImports(sourceClass, imports, visited);
|
||||
collectImports(sourceClass, imports, new HashSet<>());
|
||||
return imports;
|
||||
}
|
||||
|
||||
|
|
@ -1038,7 +1038,7 @@ class ConfigurationClassParser {
|
|||
return Collections.emptySet();
|
||||
}
|
||||
String[] classNames = (String[]) annotationAttributes.get(attribute);
|
||||
Set<SourceClass> result = new LinkedHashSet<>();
|
||||
Set<SourceClass> result = CollectionUtils.newLinkedHashSet(classNames.length);
|
||||
for (String className : classNames) {
|
||||
result.add(getRelated(className));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
|
|
@ -36,6 +36,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
|||
import org.springframework.context.annotation.ImportRuntimeHints;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* {@link BeanFactoryInitializationAotProcessor} implementation that processes
|
||||
|
|
@ -76,8 +77,9 @@ class RuntimeHintsBeanFactoryInitializationAotProcessor implements BeanFactoryIn
|
|||
private Set<Class<? extends RuntimeHintsRegistrar>> extractFromBeanDefinition(String beanName,
|
||||
ImportRuntimeHints annotation) {
|
||||
|
||||
Set<Class<? extends RuntimeHintsRegistrar>> registrars = new LinkedHashSet<>();
|
||||
for (Class<? extends RuntimeHintsRegistrar> registrarClass : annotation.value()) {
|
||||
Class<? extends RuntimeHintsRegistrar>[] registrarClasses = annotation.value();
|
||||
Set<Class<? extends RuntimeHintsRegistrar>> registrars = CollectionUtils.newLinkedHashSet(registrarClasses.length);
|
||||
for (Class<? extends RuntimeHintsRegistrar> registrarClass : registrarClasses) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace(LogMessage.format("Loaded [%s] registrar from annotated bean [%s]",
|
||||
registrarClass.getCanonicalName(), beanName));
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.RecordComponent;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
|
@ -63,7 +64,7 @@ public class BindingReflectionHintsRegistrar {
|
|||
* @param types the types to register
|
||||
*/
|
||||
public void registerReflectionHints(ReflectionHints hints, Type... types) {
|
||||
Set<Type> seen = new LinkedHashSet<>();
|
||||
Set<Type> seen = new HashSet<>();
|
||||
for (Type type : types) {
|
||||
registerReflectionHints(hints, seen, type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import java.io.IOException;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -46,6 +45,7 @@ import org.springframework.core.type.filter.AnnotationTypeFilter;
|
|||
import org.springframework.core.type.filter.TypeFilter;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +66,7 @@ public final class PersistenceManagedTypesScanner {
|
|||
private static final boolean shouldIgnoreClassFormatException =
|
||||
SpringProperties.getFlag(IGNORE_CLASSFORMAT_PROPERTY_NAME);
|
||||
|
||||
private static final Set<AnnotationTypeFilter> entityTypeFilters = new LinkedHashSet<>(4);
|
||||
private static final Set<AnnotationTypeFilter> entityTypeFilters = CollectionUtils.newLinkedHashSet(4);
|
||||
|
||||
static {
|
||||
entityTypeFilters.add(new AnnotationTypeFilter(Entity.class, false));
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class MockServletContext implements ServletContext {
|
|||
|
||||
private static final String TEMP_DIR_SYSTEM_PROPERTY = "java.io.tmpdir";
|
||||
|
||||
private static final Set<SessionTrackingMode> DEFAULT_SESSION_TRACKING_MODES = new LinkedHashSet<>(4);
|
||||
private static final Set<SessionTrackingMode> DEFAULT_SESSION_TRACKING_MODES = CollectionUtils.newLinkedHashSet(3);
|
||||
|
||||
static {
|
||||
DEFAULT_SESSION_TRACKING_MODES.add(SessionTrackingMode.COOKIE);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
|
|
@ -20,7 +20,6 @@ import java.lang.reflect.Constructor;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -29,6 +28,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -92,7 +92,7 @@ public class TestContextManager {
|
|||
|
||||
private static final Log logger = LogFactory.getLog(TestContextManager.class);
|
||||
|
||||
private static final Set<Class<? extends Throwable>> skippedExceptionTypes = new LinkedHashSet<>(4);
|
||||
private static final Set<Class<? extends Throwable>> skippedExceptionTypes = CollectionUtils.newLinkedHashSet(3);
|
||||
|
||||
static {
|
||||
// JUnit Jupiter
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class MockServletContext implements ServletContext {
|
|||
|
||||
private static final String TEMP_DIR_SYSTEM_PROPERTY = "java.io.tmpdir";
|
||||
|
||||
private static final Set<SessionTrackingMode> DEFAULT_SESSION_TRACKING_MODES = new LinkedHashSet<>(4);
|
||||
private static final Set<SessionTrackingMode> DEFAULT_SESSION_TRACKING_MODES = CollectionUtils.newLinkedHashSet(3);
|
||||
|
||||
static {
|
||||
DEFAULT_SESSION_TRACKING_MODES.add(SessionTrackingMode.COOKIE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue