diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java b/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java
index e64227fdd353..d921a33ada7e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -169,7 +169,7 @@ public synchronized boolean isConverted() {
}
/**
- * Set the converted value of the constructor argument,
+ * Set the converted value of this property value,
* after processed type conversion.
*/
public synchronized void setConvertedValue(@Nullable Object value) {
@@ -178,7 +178,7 @@ public synchronized void setConvertedValue(@Nullable Object value) {
}
/**
- * Return the converted value of the constructor argument,
+ * Return the converted value of this property value,
* after processed type conversion.
*/
@Nullable
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/InjectionPoint.java b/spring-beans/src/main/java/org/springframework/beans/factory/InjectionPoint.java
index 39497f5f07ff..744168742207 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/InjectionPoint.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/InjectionPoint.java
@@ -180,7 +180,7 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
- if (getClass() != other.getClass()) {
+ if (other == null || getClass() != other.getClass()) {
return false;
}
InjectionPoint otherPoint = (InjectionPoint) other;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java
index 6e71a0572e5e..a0fae36c9b74 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java
@@ -234,7 +234,7 @@ protected void visitArray(Object[] arrayVal) {
}
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"rawtypes", "unchecked"})
protected void visitList(List listVal) {
for (int i = 0; i < listVal.size(); i++) {
Object elem = listVal.get(i);
@@ -245,7 +245,7 @@ protected void visitList(List listVal) {
}
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"rawtypes", "unchecked"})
protected void visitSet(Set setVal) {
Set newContent = new LinkedHashSet();
boolean entriesModified = false;
@@ -262,7 +262,7 @@ protected void visitSet(Set setVal) {
}
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"rawtypes", "unchecked"})
protected void visitMap(Map, ?> mapVal) {
Map newContent = new LinkedHashMap();
boolean entriesModified = false;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
index 2f685984fbc6..ec8aa5c140ea 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -26,7 +26,7 @@
* @author Rod Johnson
* @author Juergen Hoeller
* @see BeanDefinition#getPropertyValues()
- * @see org.springframework.beans.factory.BeanFactory#getBean
+ * @see org.springframework.beans.factory.BeanFactory#getBean(String)
*/
public class RuntimeBeanReference implements BeanReference {
@@ -39,9 +39,7 @@ public class RuntimeBeanReference implements BeanReference {
/**
- * Create a new RuntimeBeanReference to the given bean name,
- * without explicitly marking it as reference to a bean in
- * the parent factory.
+ * Create a new RuntimeBeanReference to the given bean name.
* @param beanName name of the target bean
*/
public RuntimeBeanReference(String beanName) {
@@ -50,11 +48,10 @@ public RuntimeBeanReference(String beanName) {
/**
* Create a new RuntimeBeanReference to the given bean name,
- * with the option to mark it as reference to a bean in
- * the parent factory.
+ * with the option to mark it as reference to a bean in the parent factory.
* @param beanName name of the target bean
- * @param toParent whether this is an explicit reference to
- * a bean in the parent factory
+ * @param toParent whether this is an explicit reference to a bean in the
+ * parent factory
*/
public RuntimeBeanReference(String beanName, boolean toParent) {
Assert.hasText(beanName, "'beanName' must not be empty");
@@ -69,8 +66,7 @@ public String getBeanName() {
}
/**
- * Return whether this is an explicit reference to a bean
- * in the parent factory.
+ * Return whether this is an explicit reference to a bean in the parent factory.
*/
public boolean isToParent() {
return this.toParent;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java
index 1e20063cccfb..bc77a9f7c134 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -117,7 +117,7 @@ public Class> getObjectType() {
* case of a shared singleton; else, on each {@link #getObject()} call.
*
The default implementation returns the merged {@code Map} instance.
* @return the object returned by this factory
- * @see #process(java.util.Map, MatchCallback)
+ * @see #process(MatchCallback)
*/
protected Map createMap() {
Map result = new LinkedHashMap<>();
@@ -125,7 +125,7 @@ protected Map createMap() {
return result;
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"rawtypes", "unchecked"})
private void merge(Map output, Map map) {
map.forEach((key, value) -> {
Object existing = output.get(key);
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java
index 200f78c4c9f4..71088f17f09c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -128,7 +128,7 @@ public Class> getObjectType() {
*
Invoked lazily the first time {@link #getObject()} is invoked in
* case of a shared singleton; else, on each {@link #getObject()} call.
* @return the object returned by this factory
- * @see #process(MatchCallback) ()
+ * @see #process(MatchCallback)
*/
protected Properties createProperties() {
Properties result = CollectionFactory.createStringAdaptingProperties();
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
index f28218afd8a0..4a10cdb15552 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
@@ -65,7 +65,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
public static final String SCOPE_DEFAULT = "";
/**
- * Constant that indicates no autowiring at all.
+ * Constant that indicates no external autowiring at all.
* @see #setAutowireMode
*/
public static final int AUTOWIRE_NO = AutowireCapableBeanFactory.AUTOWIRE_NO;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
index 640e712e8947..e6fcceb9e494 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -1648,7 +1648,7 @@ protected Object getObjectForBeanInstance(
return beanInstance;
}
if (!(beanInstance instanceof FactoryBean)) {
- throw new BeanIsNotAFactoryException(transformedBeanName(name), beanInstance.getClass());
+ throw new BeanIsNotAFactoryException(beanName, beanInstance.getClass());
}
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
index 2b04fb155e82..cfddff43e091 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -180,6 +180,8 @@ public BeanDefinitionBuilder setFactoryMethod(String factoryMethod) {
/**
* Set the name of a non-static factory method to use for this definition,
* including the bean name of the factory instance to call the method on.
+ * @param factoryMethod the name of the factory method
+ * @param factoryBean the name of the bean to call the specified factory method on
* @since 4.3.6
*/
public BeanDefinitionBuilder setFactoryMethodOnBean(String factoryMethod, String factoryBean) {
@@ -209,7 +211,7 @@ public BeanDefinitionBuilder addConstructorArgReference(String beanName) {
}
/**
- * Add the supplied property value under the given name.
+ * Add the supplied property value under the given property name.
*/
public BeanDefinitionBuilder addPropertyValue(String name, @Nullable Object value) {
this.beanDefinition.getPropertyValues().add(name, value);
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java
index 776a610ea05f..e3e778010505 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -385,8 +385,7 @@ private Object resolveReference(Object argName, RuntimeBeanReference ref) {
private Object resolveManagedArray(Object argName, List> ml, Class> elementType) {
Object resolved = Array.newInstance(elementType, ml.size());
for (int i = 0; i < ml.size(); i++) {
- Array.set(resolved, i,
- resolveValueIfNecessary(new KeyedArgName(argName, i), ml.get(i)));
+ Array.set(resolved, i, resolveValueIfNecessary(new KeyedArgName(argName, i), ml.get(i)));
}
return resolved;
}
@@ -397,8 +396,7 @@ private Object resolveManagedArray(Object argName, List> ml, Class> elementT
private List> resolveManagedList(Object argName, List> ml) {
List