diff --git a/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java b/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java index 294861f977..172de09be5 100644 --- a/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java +++ b/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java @@ -89,7 +89,8 @@ public abstract class ResourceLeakDetectorFactory { */ @SuppressWarnings("deprecation") public ResourceLeakDetector newResourceLeakDetector(Class resource, int samplingInterval) { - return newResourceLeakDetector(resource, ResourceLeakDetector.SAMPLING_INTERVAL, Long.MAX_VALUE); + ObjectUtil.checkPositive(samplingInterval, "samplingInterval"); + return newResourceLeakDetector(resource, samplingInterval, Long.MAX_VALUE); } /**