Fix #10378,ResourceLeakDetectorFactory.newResourceLeakDetector(Class, int) ignores  sampling interval (#10383)

Motivation:

newResourceLeakDetector(...) did not correctly pass the samplingInterval parameter and so it was ignored.

Modification:

ResourceLeakDetectorFactory.newResourceLeakDetector(Class, int) use the second parameter as the sampling interval of the newly created ResourceLeakDetector.

Result:

Fixes #10378
This commit is contained in:
skyguard1 2020-07-01 16:24:41 +08:00 committed by Norman Maurer
parent 91c75a4a8f
commit 95f9694150

View File

@ -89,7 +89,8 @@ public abstract class ResourceLeakDetectorFactory {
*/
@SuppressWarnings("deprecation")
public <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval) {
return newResourceLeakDetector(resource, ResourceLeakDetector.SAMPLING_INTERVAL, Long.MAX_VALUE);
ObjectUtil.checkPositive(samplingInterval, "samplingInterval");
return newResourceLeakDetector(resource, samplingInterval, Long.MAX_VALUE);
}
/**