Skip to content

Commit 64ce8a8

Browse files
committed
Polishing
1 parent 8a69159 commit 64ce8a8

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

spring-context/src/test/java/org/springframework/jmx/export/annotation/EnableMBeanExportConfigurationTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -73,7 +73,8 @@ public void testOnlyTargetClassIsExposed() throws Exception {
7373
ObjectName oname = ObjectNameManager.getInstance("bean:name=testBean4");
7474
assertNotNull(server.getObjectInstance(oname));
7575
assertEquals("TEST", server.getAttribute(oname, "Name"));
76-
} finally {
76+
}
77+
finally {
7778
ctx.close();
7879
}
7980
}
@@ -142,7 +143,8 @@ public void testComponentScan() throws Exception {
142143
assertNotNull(server.getObjectInstance(oname));
143144
String name = (String) server.getAttribute(oname, "Name");
144145
assertNull(name);
145-
} finally {
146+
}
147+
finally {
146148
ctx.close();
147149
}
148150
}

spring-core/src/main/java/org/springframework/core/convert/support/EnumToStringConverter.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -23,8 +23,9 @@
2323
import org.springframework.util.ClassUtils;
2424

2525
/**
26-
* Calls {@link Enum#name()} to convert a source Enum to a String. This converter will
27-
* not match enums with interfaces that can be converterd.
26+
* Calls {@link Enum#name()} to convert a source Enum to a String.
27+
* This converter will not match enums with interfaces that can be converted.
28+
*
2829
* @author Keith Donald
2930
* @author Phillip Webb
3031
* @since 3.0
@@ -33,14 +34,16 @@ final class EnumToStringConverter implements Converter<Enum<?>, String>, Conditi
3334

3435
private final ConversionService conversionService;
3536

37+
3638
public EnumToStringConverter(ConversionService conversionService) {
3739
this.conversionService = conversionService;
3840
}
3941

42+
4043
@Override
4144
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
4245
for (Class<?> interfaceType : ClassUtils.getAllInterfacesForClass(sourceType.getType())) {
43-
if (conversionService.canConvert(TypeDescriptor.valueOf(interfaceType), targetType)) {
46+
if (this.conversionService.canConvert(TypeDescriptor.valueOf(interfaceType), targetType)) {
4447
return false;
4548
}
4649
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -80,8 +80,8 @@ protected <T> T getProperty(String key, Class<T> targetValueType, boolean resolv
8080
if (debugEnabled) {
8181
logger.debug(String.format("Searching for key '%s' in [%s]", key, propertySource.getName()));
8282
}
83-
Object value;
84-
if ((value = propertySource.getProperty(key)) != null) {
83+
Object value = propertySource.getProperty(key);
84+
if (value != null) {
8585
Class<?> valueType = value.getClass();
8686
if (resolveNestedPlaceholders && value instanceof String) {
8787
value = resolveNestedPlaceholders((String) value);

0 commit comments

Comments
 (0)