Class ReferenceCountUtil


  • public final class ReferenceCountUtil
    extends Object
    • Method Detail

      • release

        public static boolean release​(Object o)
        Try to call ReferenceCounted.release() if the specified message implements ReferenceCounted and is not already released. If the specified message doesn't implement ReferenceCounted, this method does nothing.
      • safeRelease

        public static void safeRelease​(Object o)
        Try to call ReferenceCounted.release() if the specified message implements ReferenceCounted and is not already released. If the specified message doesn't implement ReferenceCounted, this method does nothing. Unlike release(Object) this method catches an exception raised by ReferenceCounted.release() and logs it, rather than rethrowing it to the caller. It is usually recommended to use release(Object) instead, unless you absolutely need to swallow an exception.