Date: Thu, 8 Jun 2023 20:42:07 +0800
Subject: 8220166: Performance regression in deserialization

Bug url: https://bugs.openjdk.org/browse/JDK-8220166
---
 jdk/src/share/classes/sun/misc/ObjectInputFilter.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/jdk/src/share/classes/sun/misc/ObjectInputFilter.java b/jdk/src/share/classes/sun/misc/ObjectInputFilter.java
index af21c7400..eb75755fb 100644
--- a/jdk/src/share/classes/sun/misc/ObjectInputFilter.java
+++ b/jdk/src/share/classes/sun/misc/ObjectInputFilter.java
@@ -270,7 +270,7 @@ public interface ObjectInputFilter {
         /**
          * Current configured filter.
          */
-        private static ObjectInputFilter serialFilter = configuredFilter;
+        private static volatile ObjectInputFilter serialFilter = configuredFilter;
 
         /**
          * Get the filter for classes being deserialized on the ObjectInputStream.
@@ -304,9 +304,7 @@ public interface ObjectInputFilter {
          * @return the process-wide serialization filter or {@code null} if not configured
          */
         public static ObjectInputFilter getSerialFilter() {
-            synchronized (serialFilterLock) {
-                return serialFilter;
-            }
+            return serialFilter;
         }
 
         /**
-- 
2.22.0

