From 8e83f140d43b5dd6552d6c0b83d0ba3a3824c580 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 15 Sep 2018 00:17:17 +0200 Subject: [PATCH] Polishing --- .../springframework/beans/factory/ObjectProvider.java | 4 ++-- .../org/springframework/core/log/LogFormatUtils.java | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java index 166c06de48..eb480c44c8 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java @@ -157,7 +157,7 @@ public interface ObjectProvider extends ObjectFactory, Iterable { * @see #orderedStream() */ default Stream stream() { - throw new UnsupportedOperationException("Multi-element access not supported"); + throw new UnsupportedOperationException("Multi element access not supported"); } /** @@ -173,7 +173,7 @@ public interface ObjectProvider extends ObjectFactory, Iterable { * @see org.springframework.core.OrderComparator */ default Stream orderedStream() { - throw new UnsupportedOperationException("Multi-element access not supported"); + throw new UnsupportedOperationException("Ordered element access not supported"); } } diff --git a/spring-core/src/main/java/org/springframework/core/log/LogFormatUtils.java b/spring-core/src/main/java/org/springframework/core/log/LogFormatUtils.java index a079a5f76c..f5ba6330fb 100644 --- a/spring-core/src/main/java/org/springframework/core/log/LogFormatUtils.java +++ b/spring-core/src/main/java/org/springframework/core/log/LogFormatUtils.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.core.log; import java.util.function.Function; @@ -42,7 +43,7 @@ public final class LogFormatUtils { * {@link CharSequence}, and possibly truncating at 100 if limitLength is * set to true. * @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 * @since 5.1 */ @@ -50,8 +51,8 @@ public final class LogFormatUtils { if (value == null) { return ""; } - String s = value instanceof CharSequence ? "\"" + value + "\"" : value.toString(); - return limitLength && s.length() > 100 ? s.substring(0, 100) + " (truncated)..." : s; + String s = (value instanceof CharSequence ? "\"" + value + "\"" : value.toString()); + return (limitLength && s.length() > 100 ? s.substring(0, 100) + " (truncated)..." : s); } /** @@ -70,7 +71,7 @@ public final class LogFormatUtils { * * @param logger the logger to use to log the message * @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 messageFactory) { if (logger.isDebugEnabled()) {