diff --git a/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java b/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java index cfedb64747..dab452b00a 100644 --- a/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java +++ b/spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java @@ -504,7 +504,7 @@ public abstract class DataBufferUtils { catch (IllegalStateException ex) { // Avoid dependency on Netty: IllegalReferenceCountException if (logger.isDebugEnabled()) { - logger.debug("Failed to release PooledDataBuffer", ex); + logger.debug("Failed to release PooledDataBuffer: " + dataBuffer, ex); } return false; } diff --git a/spring-web/src/main/java/org/springframework/http/codec/multipart/PartHttpMessageWriter.java b/spring-web/src/main/java/org/springframework/http/codec/multipart/PartHttpMessageWriter.java index d1d9f49916..aa7819b2d8 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/multipart/PartHttpMessageWriter.java +++ b/spring-web/src/main/java/org/springframework/http/codec/multipart/PartHttpMessageWriter.java @@ -26,6 +26,7 @@ import org.springframework.core.ResolvableType; import org.springframework.core.codec.Hints; import org.springframework.core.io.buffer.DataBuffer; import org.springframework.core.io.buffer.DataBufferFactory; +import org.springframework.core.io.buffer.DataBufferUtils; import org.springframework.core.io.buffer.PooledDataBuffer; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -66,7 +67,7 @@ public class PartHttpMessageWriter extends MultipartWriterSupport implements Htt Flux body = Flux.from(parts) .concatMap(part -> encodePart(boundary, part, outputMessage.bufferFactory())) .concatWith(generateLastLine(boundary, outputMessage.bufferFactory())) - .doOnDiscard(PooledDataBuffer.class, PooledDataBuffer::release); + .doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release); return outputMessage.writeWith(body); }