From 6496cdb440d3ca271118e576dd8f9971fd0375f1 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 9 Feb 2017 14:41:59 +0100 Subject: [PATCH] =?UTF-8?q?serialization:=20kotlin=20data=20class=20full?= =?UTF-8?q?=20support=20(initial,=20enabled=20only=20in=20tests=20for=20no?= =?UTF-8?q?w)=20=E2=80=94=20part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- community-main.iml | 1 - java/java-tests/java-tests.iml | 1 - .../configuration-store-impl.iml | 4 + .../testSrc/SchemeManagerTest.kt | 1 - .../testSrc/StoreTestSuite.kt | 1 + .../testSrc/xml}/KotlinXmlSerializerTest.kt | 2 +- .../{ => xml}/XmlElementStorageTest.kt | 6 +- .../testSrc/xml}/XmlSerializerMapTest.kt | 3 +- .../testSrc/xml}/XmlSerializerTest.kt | 82 +++++++++---------- .../jetbrains/concurrency/AsyncPromiseTest.kt | 44 +--------- .../configurationStore/xmlSerializer.kt | 49 +++++++---- .../com/intellij/testFramework/concurrency.kt | 60 ++++++++++++++ .../intellij/util/xmlb/XmlSerializerImpl.java | 8 +- .../settings-repository-tests.iml | 1 - .../settings-repository/testSrc/LoadTest.kt | 6 +- 15 files changed, 151 insertions(+), 118 deletions(-) rename platform/{util/testSrc/com/intellij/util/xmlb => configuration-store-impl/testSrc/xml}/KotlinXmlSerializerTest.kt (98%) rename platform/configuration-store-impl/testSrc/{ => xml}/XmlElementStorageTest.kt (91%) rename platform/{util/testSrc/com/intellij/util/xmlb => configuration-store-impl/testSrc/xml}/XmlSerializerMapTest.kt (98%) rename platform/{util/testSrc/com/intellij/util/xmlb => configuration-store-impl/testSrc/xml}/XmlSerializerTest.kt (93%) create mode 100644 platform/testFramework/extensions/src/com/intellij/testFramework/concurrency.kt diff --git a/community-main.iml b/community-main.iml index 85186028f6d8..2e77b4c5f704 100644 --- a/community-main.iml +++ b/community-main.iml @@ -112,7 +112,6 @@ - diff --git a/java/java-tests/java-tests.iml b/java/java-tests/java-tests.iml index 6d7031c0bcda..ac00daab2c16 100644 --- a/java/java-tests/java-tests.iml +++ b/java/java-tests/java-tests.iml @@ -55,7 +55,6 @@ - \ No newline at end of file diff --git a/platform/configuration-store-impl/configuration-store-impl.iml b/platform/configuration-store-impl/configuration-store-impl.iml index 846952cdc4d8..560f011ecfe3 100644 --- a/platform/configuration-store-impl/configuration-store-impl.iml +++ b/platform/configuration-store-impl/configuration-store-impl.iml @@ -4,6 +4,7 @@ + @@ -16,5 +17,8 @@ + + + \ No newline at end of file diff --git a/platform/configuration-store-impl/testSrc/SchemeManagerTest.kt b/platform/configuration-store-impl/testSrc/SchemeManagerTest.kt index 126124a3047f..56dd103d143b 100644 --- a/platform/configuration-store-impl/testSrc/SchemeManagerTest.kt +++ b/platform/configuration-store-impl/testSrc/SchemeManagerTest.kt @@ -33,7 +33,6 @@ import com.intellij.util.lang.CompoundRuntimeException import com.intellij.util.loadElement import com.intellij.util.toByteArray import com.intellij.util.xmlb.annotations.Tag -import com.intellij.util.xmlb.serialize import gnu.trove.THashMap import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy diff --git a/platform/configuration-store-impl/testSrc/StoreTestSuite.kt b/platform/configuration-store-impl/testSrc/StoreTestSuite.kt index e9cfdcae4c69..fc34cc3812cb 100644 --- a/platform/configuration-store-impl/testSrc/StoreTestSuite.kt +++ b/platform/configuration-store-impl/testSrc/StoreTestSuite.kt @@ -15,6 +15,7 @@ */ package com.intellij.configurationStore +import com.intellij.configurationStore.xml.XmlElementStorageTest import org.junit.runner.RunWith import org.junit.runners.Suite diff --git a/platform/util/testSrc/com/intellij/util/xmlb/KotlinXmlSerializerTest.kt b/platform/configuration-store-impl/testSrc/xml/KotlinXmlSerializerTest.kt similarity index 98% rename from platform/util/testSrc/com/intellij/util/xmlb/KotlinXmlSerializerTest.kt rename to platform/configuration-store-impl/testSrc/xml/KotlinXmlSerializerTest.kt index b13c5d5fb3a7..d953a63eb7c5 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/KotlinXmlSerializerTest.kt +++ b/platform/configuration-store-impl/testSrc/xml/KotlinXmlSerializerTest.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.util.xmlb +package com.intellij.configurationStore.xml import com.intellij.configurationStore.deserialize import com.intellij.util.loadElement diff --git a/platform/configuration-store-impl/testSrc/XmlElementStorageTest.kt b/platform/configuration-store-impl/testSrc/xml/XmlElementStorageTest.kt similarity index 91% rename from platform/configuration-store-impl/testSrc/XmlElementStorageTest.kt rename to platform/configuration-store-impl/testSrc/xml/XmlElementStorageTest.kt index 1824c98ab917..07cdd1b4278f 100644 --- a/platform/configuration-store-impl/testSrc/XmlElementStorageTest.kt +++ b/platform/configuration-store-impl/testSrc/xml/XmlElementStorageTest.kt @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.configurationStore +package com.intellij.configurationStore.xml +import com.intellij.configurationStore.StateMap +import com.intellij.configurationStore.XmlElementStorage import com.intellij.openapi.util.JDOMBuilder.attr import com.intellij.openapi.util.JDOMBuilder.tag import org.assertj.core.api.Assertions.assertThat @@ -52,7 +54,7 @@ class XmlElementStorageTest { override fun loadLocalData() = myElement - override fun createSaveSession(states: StateMap) = object : XmlElementStorage.XmlElementStorageSaveSession(states, this) { + override fun createSaveSession(states: StateMap) = object : XmlElementStorageSaveSession(states, this) { override fun saveLocally(element: Element?) { savedElement = element?.clone() } diff --git a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerMapTest.kt b/platform/configuration-store-impl/testSrc/xml/XmlSerializerMapTest.kt similarity index 98% rename from platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerMapTest.kt rename to platform/configuration-store-impl/testSrc/xml/XmlSerializerMapTest.kt index a8e041e8f94d..8d153626a83c 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerMapTest.kt +++ b/platform/configuration-store-impl/testSrc/xml/XmlSerializerMapTest.kt @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.util.xmlb +package com.intellij.configurationStore.xml +import com.intellij.util.xmlb.SkipDefaultsSerializationFilter import com.intellij.util.xmlb.annotations.MapAnnotation import com.intellij.util.xmlb.annotations.Property import com.intellij.util.xmlb.annotations.Tag diff --git a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.kt b/platform/configuration-store-impl/testSrc/xml/XmlSerializerTest.kt similarity index 93% rename from platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.kt rename to platform/configuration-store-impl/testSrc/xml/XmlSerializerTest.kt index 7f748a109ce5..b59c45df949e 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.kt +++ b/platform/configuration-store-impl/testSrc/xml/XmlSerializerTest.kt @@ -13,24 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.util.xmlb +package com.intellij.configurationStore.xml +import com.intellij.configurationStore.deserialize +import com.intellij.configurationStore.serialize import com.intellij.openapi.util.JDOMExternalizableStringList import com.intellij.openapi.util.JDOMUtil import com.intellij.openapi.util.Ref import com.intellij.openapi.util.text.StringUtil +import com.intellij.testFramework.assertConcurrent import com.intellij.util.SmartList import com.intellij.util.loadElement +import com.intellij.util.xmlb.* import com.intellij.util.xmlb.annotations.* import com.intellij.util.xmlb.annotations.AbstractCollection -import junit.framework.AssertionFailedError import junit.framework.TestCase import org.assertj.core.api.Assertions.assertThat import org.intellij.lang.annotations.Language import org.jdom.Element import org.junit.Test import java.util.* -import java.util.concurrent.atomic.AtomicReference internal open class BeanWithPublicFields(var INT_V: Int = 1, var STRING_V: String? = "hello") : Comparable { override fun compareTo(other: BeanWithPublicFields) = StringUtil.compare(STRING_V, other.STRING_V, false) @@ -211,9 +213,9 @@ internal class XmlSerializerTest { doSerializerTest("\n" + " \n" + "", bean) } - private data class BeanWithOption(@OptionTag("path") var PATH: String? = null) - @Test fun OptionTag() { + data class BeanWithOption(@OptionTag("path") var PATH: String? = null) + val bean = BeanWithOption() bean.PATH = "123" doSerializerTest("\n" + " ", bean) @@ -238,34 +240,33 @@ internal class XmlSerializerTest { } private class BeanWithFieldWithTagAnnotation { - @Tag("name") var STRING_V: String = "hello" + @Tag("name") var STRING_V = "hello" } - @Test fun ParallelDeserialization() { + @Test fun `parallel deserialization`() { val e = Element("root").addContent(Element("name").setText("x")) - XmlSerializer.deserialize(e, BeanWithArray::class.java)//to initialize XmlSerializerImpl.ourBindings - val exc = AtomicReference() - val threads = Array(5) { - Thread(Runnable { - try { - for (j in 0..9) { - val bean = e.deserialize() - assertThat(bean).isNotNull() - assertThat(bean.STRING_V).isEqualTo("x") - } + assertConcurrent(*Array(5) { + { + for (i in 0..9) { + val bean = e.deserialize() + assertThat(bean).isNotNull() + assertThat(bean.STRING_V).isEqualTo("x") } - catch (e: AssertionFailedError) { - exc.set(e) + } + }) + } + + @Test fun `parallel deserialization 2`() { + val e = Element("root").addContent(Element("name").setText("x")) + assertConcurrent(*Array(5) { + { + for (i in 0..9) { + val bean = e.deserialize() + assertThat(bean).isNotNull() + assertThat(bean.STRING_V).isEqualTo("x") } - }, "XmlSerializerTest#testParallelDeserialization-$it") - } - for (thread in threads) { - thread.start() - } - for (thread in threads) { - thread.join() - } - exc.get()?.let { throw it } + } + }) } @Test fun FieldWithTagAnnotation() { @@ -594,7 +595,7 @@ internal class XmlSerializerTest { private class BeanWithJDOMElement { var STRING_V: String = "hello" - @Tag("actions") var actions: org.jdom.Element? = null + @Tag("actions") var actions: Element? = null } @Test fun SerializeJDOMElementField() { @@ -608,7 +609,8 @@ internal class XmlSerializerTest { } @Test fun DeserializeJDOMElementField() { - val bean = XmlSerializer.deserialize(JDOMUtil.loadDocument("").rootElement, BeanWithJDOMElement::class.java) + val bean = XmlSerializer.deserialize( + JDOMUtil.loadDocument("").rootElement, BeanWithJDOMElement::class.java) TestCase.assertEquals("bye", bean.STRING_V) TestCase.assertNotNull(bean.actions) @@ -617,7 +619,7 @@ internal class XmlSerializerTest { class BeanWithJDOMElementArray { var STRING_V: String = "hello" - @Tag("actions") var actions: Array? = null + @Tag("actions") var actions: Array? = null } @Test fun JDOMElementArrayField() { @@ -840,7 +842,8 @@ internal class XmlSerializerTest { val value = Element("value") list.writeExternal(value) - val o = XmlSerializer.deserialize(Element("state").addContent(Element("option").setAttribute("name", "myList").addContent(value)), Bean4::class.java)!! + val o = XmlSerializer.deserialize( + Element("state").addContent(Element("option").setAttribute("name", "myList").addContent(value)), Bean4::class.java)!! assertSerializer(o, "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + "", SkipDefaultsSerializationFilter()) } @@ -854,14 +857,15 @@ internal class XmlSerializerTest {

Node.js integration

]]> -""".reader()), Bean::class.java)!! +""".reader()), Bean::class.java) assertThat(bean.description).isEqualToIgnoringWhitespace("

Node.js integration

") - bean = XmlSerializer.deserialize(loadElement("""Node.js integration]]>""".reader()), Bean::class.java)!! + bean = XmlSerializer.deserialize( + loadElement("""Node.js integration]]>""".reader()), Bean::class.java) assertThat(bean.description).isEqualTo("

Node.js integration

") } - private fun checkSmartSerialization(bean: XmlSerializerTest.Bean2, serialized: String) { + private fun checkSmartSerialization(bean: Bean2, serialized: String) { val serializer = SmartSerializer() serializer.readExternal(bean, JDOMUtil.loadDocument(serialized).rootElement) val serializedState = Element("Bean2") @@ -888,11 +892,7 @@ internal fun doSerializerTest(@Language("XML") expectedText: String, be val element = assertSerializer(bean, expectedTrimmed, filter) //test deserializer - val o = XmlSerializer.deserialize(element, bean.javaClass)!! + val o = XmlSerializer.deserialize(element, bean.javaClass) assertSerializer(o, expectedTrimmed, filter, "Deserialization failure") return o -} - -fun T.serialize(filter: SerializationFilter? = SkipDefaultValuesSerializationFilters()): Element = XmlSerializer.serialize(this, filter) - -inline fun Element.deserialize(): T = XmlSerializer.deserialize(this, T::class.java)!! \ No newline at end of file +} \ No newline at end of file diff --git a/platform/platform-tests/testSrc/org/jetbrains/concurrency/AsyncPromiseTest.kt b/platform/platform-tests/testSrc/org/jetbrains/concurrency/AsyncPromiseTest.kt index aedb1530838b..c7c7841b9bf7 100644 --- a/platform/platform-tests/testSrc/org/jetbrains/concurrency/AsyncPromiseTest.kt +++ b/platform/platform-tests/testSrc/org/jetbrains/concurrency/AsyncPromiseTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,14 +15,10 @@ */ package org.jetbrains.concurrency -import com.intellij.util.containers.ContainerUtil -import com.intellij.util.lang.CompoundRuntimeException +import com.intellij.testFramework.assertConcurrent import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Test -import java.util.concurrent.CountDownLatch -import java.util.concurrent.Executors -import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.AtomicInteger @@ -115,40 +111,4 @@ class AsyncPromiseTest { r() assertThat(count.get()).isEqualTo(numThreads + 1) } -} - -fun assertConcurrent(vararg runnables: () -> Any?, maxTimeoutSeconds: Int = 5) { - val numThreads = runnables.size - val exceptions = ContainerUtil.createLockFreeCopyOnWriteList() - val threadPool = Executors.newFixedThreadPool(numThreads) - try { - val allExecutorThreadsReady = CountDownLatch(numThreads) - val afterInitBlocker = CountDownLatch(1) - val allDone = CountDownLatch(numThreads) - for (submittedTestRunnable in runnables) { - threadPool.submit { - allExecutorThreadsReady.countDown() - try { - afterInitBlocker.await() - submittedTestRunnable() - } - catch (e: Throwable) { - exceptions.add(e) - } - finally { - allDone.countDown() - } - } - } - - // wait until all threads are ready - assertThat(allExecutorThreadsReady.await((runnables.size * 1000).toLong(), TimeUnit.MILLISECONDS)).isTrue() - // start all test runners - afterInitBlocker.countDown() - assertThat(allDone.await(maxTimeoutSeconds.toLong(), TimeUnit.SECONDS)).isTrue() - } - finally { - threadPool.shutdownNow() - } - CompoundRuntimeException.throwIfNotEmpty(exceptions) } \ No newline at end of file diff --git a/platform/projectModel-impl/src/com/intellij/configurationStore/xmlSerializer.kt b/platform/projectModel-impl/src/com/intellij/configurationStore/xmlSerializer.kt index 131c520f112f..ec5cb66ea67e 100644 --- a/platform/projectModel-impl/src/com/intellij/configurationStore/xmlSerializer.kt +++ b/platform/projectModel-impl/src/com/intellij/configurationStore/xmlSerializer.kt @@ -16,18 +16,22 @@ package com.intellij.configurationStore import com.intellij.openapi.util.JDOMUtil -import com.intellij.openapi.util.Pair import com.intellij.reference.SoftReference import com.intellij.util.xmlb.* +import gnu.trove.THashMap import org.jdom.Element import org.jdom.JDOMException import java.io.IOException import java.lang.reflect.Type import java.net.URL -import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.locks.ReentrantReadWriteLock +import kotlin.concurrent.read +import kotlin.concurrent.write import kotlin.reflect.primaryConstructor -private var bindingCache: SoftReference, Binding>>? = null +fun T.serialize(filter: SerializationFilter? = SkipDefaultValuesSerializationFilters()): Element = XmlSerializer.serialize(this, filter) + +inline fun Element.deserialize(): T = deserialize(this, T::class.java) fun deserialize(element: Element, aClass: Class): T { @Suppress("UNCHECKED_CAST") @@ -56,12 +60,29 @@ fun deserialize(url: URL, aClass: Class): T { } } +private var _bindingCache: SoftReference>? = null + +private val bindingCache: MutableMap + get() { + var map = _bindingCache?.get() + if (map == null) { + map = THashMap() + _bindingCache = SoftReference(map) + } + return map + } + +private val cacheLock = ReentrantReadWriteLock() + private fun getBinding(aClass: Class, originalType: Type = aClass, accessor: MutableAccessor? = null): Binding { - val key = Pair.create(originalType, accessor) - val map = getBindingCacheMap() - var binding: Binding? = map.get(key) - if (binding == null) { - binding = XmlSerializerImpl.getNonCachedClassBinding(aClass, accessor, originalType) ?: KotlinAwareBeanBinding(aClass, accessor) + val key = BindingCacheKey(originalType, accessor) + val map = bindingCache + return cacheLock.read { map.get(key) } ?: cacheLock.write { + map.get(key)?.let { + return it + } + + val binding = XmlSerializerImpl.createClassBinding(aClass, accessor, originalType) ?: KotlinAwareBeanBinding(aClass, accessor) map.put(key, binding) try { binding.init(originalType) @@ -70,19 +91,11 @@ private fun getBinding(aClass: Class, originalType: Type = aClass, access map.remove(key) throw e } - + binding } - return binding } -private fun getBindingCacheMap(): MutableMap, Binding> { - var map = SoftReference.dereference, Binding>>(bindingCache) - if (map == null) { - map = ConcurrentHashMap, Binding>() - bindingCache = SoftReference, Binding>>(map) - } - return map -} +private data class BindingCacheKey(val type: Type, val accessor: MutableAccessor?) private class KotlinAwareBeanBinding(beanClass: Class<*>, accessor: MutableAccessor? = null) : BeanBinding(beanClass, accessor) { override fun deserialize(context: Any?, element: Element): Any { diff --git a/platform/testFramework/extensions/src/com/intellij/testFramework/concurrency.kt b/platform/testFramework/extensions/src/com/intellij/testFramework/concurrency.kt new file mode 100644 index 000000000000..67cb69ef15ec --- /dev/null +++ b/platform/testFramework/extensions/src/com/intellij/testFramework/concurrency.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.testFramework + +import com.intellij.util.containers.ContainerUtil +import com.intellij.util.lang.CompoundRuntimeException +import org.assertj.core.api.Assertions.assertThat +import java.util.concurrent.CountDownLatch +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit + +fun assertConcurrent(vararg runnables: () -> Any?, maxTimeoutSeconds: Int = 5) { + val numThreads = runnables.size + val exceptions = ContainerUtil.createLockFreeCopyOnWriteList() + val threadPool = Executors.newFixedThreadPool(numThreads) + try { + val allExecutorThreadsReady = CountDownLatch(numThreads) + val afterInitBlocker = CountDownLatch(1) + val allDone = CountDownLatch(numThreads) + for (submittedTestRunnable in runnables) { + threadPool.submit { + allExecutorThreadsReady.countDown() + try { + afterInitBlocker.await() + submittedTestRunnable() + } + catch (e: Throwable) { + exceptions.add(e) + } + finally { + allDone.countDown() + } + } + } + + // wait until all threads are ready + assertThat(allExecutorThreadsReady.await((runnables.size * 1000).toLong(), TimeUnit.MILLISECONDS)).isTrue() + // start all test runners + afterInitBlocker.countDown() + assertThat(allDone.await(maxTimeoutSeconds.toLong(), TimeUnit.SECONDS)).isTrue() + } + finally { + threadPool.shutdownNow() + } + CompoundRuntimeException.throwIfNotEmpty(exceptions) +} + diff --git a/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java b/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java index 184114b55b5c..7f3ca6587126 100644 --- a/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java +++ b/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java @@ -17,6 +17,7 @@ package com.intellij.util.xmlb; import com.intellij.openapi.util.JDOMExternalizableStringList; import com.intellij.openapi.util.Pair; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.xmlb.annotations.CollectionBean; import org.jdom.Content; import org.jdom.Element; @@ -34,7 +35,6 @@ import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; public class XmlSerializerImpl { private static Reference, Binding>> ourBindings; @@ -118,7 +118,7 @@ public class XmlSerializerImpl { Map, Binding> map = getBindingCacheMap(); Binding binding = map.get(key); if (binding == null) { - binding = getNonCachedClassBinding(aClass, accessor, originalType); + binding = createClassBinding(aClass, accessor, originalType); if (binding == null) { binding = new BeanBinding(aClass, accessor); } @@ -139,14 +139,14 @@ public class XmlSerializerImpl { private static Map, Binding> getBindingCacheMap() { Map, Binding> map = com.intellij.reference.SoftReference.dereference(ourBindings); if (map == null) { - map = new ConcurrentHashMap, Binding>(); + map = ContainerUtil.newConcurrentMap(); ourBindings = new SoftReference, Binding>>(map); } return map; } @Nullable - public static Binding getNonCachedClassBinding(@NotNull Class aClass, @Nullable MutableAccessor accessor, @NotNull Type originalType) { + public static Binding createClassBinding(@NotNull Class aClass, @Nullable MutableAccessor accessor, @NotNull Type originalType) { if (aClass.isArray()) { if (Element.class.isAssignableFrom(aClass.getComponentType())) { assert accessor != null; diff --git a/plugins/settings-repository/settings-repository-tests.iml b/plugins/settings-repository/settings-repository-tests.iml index bf4956784b19..a14f64481b52 100644 --- a/plugins/settings-repository/settings-repository-tests.iml +++ b/plugins/settings-repository/settings-repository-tests.iml @@ -19,7 +19,6 @@ - diff --git a/plugins/settings-repository/testSrc/LoadTest.kt b/plugins/settings-repository/testSrc/LoadTest.kt index 1e725a38e6d9..d4fceb4ab6ed 100644 --- a/plugins/settings-repository/testSrc/LoadTest.kt +++ b/plugins/settings-repository/testSrc/LoadTest.kt @@ -15,13 +15,9 @@ */ package org.jetbrains.settingsRepository.test -import com.intellij.configurationStore.SchemeManagerImpl -import com.intellij.configurationStore.TestScheme -import com.intellij.configurationStore.TestSchemesProcessor -import com.intellij.configurationStore.save +import com.intellij.configurationStore.* import com.intellij.testFramework.ProjectRule import com.intellij.util.toByteArray -import com.intellij.util.xmlb.serialize import org.assertj.core.api.Assertions.assertThat import org.eclipse.jgit.lib.Repository import org.jetbrains.settingsRepository.ReadonlySource