diff --git a/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java b/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java index 60c016d255..e9fe09c606 100644 --- a/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java +++ b/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java @@ -88,7 +88,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); } /**