From e18ab1c6d02f1b9a62147d70caa5289c9a2e2d71 Mon Sep 17 00:00:00 2001 From: Rongmario Date: Sat, 17 Feb 2024 04:43:06 +0000 Subject: [PATCH] 2.1 - fixes issue due to Reflection#registerFilter not null-checking --- build.gradle | 2 +- src/main/java/zone/rong/imaginebreaker/ImagineBreaker.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 8234cf0..9678c45 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'zone.rong' -version '2.0' +version '2.1' java { withSourcesJar() diff --git a/src/main/java/zone/rong/imaginebreaker/ImagineBreaker.java b/src/main/java/zone/rong/imaginebreaker/ImagineBreaker.java index a5441f0..bd388c8 100644 --- a/src/main/java/zone/rong/imaginebreaker/ImagineBreaker.java +++ b/src/main/java/zone/rong/imaginebreaker/ImagineBreaker.java @@ -11,6 +11,7 @@ import java.lang.reflect.Field; import java.util.AbstractMap; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -165,7 +166,7 @@ public static void wipeFieldFilters() { CLASS$REFLECTION_DATA.setVolatile(clazz, null); } } - REFLECTION$FIELD_FILTER_MAP.setVolatile((Object) null); + REFLECTION$FIELD_FILTER_MAP.setVolatile(new HashMap<>()); } /** @@ -181,7 +182,7 @@ public static void wipeMethodFilters() { CLASS$REFLECTION_DATA.setVolatile(clazz, null); } } - REFLECTION$METHOD_FILTER_MAP.setVolatile((Object) null); + REFLECTION$METHOD_FILTER_MAP.setVolatile(new HashMap<>()); } private static boolean isOpenJ9() {