Skip to content

Commit 7dc92aa

Browse files
committed
Polishing
1 parent 1956cb1 commit 7dc92aa

File tree

30 files changed

+82
-106
lines changed

30 files changed

+82
-106
lines changed

spring-beans/src/main/java/org/springframework/beans/PropertyValue.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -169,7 +169,7 @@ public synchronized boolean isConverted() {
169169
}
170170

171171
/**
172-
* Set the converted value of the constructor argument,
172+
* Set the converted value of this property value,
173173
* after processed type conversion.
174174
*/
175175
public synchronized void setConvertedValue(@Nullable Object value) {
@@ -178,7 +178,7 @@ public synchronized void setConvertedValue(@Nullable Object value) {
178178
}
179179

180180
/**
181-
* Return the converted value of the constructor argument,
181+
* Return the converted value of this property value,
182182
* after processed type conversion.
183183
*/
184184
@Nullable

spring-beans/src/main/java/org/springframework/beans/factory/InjectionPoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public boolean equals(Object other) {
180180
if (this == other) {
181181
return true;
182182
}
183-
if (getClass() != other.getClass()) {
183+
if (other == null || getClass() != other.getClass()) {
184184
return false;
185185
}
186186
InjectionPoint otherPoint = (InjectionPoint) other;

spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected void visitArray(Object[] arrayVal) {
234234
}
235235
}
236236

237-
@SuppressWarnings({"unchecked", "rawtypes"})
237+
@SuppressWarnings({"rawtypes", "unchecked"})
238238
protected void visitList(List listVal) {
239239
for (int i = 0; i < listVal.size(); i++) {
240240
Object elem = listVal.get(i);
@@ -245,7 +245,7 @@ protected void visitList(List listVal) {
245245
}
246246
}
247247

248-
@SuppressWarnings({"unchecked", "rawtypes"})
248+
@SuppressWarnings({"rawtypes", "unchecked"})
249249
protected void visitSet(Set setVal) {
250250
Set newContent = new LinkedHashSet();
251251
boolean entriesModified = false;
@@ -262,7 +262,7 @@ protected void visitSet(Set setVal) {
262262
}
263263
}
264264

265-
@SuppressWarnings({"unchecked", "rawtypes"})
265+
@SuppressWarnings({"rawtypes", "unchecked"})
266266
protected void visitMap(Map<?, ?> mapVal) {
267267
Map newContent = new LinkedHashMap();
268268
boolean entriesModified = false;

spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
* @author Rod Johnson
2727
* @author Juergen Hoeller
2828
* @see BeanDefinition#getPropertyValues()
29-
* @see org.springframework.beans.factory.BeanFactory#getBean
29+
* @see org.springframework.beans.factory.BeanFactory#getBean(String)
3030
*/
3131
public class RuntimeBeanReference implements BeanReference {
3232

@@ -39,9 +39,7 @@ public class RuntimeBeanReference implements BeanReference {
3939

4040

4141
/**
42-
* Create a new RuntimeBeanReference to the given bean name,
43-
* without explicitly marking it as reference to a bean in
44-
* the parent factory.
42+
* Create a new RuntimeBeanReference to the given bean name.
4543
* @param beanName name of the target bean
4644
*/
4745
public RuntimeBeanReference(String beanName) {
@@ -50,11 +48,10 @@ public RuntimeBeanReference(String beanName) {
5048

5149
/**
5250
* Create a new RuntimeBeanReference to the given bean name,
53-
* with the option to mark it as reference to a bean in
54-
* the parent factory.
51+
* with the option to mark it as reference to a bean in the parent factory.
5552
* @param beanName name of the target bean
56-
* @param toParent whether this is an explicit reference to
57-
* a bean in the parent factory
53+
* @param toParent whether this is an explicit reference to a bean in the
54+
* parent factory
5855
*/
5956
public RuntimeBeanReference(String beanName, boolean toParent) {
6057
Assert.hasText(beanName, "'beanName' must not be empty");
@@ -69,8 +66,7 @@ public String getBeanName() {
6966
}
7067

7168
/**
72-
* Return whether this is an explicit reference to a bean
73-
* in the parent factory.
69+
* Return whether this is an explicit reference to a bean in the parent factory.
7470
*/
7571
public boolean isToParent() {
7672
return this.toParent;

spring-beans/src/main/java/org/springframework/beans/factory/config/YamlMapFactoryBean.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -117,15 +117,15 @@ public Class<?> getObjectType() {
117117
* case of a shared singleton; else, on each {@link #getObject()} call.
118118
* <p>The default implementation returns the merged {@code Map} instance.
119119
* @return the object returned by this factory
120-
* @see #process(java.util.Map, MatchCallback)
120+
* @see #process(MatchCallback)
121121
*/
122122
protected Map<String, Object> createMap() {
123123
Map<String, Object> result = new LinkedHashMap<>();
124124
process((properties, map) -> merge(result, map));
125125
return result;
126126
}
127127

128-
@SuppressWarnings({"unchecked", "rawtypes"})
128+
@SuppressWarnings({"rawtypes", "unchecked"})
129129
private void merge(Map<String, Object> output, Map<String, Object> map) {
130130
map.forEach((key, value) -> {
131131
Object existing = output.get(key);

spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -128,7 +128,7 @@ public Class<?> getObjectType() {
128128
* <p>Invoked lazily the first time {@link #getObject()} is invoked in
129129
* case of a shared singleton; else, on each {@link #getObject()} call.
130130
* @return the object returned by this factory
131-
* @see #process(MatchCallback) ()
131+
* @see #process(MatchCallback)
132132
*/
133133
protected Properties createProperties() {
134134
Properties result = CollectionFactory.createStringAdaptingProperties();

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
6565
public static final String SCOPE_DEFAULT = "";
6666

6767
/**
68-
* Constant that indicates no autowiring at all.
68+
* Constant that indicates no external autowiring at all.
6969
* @see #setAutowireMode
7070
*/
7171
public static final int AUTOWIRE_NO = AutowireCapableBeanFactory.AUTOWIRE_NO;

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -1648,7 +1648,7 @@ protected Object getObjectForBeanInstance(
16481648
return beanInstance;
16491649
}
16501650
if (!(beanInstance instanceof FactoryBean)) {
1651-
throw new BeanIsNotAFactoryException(transformedBeanName(name), beanInstance.getClass());
1651+
throw new BeanIsNotAFactoryException(beanName, beanInstance.getClass());
16521652
}
16531653
}
16541654

spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -180,6 +180,8 @@ public BeanDefinitionBuilder setFactoryMethod(String factoryMethod) {
180180
/**
181181
* Set the name of a non-static factory method to use for this definition,
182182
* including the bean name of the factory instance to call the method on.
183+
* @param factoryMethod the name of the factory method
184+
* @param factoryBean the name of the bean to call the specified factory method on
183185
* @since 4.3.6
184186
*/
185187
public BeanDefinitionBuilder setFactoryMethodOnBean(String factoryMethod, String factoryBean) {
@@ -209,7 +211,7 @@ public BeanDefinitionBuilder addConstructorArgReference(String beanName) {
209211
}
210212

211213
/**
212-
* Add the supplied property value under the given name.
214+
* Add the supplied property value under the given property name.
213215
*/
214216
public BeanDefinitionBuilder addPropertyValue(String name, @Nullable Object value) {
215217
this.beanDefinition.getPropertyValues().add(name, value);

spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -385,8 +385,7 @@ private Object resolveReference(Object argName, RuntimeBeanReference ref) {
385385
private Object resolveManagedArray(Object argName, List<?> ml, Class<?> elementType) {
386386
Object resolved = Array.newInstance(elementType, ml.size());
387387
for (int i = 0; i < ml.size(); i++) {
388-
Array.set(resolved, i,
389-
resolveValueIfNecessary(new KeyedArgName(argName, i), ml.get(i)));
388+
Array.set(resolved, i, resolveValueIfNecessary(new KeyedArgName(argName, i), ml.get(i)));
390389
}
391390
return resolved;
392391
}
@@ -397,8 +396,7 @@ private Object resolveManagedArray(Object argName, List<?> ml, Class<?> elementT
397396
private List<?> resolveManagedList(Object argName, List<?> ml) {
398397
List<Object> resolved = new ArrayList<>(ml.size());
399398
for (int i = 0; i < ml.size(); i++) {
400-
resolved.add(
401-
resolveValueIfNecessary(new KeyedArgName(argName, i), ml.get(i)));
399+
resolved.add(resolveValueIfNecessary(new KeyedArgName(argName, i), ml.get(i)));
402400
}
403401
return resolved;
404402
}

0 commit comments

Comments
 (0)