Skip to content

Commit 5759269

Browse files
committed
Polishing
1 parent e5d9378 commit 5759269

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,10 @@ public void addEmbeddedValueResolver(StringValueResolver valueResolver) {
746746
public String resolveEmbeddedValue(String value) {
747747
String result = value;
748748
for (StringValueResolver resolver : this.embeddedValueResolvers) {
749-
result = (result == null ? null : resolver.resolveStringValue(result));
749+
if (result == null) {
750+
return null;
751+
}
752+
result = resolver.resolveStringValue(result);
750753
}
751754
return result;
752755
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ else if (beanNames.length > 1) {
277277
for (String beanName : beanNames) {
278278
T beanInstance = getBean(beanName, requiredType);
279279
if (isPrimary(beanName, beanInstance)) {
280-
if(primaryBean != null) {
280+
if (primaryBean != null) {
281281
throw new NoUniqueBeanDefinitionException(requiredType, beanNames.length,
282282
"more than one 'primary' bean found of required type: " + Arrays.asList(beanNames));
283283
}
284284
primaryBean = beanInstance;
285285
}
286286
}
287-
if(primaryBean != null) {
287+
if (primaryBean != null) {
288288
return primaryBean;
289289
}
290290
throw new NoUniqueBeanDefinitionException(requiredType, beanNames);

spring-core/src/main/java/org/springframework/core/env/PropertiesPropertySource.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -31,13 +31,12 @@
3131
*
3232
* @author Chris Beams
3333
* @since 3.1
34-
* @see org.springframework.mock.env.MockPropertySource
3534
*/
3635
public class PropertiesPropertySource extends MapPropertySource {
3736

3837
@SuppressWarnings({ "unchecked", "rawtypes" })
3938
public PropertiesPropertySource(String name, Properties source) {
40-
super(name, (Map)source);
39+
super(name, (Map) source);
4140
}
4241

4342
}

0 commit comments

Comments
 (0)