Suppress forbidden-apis failing with MemoryLeakVerifier in JDK 18

Keep using Runtime.runFinalization() as long as it is available.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899497 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2022-04-01 21:17:22 +00:00
parent 0c77cd4d55
commit 8412eb4503
1 changed files with 1 additions and 0 deletions

View File

@ -85,6 +85,7 @@ public class MemoryLeakVerifier {
} }
} }
@SuppressForbidden("Use finalization as long as it is available here and remove it when the JDK stops providing it")
private static void assertGarbageCollected(WeakReference<Object> ref, int maxIterations) throws InterruptedException { private static void assertGarbageCollected(WeakReference<Object> ref, int maxIterations) throws InterruptedException {
Runtime runtime = Runtime.getRuntime(); Runtime runtime = Runtime.getRuntime();
for (int i = 0; i < maxIterations; i++) { for (int i = 0; i < maxIterations; i++) {