mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added helper class to workaround KT-9670
This commit is contained in:
@@ -130,7 +130,8 @@ open class StateStorageManagerImpl(private val rootTagName: String,
|
||||
}
|
||||
}
|
||||
|
||||
override final fun getStateStorage(storageSpec: Storage) = getOrCreateStorage(storageSpec.file, storageSpec.roamingType, storageSpec.storageClass.java as Class<out StateStorage>, storageSpec.stateSplitter.java)
|
||||
override final fun getStateStorage(storageSpec: Storage) = getOrCreateStorage(storageSpec.file, storageSpec.roamingType,
|
||||
JavaAnnotationHelperForKotlin.getStorageClass(storageSpec), JavaAnnotationHelperForKotlin.getStateSplitterClass(storageSpec))
|
||||
|
||||
protected open fun normalizeFileSpec(fileSpec: String): String {
|
||||
val path = FileUtilRt.toSystemIndependentName(fileSpec)
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.intellij.configurationStore;
|
||||
|
||||
import com.intellij.openapi.components.StateSplitter;
|
||||
import com.intellij.openapi.components.StateStorage;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
|
||||
/**
|
||||
* This class was introduced as a workaround for Kotlin bug (https://youtrack.jetbrains.com/issue/KT-9670) to avoid creation of
|
||||
* unnecessary instances of KClass
|
||||
* todo[nik] remove when KT-9670 is fixed
|
||||
*/
|
||||
public class JavaAnnotationHelperForKotlin {
|
||||
public static Class<? extends StateStorage> getStorageClass(Storage storage) {
|
||||
return storage.storageClass();
|
||||
}
|
||||
|
||||
public static Class<? extends StateSplitter> getStateSplitterClass(Storage storage) {
|
||||
return storage.stateSplitter();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user