Polishing (includes minor performance refinements from master)

This commit is contained in:
Juergen Hoeller
2019-04-26 16:51:18 +02:00
parent bdd9a557a5
commit e5e2d2d661
25 changed files with 170 additions and 174 deletions

View File

@@ -40,10 +40,10 @@ import org.springframework.util.MimeType;
*/
public abstract class AbstractDecoder<T> implements Decoder<T> {
protected Log logger = LogFactory.getLog(getClass());
private final List<MimeType> decodableMimeTypes;
protected Log logger = LogFactory.getLog(getClass());
protected AbstractDecoder(MimeType... supportedMimeTypes) {
this.decodableMimeTypes = Arrays.asList(supportedMimeTypes);

View File

@@ -36,10 +36,10 @@ import org.springframework.util.MimeType;
*/
public abstract class AbstractEncoder<T> implements Encoder<T> {
protected Log logger = LogFactory.getLog(getClass());
private final List<MimeType> encodableMimeTypes;
protected Log logger = LogFactory.getLog(getClass());
protected AbstractEncoder(MimeType... supportedMimeTypes) {
this.encodableMimeTypes = Arrays.asList(supportedMimeTypes);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,38 +63,43 @@ final class CompositeLog implements Log {
}
private static Log initLogger(List<Log> loggers, Predicate<Log> predicate) {
return loggers.stream().filter(predicate).findFirst().orElse(NO_OP_LOG);
for (Log logger : loggers) {
if (predicate.test(logger)) {
return logger;
}
}
return NO_OP_LOG;
}
@Override
public boolean isFatalEnabled() {
return this.fatalLogger != NO_OP_LOG;
return (this.fatalLogger != NO_OP_LOG);
}
@Override
public boolean isErrorEnabled() {
return this.errorLogger != NO_OP_LOG;
return (this.errorLogger != NO_OP_LOG);
}
@Override
public boolean isWarnEnabled() {
return this.warnLogger != NO_OP_LOG;
return (this.warnLogger != NO_OP_LOG);
}
@Override
public boolean isInfoEnabled() {
return this.infoLogger != NO_OP_LOG;
return (this.infoLogger != NO_OP_LOG);
}
@Override
public boolean isDebugEnabled() {
return this.debugLogger != NO_OP_LOG;
return (this.debugLogger != NO_OP_LOG);
}
@Override
public boolean isTraceEnabled() {
return this.traceLogger != NO_OP_LOG;
return (this.traceLogger != NO_OP_LOG);
}
@Override