From e4a530efac8955151dedec67e1916b0321462699 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 11 Feb 2020 10:39:35 +0000 Subject: [PATCH] Minor refactoring in CommonsLogWriter Closes gh-24495 --- .../org/springframework/util/CommonsLogWriter.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/CommonsLogWriter.java b/spring-core/src/main/java/org/springframework/util/CommonsLogWriter.java index 30800b90d8..c3c5744e8d 100644 --- a/spring-core/src/main/java/org/springframework/util/CommonsLogWriter.java +++ b/spring-core/src/main/java/org/springframework/util/CommonsLogWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -56,14 +56,7 @@ public class CommonsLogWriter extends Writer { @Override public void write(char[] buffer, int offset, int length) { for (int i = 0; i < length; i++) { - char ch = buffer[offset + i]; - if (ch == '\n' && this.buffer.length() > 0) { - logger.debug(this.buffer.toString()); - this.buffer.setLength(0); - } - else { - this.buffer.append(ch); - } + write(buffer[offset + i]); } }