Avoid dependency on netty-common in DataBufferUtils

See: gh-22594
This commit is contained in:
Rossen Stoyanchev 2020-06-20 15:56:35 +01:00
parent 9e12a20324
commit f0b8e638ad
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,6 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer; import java.util.function.Consumer;
import io.netty.util.IllegalReferenceCountException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.reactivestreams.Publisher; import org.reactivestreams.Publisher;
@ -502,9 +501,10 @@ public abstract class DataBufferUtils {
try { try {
return pooledDataBuffer.release(); return pooledDataBuffer.release();
} }
catch (IllegalReferenceCountException ex) { catch (IllegalStateException ex) {
// Avoid dependency on Netty: IllegalReferenceCountException
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("RefCount already at 0", ex); logger.debug("Failed to release PooledDataBuffer", ex);
} }
return false; return false;
} }