Interface ResourceLeakTracker<T>
public interface ResourceLeakTracker<T>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanClose the leak so thatResourceLeakTrackerdoes not warn about leaked resources.default @Nullable ThrowableGet aThrowablerepresenting the stack trace of the originalclose(Object)call.voidrecord()Records the caller's current stack trace so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly.voidRecords the caller's current stack trace and the specified additional arbitrary information so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly.
-
Method Details
-
record
void record()Records the caller's current stack trace so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly. This method is a shortcut torecord(null). -
record
Records the caller's current stack trace and the specified additional arbitrary information so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly. -
close
Close the leak so thatResourceLeakTrackerdoes not warn about leaked resources. After this method is called a leak associated with this ResourceLeakTracker should not be reported.- Returns:
trueif called first time,falseif called already
-
getCloseStackTraceIfAny
Get aThrowablerepresenting the stack trace of the originalclose(Object)call. If this tracker hasn't been cloesd, or close tracking isn't supported or enabled, then this method returnsnull.- Returns:
- A throwable with the stack trace of the successful close call, or
null.
-