Bug 9060: Minor [Java|inline] doc update re. getStackTrace() performance
[mdsal.git] / dom-impl / src / main / java / org / opendaylight / controller / md / sal / trace / closetracker / impl / CloseTracked.java
index 926c8b3b8ee5e69dfb4a221bcafb5c815b257e7b..ef42c4025c6232494ff1f9a92048edfb7189ae5e 100644 (file)
@@ -18,6 +18,13 @@ import javax.annotation.Nullable;
  */
 public interface CloseTracked<T extends CloseTracked<T>> {
 
+    /**
+     * This returns the allocation context as {@link StackTraceElement}s. NB that
+     * this is a relatively <b>EXPENSIVE</b> operation! You should only ever call
+     * this when you really need to, e.g. when you actually produce output for
+     * humans, but not too early.
+     */
+    // TODO When we're on Java 9, then instead return a StackWalker.StackFrame[] here?
     @Nullable StackTraceElement[] getAllocationContextStackTrace();
 
     CloseTracked<T> getRealCloseTracked();