mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Clear serialization caches when plugins are unloaded
GitOrigin-RevId: 7e2701a4654a82dd39562f70f4ff6dc278f48eed
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9f1363b53c
commit
e162303586
@@ -97,6 +97,10 @@ internal class JdomSerializerImpl : JdomSerializer {
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearSerializationCaches() {
|
||||
clearBindingCache()
|
||||
}
|
||||
|
||||
override fun deserializeInto(obj: Any, element: Element) {
|
||||
try {
|
||||
(serializer.getRootBinding(obj.javaClass) as BeanBinding).deserializeInto(obj, element)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.plugins
|
||||
|
||||
import com.intellij.configurationStore.jdomSerializer
|
||||
import com.intellij.ide.ui.UIThemeProvider
|
||||
import com.intellij.notification.NotificationDisplayType
|
||||
import com.intellij.notification.NotificationGroup
|
||||
@@ -22,6 +23,7 @@ import com.intellij.util.MemoryDumpHelper
|
||||
import com.intellij.util.ReflectionUtil
|
||||
import com.intellij.util.SystemProperties
|
||||
import com.intellij.util.messages.Topic
|
||||
import com.intellij.util.xmlb.BeanBinding
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@@ -153,6 +155,9 @@ object DynamicPlugins {
|
||||
}
|
||||
}
|
||||
|
||||
jdomSerializer.clearSerializationCaches()
|
||||
BeanBinding.clearSerializationCaches()
|
||||
|
||||
val classLoaderUnloaded = loadedPluginDescriptor.unloadClassLoader()
|
||||
if (!classLoaderUnloaded && Registry.`is`("ide.plugins.snapshot.on.unload.fail") && MemoryDumpHelper.memoryDumpAvailable()) {
|
||||
val snapshotFolder = System.getProperty("snapshots.path", SystemProperties.getUserHome())
|
||||
|
||||
@@ -56,4 +56,6 @@ interface JdomSerializer {
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun getDefaultSerializationFilter(): SkipDefaultsSerializationFilter
|
||||
|
||||
fun clearSerializationCaches()
|
||||
}
|
||||
@@ -169,6 +169,10 @@ public class PropertyCollector {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
protected void clearSerializationCaches() {
|
||||
classToOwnFields.clear();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static NameAndIsSetter getPropertyData(@NotNull String methodName) {
|
||||
String part = "";
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.lang.reflect.Type;
|
||||
import java.util.*;
|
||||
|
||||
public class BeanBinding extends NotNullDeserializeBinding {
|
||||
private static final PropertyCollector PROPERTY_COLLECTOR = new XmlSerializerPropertyCollector();
|
||||
private static final XmlSerializerPropertyCollector PROPERTY_COLLECTOR = new XmlSerializerPropertyCollector();
|
||||
|
||||
private final String myTagName;
|
||||
@SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized")
|
||||
@@ -331,6 +331,12 @@ public class BeanBinding extends NotNullDeserializeBinding {
|
||||
element.isAnnotationPresent(XCollection.class) ||
|
||||
element.isAnnotationPresent(AbstractCollection.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSerializationCaches() {
|
||||
super.clearSerializationCaches();
|
||||
accessorCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
@@ -403,4 +409,8 @@ public class BeanBinding extends NotNullDeserializeBinding {
|
||||
}
|
||||
return new OptionTagBinding(accessor, optionTag);
|
||||
}
|
||||
|
||||
public static void clearSerializationCaches() {
|
||||
PROPERTY_COLLECTOR.clearSerializationCaches();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user