Polishing

This commit is contained in:
Juergen Hoeller 2018-09-15 00:17:17 +02:00
parent db8e9eafb2
commit 8e83f140d4
2 changed files with 7 additions and 6 deletions

View File

@ -157,7 +157,7 @@ public interface ObjectProvider<T> extends ObjectFactory<T>, Iterable<T> {
* @see #orderedStream() * @see #orderedStream()
*/ */
default Stream<T> stream() { default Stream<T> stream() {
throw new UnsupportedOperationException("Multi-element access not supported"); throw new UnsupportedOperationException("Multi element access not supported");
} }
/** /**
@ -173,7 +173,7 @@ public interface ObjectProvider<T> extends ObjectFactory<T>, Iterable<T> {
* @see org.springframework.core.OrderComparator * @see org.springframework.core.OrderComparator
*/ */
default Stream<T> orderedStream() { default Stream<T> orderedStream() {
throw new UnsupportedOperationException("Multi-element access not supported"); throw new UnsupportedOperationException("Ordered element access not supported");
} }
} }

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.core.log; package org.springframework.core.log;
import java.util.function.Function; import java.util.function.Function;
@ -42,7 +43,7 @@ public final class LogFormatUtils {
* {@link CharSequence}, and possibly truncating at 100 if limitLength is * {@link CharSequence}, and possibly truncating at 100 if limitLength is
* set to true. * set to true.
* @param value the value to format * @param value the value to format
* @param limitLength whether to truncate large formatted values (over 100). * @param limitLength whether to truncate large formatted values (over 100)
* @return the formatted value * @return the formatted value
* @since 5.1 * @since 5.1
*/ */
@ -50,8 +51,8 @@ public final class LogFormatUtils {
if (value == null) { if (value == null) {
return ""; return "";
} }
String s = value instanceof CharSequence ? "\"" + value + "\"" : value.toString(); String s = (value instanceof CharSequence ? "\"" + value + "\"" : value.toString());
return limitLength && s.length() > 100 ? s.substring(0, 100) + " (truncated)..." : s; return (limitLength && s.length() > 100 ? s.substring(0, 100) + " (truncated)..." : s);
} }
/** /**
@ -70,7 +71,7 @@ public final class LogFormatUtils {
* </pre> * </pre>
* @param logger the logger to use to log the message * @param logger the logger to use to log the message
* @param messageFactory function that accepts a boolean set to the value * @param messageFactory function that accepts a boolean set to the value
* of {@link Log#isTraceEnabled()}. * of {@link Log#isTraceEnabled()}
*/ */
public static void traceDebug(Log logger, Function<Boolean, String> messageFactory) { public static void traceDebug(Log logger, Function<Boolean, String> messageFactory) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {