Browse Source

Polish: do simple clean-up

pull/22545/head
stsypanov 6 years ago committed by Juergen Hoeller
parent
commit
60b72d721d
  1. 6
      spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java
  2. 2
      spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
  3. 2
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompDecoder.java

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

@ -156,8 +156,7 @@ public abstract class YamlProcessor { @@ -156,8 +156,7 @@ public abstract class YamlProcessor {
if (logger.isDebugEnabled()) {
logger.debug("Loading from YAML: " + resource);
}
Reader reader = new UnicodeReader(resource.getInputStream());
try {
try (Reader reader = new UnicodeReader(resource.getInputStream())) {
for (Object object : yaml.loadAll(reader)) {
if (object != null && process(asMap(object), callback)) {
count++;
@ -171,9 +170,6 @@ public abstract class YamlProcessor { @@ -171,9 +170,6 @@ public abstract class YamlProcessor {
" from YAML resource: " + resource);
}
}
finally {
reader.close();
}
}
catch (IOException ex) {
handleProcessError(resource, ex);

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

@ -663,7 +663,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess @@ -663,7 +663,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Return whether this bean has the specified qualifier.
*/
public boolean hasQualifier(String typeName) {
return this.qualifiers.keySet().contains(typeName);
return this.qualifiers.containsKey(typeName);
}
/**

2
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompDecoder.java

@ -267,7 +267,7 @@ public class StompDecoder { @@ -267,7 +267,7 @@ public class StompDecoder {
if (index + 1 >= inString.length()) {
throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
}
Character c = inString.charAt(index + 1);
char c = inString.charAt(index + 1);
if (c == 'r') {
sb.append('\r');
}

Loading…
Cancel
Save