@@ -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 }
0 commit comments