From 3bce65bb76ccf22724a4a9e7c6c82652f13f68c8 Mon Sep 17 00:00:00 2001 From: janblom Date: Fri, 9 Feb 2024 15:19:57 +0100 Subject: [PATCH] Update CacioExtension.java restore manipulation of sun.java2d.SurfaceManagerFactory --- .../caciocavallosilano/cacio/ctc/junit/CacioExtension.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cacio-tta/src/main/java/com/github/caciocavallosilano/cacio/ctc/junit/CacioExtension.java b/cacio-tta/src/main/java/com/github/caciocavallosilano/cacio/ctc/junit/CacioExtension.java index 5626bde..7ddc219 100644 --- a/cacio-tta/src/main/java/com/github/caciocavallosilano/cacio/ctc/junit/CacioExtension.java +++ b/cacio-tta/src/main/java/com/github/caciocavallosilano/cacio/ctc/junit/CacioExtension.java @@ -89,7 +89,10 @@ public class CacioExtension implements ExecutionCondition { defaultHeadlessField.set(null, Boolean.FALSE); headlessField.set(null, Boolean.FALSE); - + Class smfCls = Class.forName("sun.java2d.SurfaceManagerFactory"); + Field smf = smfCls.getDeclaredField("instance"); + smf.setAccessible(true); + smf.set(null, null); } catch (Exception e) { e.printStackTrace(); }