Add missing @Nullable annotations on parameters
Issue: SPR-15540
This commit is contained in:
@@ -67,7 +67,7 @@ public class BeanMetadataAttributeAccessor extends AttributeAccessorSupport impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(String name, Object value) {
|
||||
public void setAttribute(String name, @Nullable Object value) {
|
||||
super.setAttribute(name, new BeanMetadataAttribute(name, value));
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCustomEditor(Class<?> requiredType, String propertyPath, PropertyEditor propertyEditor) {
|
||||
public void registerCustomEditor(@Nullable Class<?> requiredType, @Nullable String propertyPath, PropertyEditor propertyEditor) {
|
||||
if (requiredType == null && propertyPath == null) {
|
||||
throw new IllegalArgumentException("Either requiredType or propertyPath is required");
|
||||
}
|
||||
@@ -304,7 +304,8 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyEditor findCustomEditor(Class<?> requiredType, String propertyPath) {
|
||||
@Nullable
|
||||
public PropertyEditor findCustomEditor(@Nullable Class<?> requiredType, @Nullable String propertyPath) {
|
||||
Class<?> requiredTypeToUse = requiredType;
|
||||
if (propertyPath != null) {
|
||||
if (this.customEditorsForPath != null) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.lang.reflect.Field;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.convert.ConversionException;
|
||||
import org.springframework.core.convert.ConverterNotFoundException;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Base implementation of the {@link TypeConverter} interface, using a package-private delegate.
|
||||
@@ -36,25 +37,25 @@ public abstract class TypeConverterSupport extends PropertyEditorRegistrySupport
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T convertIfNecessary(Object value, Class<T> requiredType) throws TypeMismatchException {
|
||||
public <T> T convertIfNecessary(Object value, @Nullable Class<T> requiredType) throws TypeMismatchException {
|
||||
return doConvert(value, requiredType, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
|
||||
public <T> T convertIfNecessary(Object value, @Nullable Class<T> requiredType, @Nullable MethodParameter methodParam)
|
||||
throws TypeMismatchException {
|
||||
|
||||
return doConvert(value, requiredType, methodParam, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T convertIfNecessary(Object value, Class<T> requiredType, Field field)
|
||||
public <T> T convertIfNecessary(Object value, @Nullable Class<T> requiredType, @Nullable Field field)
|
||||
throws TypeMismatchException {
|
||||
|
||||
return doConvert(value, requiredType, null, field);
|
||||
}
|
||||
|
||||
private <T> T doConvert(Object value, Class<T> requiredType, MethodParameter methodParam, Field field)
|
||||
private <T> T doConvert(Object value, Class<T> requiredType, @Nullable MethodParameter methodParam, @Nullable Field field)
|
||||
throws TypeMismatchException {
|
||||
try {
|
||||
if (field != null) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
@@ -65,7 +66,7 @@ public class CustomAutowireConfigurer implements BeanFactoryPostProcessor, BeanC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public abstract class AbstractFactoryBean<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
@@ -86,7 +87,7 @@ public class CustomScopeConfigurer implements BeanFactoryPostProcessor, BeanClas
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.beans.factory.config;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.StringValueResolver;
|
||||
|
||||
/**
|
||||
@@ -47,7 +48,7 @@ public class EmbeddedValueResolver implements StringValueResolver {
|
||||
|
||||
|
||||
@Override
|
||||
public String resolveStringValue(String strVal) {
|
||||
public String resolveStringValue(@Nullable String strVal) {
|
||||
String value = this.exprContext.getBeanFactory().resolveEmbeddedValue(strVal);
|
||||
if (this.exprResolver != null && value != null) {
|
||||
Object evaluated = this.exprResolver.evaluate(value, this.exprContext);
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.BeanNameAware;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.FactoryBeanNotInitializedException;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -148,7 +149,7 @@ public class FieldRetrievingFactoryBean
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.support.ArgumentConvertingMethodInvoker;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
@@ -72,7 +73,7 @@ public class MethodInvokingBean extends ArgumentConvertingMethodInvoker
|
||||
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,8 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resolveStringValue(String strVal) throws BeansException {
|
||||
@Nullable
|
||||
public String resolveStringValue(@Nullable String strVal) throws BeansException {
|
||||
String resolved = this.helper.replacePlaceholders(strVal, this.resolver);
|
||||
if (trimValues) {
|
||||
resolved = resolved.trim();
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.beans.factory.parsing;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Simple implementation of {@link SourceExtractor} that returns {@code null}
|
||||
@@ -34,7 +35,8 @@ public class NullSourceExtractor implements SourceExtractor {
|
||||
* This implementation simply returns {@code null} for any input.
|
||||
*/
|
||||
@Override
|
||||
public Object extractSource(Object sourceCandidate, Resource definitionResource) {
|
||||
@Nullable
|
||||
public Object extractSource(Object sourceCandidate, @Nullable Resource definitionResource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.beans.factory.parsing;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Simple {@link SourceExtractor} implementation that just passes
|
||||
@@ -40,7 +41,7 @@ public class PassThroughSourceExtractor implements SourceExtractor {
|
||||
* @return the supplied {@code sourceCandidate}
|
||||
*/
|
||||
@Override
|
||||
public Object extractSource(Object sourceCandidate, Resource definingResource) {
|
||||
public Object extractSource(Object sourceCandidate, @Nullable Resource definingResource) {
|
||||
return sourceCandidate;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.ServiceLoader;
|
||||
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
@@ -54,7 +55,7 @@ public abstract class AbstractServiceLoaderBasedFactoryBean extends AbstractFact
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getBean(String name, Class<T> requiredType) throws BeansException {
|
||||
public <T> T getBean(String name, @Nullable Class<T> requiredType) throws BeansException {
|
||||
return doGetBean(name, requiredType, null, false);
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = (beanClassLoader != null ? beanClassLoader : ClassUtils.getDefaultClassLoader());
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.beans.factory.support;
|
||||
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.config.ConstructorArgumentValues;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
@@ -129,7 +130,7 @@ public class ChildBeanDefinition extends AbstractBeanDefinition {
|
||||
|
||||
|
||||
@Override
|
||||
public void setParentName(String parentName) {
|
||||
public void setParentName(@Nullable String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
|
||||
@@ -373,17 +373,17 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBeanNamesForType(ResolvableType type) {
|
||||
public String[] getBeanNamesForType(@Nullable ResolvableType type) {
|
||||
return doGetBeanNamesForType(type, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBeanNamesForType(Class<?> type) {
|
||||
public String[] getBeanNamesForType(@Nullable Class<?> type) {
|
||||
return getBeanNamesForType(type, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
|
||||
public String[] getBeanNamesForType(@Nullable Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
|
||||
if (!isConfigurationFrozen() || type == null || !allowEagerInit) {
|
||||
return doGetBeanNamesForType(ResolvableType.forRawClass(type), includeNonSingletons, allowEagerInit);
|
||||
}
|
||||
@@ -497,12 +497,12 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException {
|
||||
public <T> Map<String, T> getBeansOfType(@Nullable Class<T> type) throws BeansException {
|
||||
return getBeansOfType(type, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
|
||||
public <T> Map<String, T> getBeansOfType(@Nullable Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
|
||||
throws BeansException {
|
||||
|
||||
String[] beanNames = getBeanNamesForType(type, includeNonSingletons, allowEagerInit);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.beans.factory.support;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* GenericBeanDefinition is a one-stop shop for standard bean definition purposes.
|
||||
@@ -64,7 +65,7 @@ public class GenericBeanDefinition extends AbstractBeanDefinition {
|
||||
|
||||
|
||||
@Override
|
||||
public void setParentName(String parentName) {
|
||||
public void setParentName(@Nullable String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.beans.BeanMetadataElement;
|
||||
import org.springframework.beans.Mergeable;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Tag collection class used to hold managed List elements, which may
|
||||
@@ -91,7 +92,7 @@ public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetad
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<E> merge(Object parent) {
|
||||
public List<E> merge(@Nullable Object parent) {
|
||||
if (!this.mergeEnabled) {
|
||||
throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeanMetadataElement;
|
||||
import org.springframework.beans.Mergeable;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Tag collection class used to hold managed Map values, which may
|
||||
@@ -106,7 +107,7 @@ public class ManagedMap<K, V> extends LinkedHashMap<K, V> implements Mergeable,
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object merge(Object parent) {
|
||||
public Object merge(@Nullable Object parent) {
|
||||
if (!this.mergeEnabled) {
|
||||
throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'");
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Properties;
|
||||
|
||||
import org.springframework.beans.BeanMetadataElement;
|
||||
import org.springframework.beans.Mergeable;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Tag class which represents a Spring-managed {@link Properties} instance
|
||||
@@ -65,7 +66,7 @@ public class ManagedProperties extends Properties implements Mergeable, BeanMeta
|
||||
|
||||
|
||||
@Override
|
||||
public Object merge(Object parent) {
|
||||
public Object merge(@Nullable Object parent) {
|
||||
if (!this.mergeEnabled) {
|
||||
throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Set;
|
||||
|
||||
import org.springframework.beans.BeanMetadataElement;
|
||||
import org.springframework.beans.Mergeable;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Tag collection class used to hold managed Set values, which may
|
||||
@@ -90,7 +91,7 @@ public class ManagedSet<E> extends LinkedHashSet<E> implements Mergeable, BeanMe
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Set<E> merge(Object parent) {
|
||||
public Set<E> merge(@Nullable Object parent) {
|
||||
if (!this.mergeEnabled) {
|
||||
throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'");
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParentName(String parentName) {
|
||||
public void setParentName(@Nullable String parentName) {
|
||||
if (parentName != null) {
|
||||
throw new IllegalArgumentException("Root bean cannot be changed into a child bean with parent reference");
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
|
||||
|
||||
|
||||
@Override
|
||||
public Object instantiate(RootBeanDefinition bd, String beanName, BeanFactory owner) {
|
||||
public Object instantiate(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner) {
|
||||
// Don't override the class with CGLIB if no overrides.
|
||||
if (bd.getMethodOverrides().isEmpty()) {
|
||||
Constructor<?> constructorToUse;
|
||||
@@ -107,7 +107,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiate(RootBeanDefinition bd, String beanName, BeanFactory owner,
|
||||
public Object instantiate(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner,
|
||||
final Constructor<?> ctor, Object... args) {
|
||||
|
||||
if (bd.getMethodOverrides().isEmpty()) {
|
||||
@@ -141,8 +141,8 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiate(RootBeanDefinition bd, String beanName, BeanFactory owner,
|
||||
Object factoryBean, final Method factoryMethod, Object... args) {
|
||||
public Object instantiate(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner,
|
||||
@Nullable Object factoryBean, final Method factoryMethod, Object... args) {
|
||||
|
||||
try {
|
||||
if (System.getSecurityManager() != null) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
|
||||
import org.springframework.beans.factory.SmartFactoryBean;
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -132,7 +133,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getBean(String name, Class<T> requiredType) throws BeansException {
|
||||
public <T> T getBean(String name, @Nullable Class<T> requiredType) throws BeansException {
|
||||
Object bean = getBean(name);
|
||||
if (requiredType != null && !requiredType.isAssignableFrom(bean.getClass())) {
|
||||
throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
|
||||
@@ -247,7 +248,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBeanNamesForType(ResolvableType type) {
|
||||
public String[] getBeanNamesForType(@Nullable ResolvableType type) {
|
||||
boolean isFactoryType = false;
|
||||
if (type != null) {
|
||||
Class<?> resolved = type.resolve();
|
||||
@@ -275,23 +276,23 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBeanNamesForType(Class<?> type) {
|
||||
public String[] getBeanNamesForType(@Nullable Class<?> type) {
|
||||
return getBeanNamesForType(ResolvableType.forClass(type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
|
||||
public String[] getBeanNamesForType(@Nullable Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
|
||||
return getBeanNamesForType(ResolvableType.forClass(type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException {
|
||||
public <T> Map<String, T> getBeansOfType(@Nullable Class<T> type) throws BeansException {
|
||||
return getBeansOfType(type, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
|
||||
public <T> Map<String, T> getBeansOfType(@Nullable Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
|
||||
throws BeansException {
|
||||
|
||||
boolean isFactoryType = (type != null && FactoryBean.class.isAssignableFrom(type));
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -147,7 +148,7 @@ public abstract class AbstractBeanDefinitionParser implements BeanDefinitionPars
|
||||
* @see #parse(org.w3c.dom.Element, ParserContext)
|
||||
* @see #postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition)
|
||||
*/
|
||||
protected abstract AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext);
|
||||
protected abstract AbstractBeanDefinition parseInternal(@Nullable Element element, @Nullable ParserContext parserContext);
|
||||
|
||||
/**
|
||||
* Should an ID be generated instead of read from the passed in {@link Element}?
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class AbstractSingleBeanDefinitionParser extends AbstractBeanDef
|
||||
* @see #doParse
|
||||
*/
|
||||
@Override
|
||||
protected final AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
|
||||
protected final AbstractBeanDefinition parseInternal(@Nullable Element element, @Nullable ParserContext parserContext) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition();
|
||||
String parentName = getParentName(element);
|
||||
if (parentName != null) {
|
||||
|
||||
Reference in New Issue
Block a user