Skip to content

Commit 60b72d7

Browse files
stsypanovjhoeller
authored andcommitted
Polish: do simple clean-up
1 parent cb4d6f0 commit 60b72d7

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ private boolean process(MatchCallback callback, Yaml yaml, Resource resource) {
156156
if (logger.isDebugEnabled()) {
157157
logger.debug("Loading from YAML: " + resource);
158158
}
159-
Reader reader = new UnicodeReader(resource.getInputStream());
160-
try {
159+
try (Reader reader = new UnicodeReader(resource.getInputStream())) {
161160
for (Object object : yaml.loadAll(reader)) {
162161
if (object != null && process(asMap(object), callback)) {
163162
count++;
@@ -171,9 +170,6 @@ private boolean process(MatchCallback callback, Yaml yaml, Resource resource) {
171170
" from YAML resource: " + resource);
172171
}
173172
}
174-
finally {
175-
reader.close();
176-
}
177173
}
178174
catch (IOException ex) {
179175
handleProcessError(resource, ex);

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
@@ -663,7 +663,7 @@ public void addQualifier(AutowireCandidateQualifier qualifier) {
663663
* Return whether this bean has the specified qualifier.
664664
*/
665665
public boolean hasQualifier(String typeName) {
666-
return this.qualifiers.keySet().contains(typeName);
666+
return this.qualifiers.containsKey(typeName);
667667
}
668668

669669
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private String unescape(String inString) {
267267
if (index + 1 >= inString.length()) {
268268
throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
269269
}
270-
Character c = inString.charAt(index + 1);
270+
char c = inString.charAt(index + 1);
271271
if (c == 'r') {
272272
sb.append('\r');
273273
}

0 commit comments

Comments
 (0)