Searched refs:autoCloseable (Results 1 – 2 of 2) sorted by relevance
57 public <T extends AutoCloseable> T manage(@NonNull T autoCloseable) { in manage() argument61 mAutoCloseables.add(autoCloseable); in manage()62 return autoCloseable; in manage()69 public void close(@NonNull AutoCloseable autoCloseable) { in close() argument73 mAutoCloseables.remove(autoCloseable); in close()75 autoCloseable.close(); in close()77 throw new AssertionError("Failed to close " + autoCloseable, e); in close()98 final AutoCloseable autoCloseable = mAutoCloseables.removeLast(); in tearDown() local100 autoCloseable.close(); in tearDown()102 StateLogger.logE("Failed to close " + autoCloseable, t); in tearDown()
750 private CloseOnce(@NonNull AutoCloseable autoCloseable) { in CloseOnce() argument751 mAutoCloseable = autoCloseable; in CloseOnce()760 static CloseOnce of(@NonNull AutoCloseable autoCloseable) { in of() argument761 return new CloseOnce(autoCloseable); in of()