Skip to content

Commit 2d8b2fe

Browse files
committed
Avoid dependency on netty-common in DataBufferUtils
See: gh-22594
1 parent 78d1591 commit 2d8b2fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import java.util.concurrent.atomic.AtomicReference;
4040
import java.util.function.Consumer;
4141

42-
import io.netty.util.IllegalReferenceCountException;
4342
import org.apache.commons.logging.Log;
4443
import org.apache.commons.logging.LogFactory;
4544
import org.reactivestreams.Publisher;
@@ -502,9 +501,10 @@ public static boolean release(@Nullable DataBuffer dataBuffer) {
502501
try {
503502
return pooledDataBuffer.release();
504503
}
505-
catch (IllegalReferenceCountException ex) {
504+
catch (IllegalStateException ex) {
505+
// Avoid dependency on Netty: IllegalReferenceCountException
506506
if (logger.isDebugEnabled()) {
507-
logger.debug("RefCount already at 0", ex);
507+
logger.debug("Failed to release PooledDataBuffer", ex);
508508
}
509509
return false;
510510
}

0 commit comments

Comments
 (0)