From 8412eb4503c5b8f261732d2c0c7b1e80bc42c773 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Fri, 1 Apr 2022 21:17:22 +0000 Subject: [PATCH] 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 --- poi/src/test/java/org/apache/poi/util/MemoryLeakVerifier.java | 1 + 1 file changed, 1 insertion(+) diff --git a/poi/src/test/java/org/apache/poi/util/MemoryLeakVerifier.java b/poi/src/test/java/org/apache/poi/util/MemoryLeakVerifier.java index 0b9b599b3c..e0e0498f06 100644 --- a/poi/src/test/java/org/apache/poi/util/MemoryLeakVerifier.java +++ b/poi/src/test/java/org/apache/poi/util/MemoryLeakVerifier.java @@ -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 ref, int maxIterations) throws InterruptedException { Runtime runtime = Runtime.getRuntime(); for (int i = 0; i < maxIterations; i++) { -- 2.39.5