Skip to content

Commit 08b6daf

Browse files
committed
Polishing
1 parent 08ff3a8 commit 08b6daf

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

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

+17-15
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ protected Yaml createYaml() {
150150
private boolean process(MatchCallback callback, Yaml yaml, Resource resource) {
151151
int count = 0;
152152
try {
153-
if (this.logger.isDebugEnabled()) {
154-
this.logger.debug("Loading from YAML: " + resource);
153+
if (logger.isDebugEnabled()) {
154+
logger.debug("Loading from YAML: " + resource);
155155
}
156156
Reader reader = new UnicodeReader(resource.getInputStream());
157157
try {
@@ -163,8 +163,8 @@ private boolean process(MatchCallback callback, Yaml yaml, Resource resource) {
163163
}
164164
}
165165
}
166-
if (this.logger.isDebugEnabled()) {
167-
this.logger.debug("Loaded " + count + " document" + (count > 1 ? "s" : "") +
166+
if (logger.isDebugEnabled()) {
167+
logger.debug("Loaded " + count + " document" + (count > 1 ? "s" : "") +
168168
" from YAML resource: " + resource);
169169
}
170170
}
@@ -183,8 +183,8 @@ private void handleProcessError(Resource resource, IOException ex) {
183183
this.resolutionMethod != ResolutionMethod.OVERRIDE_AND_IGNORE) {
184184
throw new IllegalStateException(ex);
185185
}
186-
if (this.logger.isWarnEnabled()) {
187-
this.logger.warn("Could not load map from " + resource + ": " + ex.getMessage());
186+
if (logger.isWarnEnabled()) {
187+
logger.warn("Could not load map from " + resource + ": " + ex.getMessage());
188188
}
189189
}
190190

@@ -221,8 +221,8 @@ private boolean process(Map<String, Object> map, MatchCallback callback) {
221221
properties.putAll(getFlattenedMap(map));
222222

223223
if (this.documentMatchers.isEmpty()) {
224-
if (this.logger.isDebugEnabled()) {
225-
this.logger.debug("Merging document (no matchers set)" + map);
224+
if (logger.isDebugEnabled()) {
225+
logger.debug("Merging document (no matchers set): " + map);
226226
}
227227
callback.process(properties, map);
228228
return true;
@@ -233,23 +233,25 @@ private boolean process(Map<String, Object> map, MatchCallback callback) {
233233
MatchStatus match = matcher.matches(properties);
234234
result = MatchStatus.getMostSpecific(match, result);
235235
if (match == MatchStatus.FOUND) {
236-
if (this.logger.isDebugEnabled()) {
237-
this.logger.debug("Matched document with document matcher: " + properties);
236+
if (logger.isDebugEnabled()) {
237+
logger.debug("Matched document with document matcher: " + properties);
238238
}
239239
callback.process(properties, map);
240240
return true;
241241
}
242242
}
243243

244244
if (result == MatchStatus.ABSTAIN && this.matchDefault) {
245-
if (this.logger.isDebugEnabled()) {
246-
this.logger.debug("Matched document with default matcher: " + map);
245+
if (logger.isDebugEnabled()) {
246+
logger.debug("Matched document with default matcher: " + map);
247247
}
248248
callback.process(properties, map);
249249
return true;
250250
}
251251

252-
this.logger.debug("Unmatched document");
252+
if (logger.isDebugEnabled()) {
253+
logger.debug("Unmatched document: " + map);
254+
}
253255
return false;
254256
}
255257

@@ -300,7 +302,7 @@ else if (value instanceof Collection) {
300302
}
301303
}
302304
else {
303-
result.put(key, value == null ? "" : value);
305+
result.put(key, value != null ? value : "");
304306
}
305307
}
306308
}
@@ -328,7 +330,7 @@ public interface DocumentMatcher {
328330
/**
329331
* Test if the given properties match.
330332
* @param properties the properties to test
331-
* @return the status of the match.
333+
* @return the status of the match
332334
*/
333335
MatchStatus matches(Properties properties);
334336
}

spring-core/src/main/java/org/springframework/core/ResolvableType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ interface VariableResolver extends Serializable {
13681368
/**
13691369
* Resolve the specified variable.
13701370
* @param variable the variable to resolve
1371-
* @return the resolved variable or {@code null}
1371+
* @return the resolved variable, or {@code null} if not found
13721372
*/
13731373
ResolvableType resolveVariable(TypeVariable<?> variable);
13741374
}

0 commit comments

Comments
 (0)