From 74516f22f01ca1cd3a9d1db3f4dad2c4b78061db Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Fri, 13 Apr 2018 19:00:13 +0300 Subject: [PATCH 1/4] Reset myDoubleCachedValue in registry --- .../src/com/intellij/openapi/util/registry/RegistryValue.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.java b/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.java index 69b6c93abbf8..930a68ff4f2e 100644 --- a/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.java +++ b/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.java @@ -267,6 +267,7 @@ public class RegistryValue { void resetCache() { myStringCachedValue = null; myIntCachedValue = null; + myDoubleCachedValue = null; myBooleanCachedValue = null; } From 0edbc64a1b693f42c0da2bae7bfd514463b2282a Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 13 Apr 2018 19:08:22 +0300 Subject: [PATCH 2/4] provide context to get a valid class loader --- .../openapi/util/DeprecatedDuplicatesIconPathPatcher.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/util/src/com/intellij/openapi/util/DeprecatedDuplicatesIconPathPatcher.java b/platform/util/src/com/intellij/openapi/util/DeprecatedDuplicatesIconPathPatcher.java index 27951508ece1..cbee05be539f 100644 --- a/platform/util/src/com/intellij/openapi/util/DeprecatedDuplicatesIconPathPatcher.java +++ b/platform/util/src/com/intellij/openapi/util/DeprecatedDuplicatesIconPathPatcher.java @@ -59,4 +59,10 @@ public class DeprecatedDuplicatesIconPathPatcher extends IconPathPatcher { public String patchPath(String path) { return ourDeprecatedIconsReplacements.get(path); } + + @Nullable + @Override + public Class getContextClass(String path) { + return DeprecatedDuplicatesIconPathPatcher.class; + } } From be6a9822e38885104f335556582c40e09e9d9d41 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 13 Apr 2018 16:53:00 +0200 Subject: [PATCH 3/4] =?UTF-8?q?StateMap=20=E2=80=94=20use=20LZ4=20instead?= =?UTF-8?q?=20of=20snappy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intellij.platform.configurationStore.impl.iml | 1 + platform/configuration-store-impl/src/StateMap.kt | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/configuration-store-impl/intellij.platform.configurationStore.impl.iml b/platform/configuration-store-impl/intellij.platform.configurationStore.impl.iml index dff8522ccef4..dcd0f841392f 100644 --- a/platform/configuration-store-impl/intellij.platform.configurationStore.impl.iml +++ b/platform/configuration-store-impl/intellij.platform.configurationStore.impl.iml @@ -20,5 +20,6 @@ + \ No newline at end of file diff --git a/platform/configuration-store-impl/src/StateMap.kt b/platform/configuration-store-impl/src/StateMap.kt index 64ee82d9ad5d..93fbbde43d20 100644 --- a/platform/configuration-store-impl/src/StateMap.kt +++ b/platform/configuration-store-impl/src/StateMap.kt @@ -9,8 +9,8 @@ import com.intellij.util.ArrayUtil import com.intellij.util.SystemProperties import com.intellij.util.isEmpty import gnu.trove.THashMap -import org.iq80.snappy.SnappyFramedInputStream -import org.iq80.snappy.SnappyFramedOutputStream +import net.jpountz.lz4.LZ4BlockInputStream +import net.jpountz.lz4.LZ4BlockOutputStream import org.jdom.Element import java.io.ByteArrayInputStream import java.util.* @@ -18,13 +18,13 @@ import java.util.concurrent.atomic.AtomicReferenceArray fun archiveState(state: Element): BufferExposingByteArrayOutputStream { val byteOut = BufferExposingByteArrayOutputStream() - SnappyFramedOutputStream(byteOut).use { + LZ4BlockOutputStream(byteOut).use { serializeElementToBinary(state, it) } return byteOut } -private fun unarchiveState(state: ByteArray) = SnappyFramedInputStream(ByteArrayInputStream(state), false).use { deserializeElementFromBinary(it) } +private fun unarchiveState(state: ByteArray) = LZ4BlockInputStream(ByteArrayInputStream(state)).use { deserializeElementFromBinary(it) } fun getNewByteIfDiffers(key: String, newState: Any, oldState: ByteArray): ByteArray? { val newBytes: ByteArray From 2c0dc32939fe97ae0ba120899f91a314b3904a14 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 13 Apr 2018 18:11:34 +0200 Subject: [PATCH 4/4] quick solution of "incorrect before run list is set on template RC modification" --- .../src/com/intellij/execution/impl/RunManagerImpl.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt index 0daf8d806268..a420da42879b 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt @@ -924,14 +924,20 @@ open class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persi } else { val templateConfiguration = getConfigurationTemplate(configuration.factory).configuration - val templateTasks = if (templateConfiguration === configuration) { + val isTemplate = templateConfiguration === configuration + val templateTasks = if (isTemplate) { getHardcodedBeforeRunTasks(configuration) } else { getTemplateBeforeRunTasks(templateConfiguration) } - if (templateConfiguration === configuration) { + if (isTemplate) { + if (tasks == templateTasks) { + // nothing is changed + return + } + // we must update all existing configuration tasks to ensure that effective tasks (own + template) are the same as before template configuration change // see testTemplates test lock.read {