public interface ResourceLeakTracker<T>
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
close(T trackedObject)
Close the leak so that
ResourceLeakTracker does not warn about leaked resources. |
void |
record()
Records the caller's current stack trace so that the
ResourceLeakDetector can tell where the leaked
resource was accessed lastly. |
void |
record(Object hint)
Records the caller's current stack trace and the specified additional arbitrary information
so that the
ResourceLeakDetector can tell where the leaked resource was accessed lastly. |
void record()
ResourceLeakDetector can tell where the leaked
resource was accessed lastly. This method is a shortcut to record(null).
记录调用者的当前堆栈跟踪,这样ResourceLeakDetector就可以告诉泄漏的资源最后是在什么地方被访问的。
这个方法是record(null)的快捷方式。void record(Object hint)
ResourceLeakDetector can tell where the leaked resource was accessed lastly.
记录调用方的当前堆栈跟踪和指定的其他任意信息
这样ResourceLeakDetector就可以告诉泄漏的资源最后是在什么地方被访问的。boolean close(T trackedObject)
ResourceLeakTracker does not warn about leaked resources.
After this method is called a leak associated with this ResourceLeakTracker should not be reported.
关闭泄漏,这样ResourceLeakTracker就不会对泄漏的资源发出警告。
调用此方法后,不应报告与此ResourceLeakTracker关联的泄漏。true if called first time, false if called alreadyCopyright © 2021. All rights reserved.