From b719fd848fa38c75dbe5a83ce9763a9a66a2de62 Mon Sep 17 00:00:00 2001 From: nik Date: Mon, 17 Sep 2018 14:58:58 +0300 Subject: [PATCH] cleanup: sort modifiers in Kotlin files accordingly to Kotlin code conventions This fixes problems reported by 'Non-canonical modifier order' inspection. --- .../BaseInspectionProfileManager.kt | 4 +-- .../PrefixlessWebServerRootsProvider.kt | 2 +- .../SingleConnectionNetService.kt | 8 ++++-- .../io/webSocket/WebSocketProtocolHandler.kt | 8 +++--- .../src/ComponentInfo.kt | 6 ++-- .../src/ComponentStoreImpl.kt | 8 +++--- .../src/ComponentStoreWithExtraComponents.kt | 4 +-- .../src/DefaultProjectStoreImpl.kt | 2 +- .../src/DirectoryBasedStorage.kt | 5 ++-- .../src/ModuleStoreImpl.kt | 6 ++-- .../src/ProjectStoreImpl.kt | 22 +++++++-------- .../src/SaveSessionBase.kt | 2 +- .../src/SchemeManagerFactoryImpl.kt | 4 +-- .../src/StateStorageManagerImpl.kt | 8 +++--- .../src/StorageVirtualFileTracker.kt | 3 +- .../src/XmlElementStorage.kt | 4 +-- .../credential-store/src/kdbx/KdbxEntry.kt | 2 +- .../credential-store/src/kdbx/KdbxGroup.kt | 5 ++-- .../openapi/vcs/ex/LineStatusTrackerBase.kt | 6 ++-- .../execution/runners/GenericProgramRunner.kt | 2 +- .../execution/runners/ConsoleTitleGen.kt | 2 +- .../configurationStore/StateStorageBase.kt | 2 +- .../openapi/keymap/impl/DefaultKeymapImpl.kt | 2 +- .../openapi/keymap/impl/KeymapImpl.kt | 2 +- .../configurationStore/scheme-impl.kt | 2 +- .../backend/src/debugger/BreakpointBase.kt | 3 +- .../src/debugger/BreakpointManagerBase.kt | 6 ++-- .../backend/src/debugger/ScriptBase.kt | 3 +- .../src/debugger/StandaloneVmHelper.kt | 3 +- .../backend/src/debugger/SuspendContext.kt | 2 +- .../src/debugger/values/ValueManager.kt | 2 +- .../backend/src/rpc/CommandProcessor.kt | 2 +- .../debugger-ui/src/DebugProcessImpl.kt | 28 +++++++++---------- .../debugger-ui/src/DebuggerViewSupport.kt | 2 +- .../debugger-ui/src/VmConnection.kt | 2 +- .../protocol/protocol-reader/src/FileScope.kt | 2 +- .../com/intellij/testFramework/FixtureRule.kt | 4 +-- .../openapi/vcs/ex/LineStatusTracker.kt | 2 +- plugins/settings-repository/src/IcsManager.kt | 3 +- plugins/settings-repository/src/autoSync.kt | 5 ++-- .../src/git/dirCacheEditor.kt | 2 +- plugins/settings-repository/src/git/pull.kt | 2 +- .../python/run/PyBrowseActionListener.kt | 2 +- .../jetbrains/python/sdk/add/PyAddSdkPanel.kt | 2 +- .../python/testing/PyTestLegacyInterop.kt | 2 +- .../jetbrains/python/testing/PyTestsShared.kt | 2 +- .../evaluation/AbstractEvaluatorExtension.kt | 10 +++---- .../org/jetbrains/uast/values/UConstant.kt | 2 +- .../jetbrains/uast/values/UDependentValue.kt | 2 +- .../org/jetbrains/uast/values/UValueBase.kt | 2 +- .../JavaUCompositeQualifiedExpression.kt | 2 +- 51 files changed, 115 insertions(+), 105 deletions(-) diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt b/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt index 4639e9d54ab2..2a8d4b885090 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt @@ -18,7 +18,7 @@ abstract class BaseInspectionProfileManager(messageBus: MessageBus) : Inspectio private val severityRegistrar = SeverityRegistrar(messageBus) - override final fun getSeverityRegistrar() = severityRegistrar + final override fun getSeverityRegistrar() = severityRegistrar internal fun cleanupSchemes(project: Project) { for (profile in schemeManager.allSchemes) { @@ -42,7 +42,7 @@ abstract class BaseInspectionProfileManager(messageBus: MessageBus) : Inspectio } } - open protected fun schemeRemoved(scheme: InspectionProfileImpl) { + protected open fun schemeRemoved(scheme: InspectionProfileImpl) { } abstract fun fireProfileChanged(profile: InspectionProfileImpl) diff --git a/platform/built-in-server/src/org/jetbrains/builtInWebServer/PrefixlessWebServerRootsProvider.kt b/platform/built-in-server/src/org/jetbrains/builtInWebServer/PrefixlessWebServerRootsProvider.kt index 899b19233241..71df651a5e66 100644 --- a/platform/built-in-server/src/org/jetbrains/builtInWebServer/PrefixlessWebServerRootsProvider.kt +++ b/platform/built-in-server/src/org/jetbrains/builtInWebServer/PrefixlessWebServerRootsProvider.kt @@ -3,7 +3,7 @@ package org.jetbrains.builtInWebServer import com.intellij.openapi.project.Project abstract class PrefixlessWebServerRootsProvider : WebServerRootsProvider() { - override final fun resolve(path: String, project: Project, pathQuery: PathQuery): PathInfo? = resolve(path, project, WebServerPathToFileManager.getInstance(project).getResolver(path), pathQuery) + final override fun resolve(path: String, project: Project, pathQuery: PathQuery): PathInfo? = resolve(path, project, WebServerPathToFileManager.getInstance(project).getResolver(path), pathQuery) abstract fun resolve(path: String, project: Project, resolver: FileResolver, pathQuery: PathQuery): PathInfo? } \ No newline at end of file diff --git a/platform/built-in-server/src/org/jetbrains/builtInWebServer/SingleConnectionNetService.kt b/platform/built-in-server/src/org/jetbrains/builtInWebServer/SingleConnectionNetService.kt index 33590c2a0ab3..174e99e464c6 100644 --- a/platform/built-in-server/src/org/jetbrains/builtInWebServer/SingleConnectionNetService.kt +++ b/platform/built-in-server/src/org/jetbrains/builtInWebServer/SingleConnectionNetService.kt @@ -17,12 +17,14 @@ import java.util.concurrent.atomic.AtomicReference abstract class SingleConnectionNetService(project: Project) : NetService(project) { protected val processChannel: AtomicReference = AtomicReference() - private @Volatile var port = -1 - private @Volatile var bootstrap: Bootstrap? = null + @Volatile + private var port = -1 + @Volatile + private var bootstrap: Bootstrap? = null protected abstract fun configureBootstrap(bootstrap: Bootstrap, errorOutputConsumer: Consumer) - override final fun connectToProcess(promise: AsyncPromise, port: Int, processHandler: OSProcessHandler, errorOutputConsumer: Consumer) { + final override fun connectToProcess(promise: AsyncPromise, port: Int, processHandler: OSProcessHandler, errorOutputConsumer: Consumer) { val bootstrap = oioClientBootstrap() configureBootstrap(bootstrap, errorOutputConsumer) diff --git a/platform/built-in-server/src/org/jetbrains/io/webSocket/WebSocketProtocolHandler.kt b/platform/built-in-server/src/org/jetbrains/io/webSocket/WebSocketProtocolHandler.kt index aa1148abd85c..802cffc70191 100644 --- a/platform/built-in-server/src/org/jetbrains/io/webSocket/WebSocketProtocolHandler.kt +++ b/platform/built-in-server/src/org/jetbrains/io/webSocket/WebSocketProtocolHandler.kt @@ -11,7 +11,7 @@ import org.jetbrains.builtInWebServer.LOG import org.jetbrains.io.NettyUtil abstract class WebSocketProtocolHandler : ChannelInboundHandlerAdapter() { - override final fun channelRead(context: ChannelHandlerContext, message: Any) { + final override fun channelRead(context: ChannelHandlerContext, message: Any) { // Pong frames need to get ignored when (message) { !is WebSocketFrame, is PongWebSocketFrame -> ReferenceCountUtil.release(message) @@ -32,7 +32,7 @@ abstract class WebSocketProtocolHandler : ChannelInboundHandlerAdapter() { } } - abstract protected fun textFrameReceived(channel: Channel, message: TextWebSocketFrame) + protected abstract fun textFrameReceived(channel: Channel, message: TextWebSocketFrame) protected open fun closeFrameReceived(channel: Channel, message: CloseWebSocketFrame) { channel.close() @@ -45,7 +45,7 @@ abstract class WebSocketProtocolHandler : ChannelInboundHandlerAdapter() { } open class WebSocketProtocolHandshakeHandler(private val handshaker: WebSocketClientHandshaker) : ChannelInboundHandlerAdapter() { - override final fun channelRead(context: ChannelHandlerContext, message: Any) { + final override fun channelRead(context: ChannelHandlerContext, message: Any) { val channel = context.channel() if (!handshaker.isHandshakeComplete) { handshaker.finishHandshake(channel, message as FullHttpResponse) @@ -63,6 +63,6 @@ open class WebSocketProtocolHandshakeHandler(private val handshaker: WebSocketCl context.fireChannelRead(message) } - open protected fun completed() { + protected open fun completed() { } } \ No newline at end of file diff --git a/platform/configuration-store-impl/src/ComponentInfo.kt b/platform/configuration-store-impl/src/ComponentInfo.kt index 58c42753685a..0a2996f5c861 100644 --- a/platform/configuration-store-impl/src/ComponentInfo.kt +++ b/platform/configuration-store-impl/src/ComponentInfo.kt @@ -53,11 +53,11 @@ internal class ComponentInfoImpl(override val component: Any, override val state } private abstract class ModificationTrackerAwareComponentInfo : ComponentInfo() { - override final val isModificationTrackingSupported = true + final override val isModificationTrackingSupported = true - override abstract var lastModificationCount: Long + abstract override var lastModificationCount: Long - override final fun updateModificationCount(newCount: Long) { + final override fun updateModificationCount(newCount: Long) { lastModificationCount = newCount } } diff --git a/platform/configuration-store-impl/src/ComponentStoreImpl.kt b/platform/configuration-store-impl/src/ComponentStoreImpl.kt index 8358aef8c44f..bef6d6f3bac3 100644 --- a/platform/configuration-store-impl/src/ComponentStoreImpl.kt +++ b/platform/configuration-store-impl/src/ComponentStoreImpl.kt @@ -79,7 +79,7 @@ abstract class ComponentStoreImpl : IComponentStore { open val loadPolicy: StateLoadPolicy get() = StateLoadPolicy.LOAD - override abstract val storageManager: StateStorageManager + abstract override val storageManager: StateStorageManager internal fun getComponents(): Map { return components @@ -128,7 +128,7 @@ abstract class ComponentStoreImpl : IComponentStore { return componentName } - override final fun save(readonlyFiles: MutableList, isForce: Boolean) { + final override fun save(readonlyFiles: MutableList, isForce: Boolean) { val errors: MutableList = SmartList() beforeSaveComponents(errors) @@ -464,13 +464,13 @@ abstract class ComponentStoreImpl : IComponentStore { return notReloadableComponents ?: emptySet() } - override final fun reloadStates(componentNames: Set, messageBus: MessageBus) { + final override fun reloadStates(componentNames: Set, messageBus: MessageBus) { runBatchUpdate(messageBus) { reinitComponents(componentNames) } } - override final fun reloadState(componentClass: Class>) { + final override fun reloadState(componentClass: Class>) { val stateSpec = StoreUtil.getStateSpecOrError(componentClass) val info = components.get(stateSpec.name) ?: return (info.component as? PersistentStateComponent<*>)?.let { diff --git a/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt b/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt index e29dc6b081b3..af5852c97def 100644 --- a/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt +++ b/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt @@ -15,7 +15,7 @@ abstract class ComponentStoreWithExtraComponents : ComponentStoreImpl() { super.initComponent(component, isService) } - override final fun beforeSaveComponents(errors: MutableList) { + final override fun beforeSaveComponents(errors: MutableList) { // component state uses scheme manager in an ipr project, so, we must save it before val isIprProject = project?.let { !it.isDirectoryBased } ?: false if (isIprProject) { @@ -30,7 +30,7 @@ abstract class ComponentStoreWithExtraComponents : ComponentStoreImpl() { } } - override final fun afterSaveComponents(errors: MutableList) { + final override fun afterSaveComponents(errors: MutableList) { val isIprProject = project?.let { !it.isDirectoryBased } ?: false for (settingsSavingComponent in settingsSavingComponents) { if (!isIprProject || settingsSavingComponent !is SchemeManagerFactoryBase) { diff --git a/platform/configuration-store-impl/src/DefaultProjectStoreImpl.kt b/platform/configuration-store-impl/src/DefaultProjectStoreImpl.kt index 0de22a176b5f..eb28d955124a 100644 --- a/platform/configuration-store-impl/src/DefaultProjectStoreImpl.kt +++ b/platform/configuration-store-impl/src/DefaultProjectStoreImpl.kt @@ -17,7 +17,7 @@ private class DefaultProjectStorage(file: Path, fileSpec: String, pathMacroManag override val isUseVfsForWrite: Boolean get() = false - override public fun loadLocalData(): Element? { + public override fun loadLocalData(): Element? { val element = super.loadLocalData() ?: return null try { return element.getChild("component").getChild("defaultProject") diff --git a/platform/configuration-store-impl/src/DirectoryBasedStorage.kt b/platform/configuration-store-impl/src/DirectoryBasedStorage.kt index 271846e40a2f..5b4152e75c7d 100644 --- a/platform/configuration-store-impl/src/DirectoryBasedStorage.kt +++ b/platform/configuration-store-impl/src/DirectoryBasedStorage.kt @@ -31,7 +31,7 @@ abstract class DirectoryBasedStorageBase(@Suppress("DEPRECATION") protected val protected abstract val virtualFile: VirtualFile? - override public fun loadData(): StateMap = StateMap.fromMap(DirectoryStorageUtil.loadFrom(virtualFile, pathMacroSubstitutor)) + public override fun loadData(): StateMap = StateMap.fromMap(DirectoryStorageUtil.loadFrom(virtualFile, pathMacroSubstitutor)) override fun createSaveSessionProducer(): StateStorage.SaveSessionProducer? = null @@ -79,7 +79,8 @@ abstract class DirectoryBasedStorageBase(@Suppress("DEPRECATION") protected val open class DirectoryBasedStorage(private val dir: Path, @Suppress("DEPRECATION") splitter: StateSplitter, pathMacroSubstitutor: TrackingPathMacroSubstitutor? = null) : DirectoryBasedStorageBase(splitter, pathMacroSubstitutor) { - private @Volatile var cachedVirtualFile: VirtualFile? = null + @Volatile + private var cachedVirtualFile: VirtualFile? = null override val virtualFile: VirtualFile? get() { diff --git a/platform/configuration-store-impl/src/ModuleStoreImpl.kt b/platform/configuration-store-impl/src/ModuleStoreImpl.kt index a4f90d2f9881..f4087d45ebc0 100644 --- a/platform/configuration-store-impl/src/ModuleStoreImpl.kt +++ b/platform/configuration-store-impl/src/ModuleStoreImpl.kt @@ -17,7 +17,7 @@ private open class ModuleStoreImpl(module: Module, private val pathMacroManager: override val storageManager = ModuleStateStorageManager(TrackingPathMacroSubstitutorImpl(pathMacroManager), module) - override final fun getPathMacroManagerForDefaults() = pathMacroManager + final override fun getPathMacroManagerForDefaults() = pathMacroManager // todo what about Upsource? For now this implemented not in the ModuleStoreBase because `project` and `module` are available only in this class (ModuleStoreImpl) override fun getStorageSpecs(component: PersistentStateComponent, stateSpec: State, operation: StateStorageOperation): List { @@ -49,7 +49,7 @@ private class TestModuleStore(module: Module, pathMacroManager: PathMacroManager // used in upsource abstract class ModuleStoreBase : ComponentStoreImpl(), ModuleStore { - override abstract val storageManager: StateStorageManagerImpl + abstract override val storageManager: StateStorageManagerImpl override fun getStorageSpecs(component: PersistentStateComponent, stateSpec: State, operation: StateStorageOperation): List { val storages = stateSpec.storages @@ -61,7 +61,7 @@ abstract class ModuleStoreBase : ComponentStoreImpl(), ModuleStore { } } - override final fun setPath(path: String) { + final override fun setPath(path: String) { setPath(path, false) } diff --git a/platform/configuration-store-impl/src/ProjectStoreImpl.kt b/platform/configuration-store-impl/src/ProjectStoreImpl.kt index 13b156204dc3..00339c6adf9f 100644 --- a/platform/configuration-store-impl/src/ProjectStoreImpl.kt +++ b/platform/configuration-store-impl/src/ProjectStoreImpl.kt @@ -49,23 +49,23 @@ internal val PROJECT_FILE_STORAGE_ANNOTATION = FileStorageAnnotation(PROJECT_FIL internal val DEPRECATED_PROJECT_FILE_STORAGE_ANNOTATION = FileStorageAnnotation(PROJECT_FILE, true) // cannot be `internal`, used in Upsource -abstract class ProjectStoreBase(override final val project: ProjectImpl) : ComponentStoreWithExtraComponents(), IProjectStore { +abstract class ProjectStoreBase(final override val project: ProjectImpl) : ComponentStoreWithExtraComponents(), IProjectStore { // protected setter used in upsource // Zelix KlassMaster - ERROR: Could not find method 'getScheme()' var scheme: StorageScheme = StorageScheme.DEFAULT - override final var loadPolicy: StateLoadPolicy = StateLoadPolicy.LOAD + final override var loadPolicy: StateLoadPolicy = StateLoadPolicy.LOAD - override final fun isOptimiseTestLoadSpeed(): Boolean = loadPolicy != StateLoadPolicy.LOAD + final override fun isOptimiseTestLoadSpeed(): Boolean = loadPolicy != StateLoadPolicy.LOAD - override final fun getStorageScheme(): StorageScheme = scheme + final override fun getStorageScheme(): StorageScheme = scheme - override abstract val storageManager: StateStorageManagerImpl + abstract override val storageManager: StateStorageManagerImpl protected val isDirectoryBased: Boolean get() = scheme == StorageScheme.DIRECTORY_BASED - override final fun setOptimiseTestLoadSpeed(value: Boolean) { + final override fun setOptimiseTestLoadSpeed(value: Boolean) { // we don't load default state in tests as app store does because // 1) we should not do it // 2) it was so before, so, we preserve old behavior (otherwise RunManager will load template run configurations) @@ -79,13 +79,13 @@ abstract class ProjectStoreBase(override final val project: ProjectImpl) : Compo */ override fun getProjectConfigDir(): String? = if (isDirectoryBased) storageManager.expandMacro(PROJECT_CONFIG_DIR) else null - override final fun getWorkspaceFilePath(): String = storageManager.expandMacro(StoragePathMacros.WORKSPACE_FILE) + final override fun getWorkspaceFilePath(): String = storageManager.expandMacro(StoragePathMacros.WORKSPACE_FILE) - override final fun clearStorages() { + final override fun clearStorages() { storageManager.clearStorages() } - override final fun loadProjectFromTemplate(defaultProject: Project) { + final override fun loadProjectFromTemplate(defaultProject: Project) { defaultProject.save() val element = (defaultProject.stateStore as DefaultProjectStoreImpl).getStateCopy() ?: return @@ -102,7 +102,7 @@ abstract class ProjectStoreBase(override final val project: ProjectImpl) : Compo (storageManager.getOrCreateStorage(PROJECT_FILE) as XmlElementStorage).setDefaultState(element) } - override final fun getProjectBasePath(): String { + final override fun getProjectBasePath(): String { if (isDirectoryBased) { val path = PathUtilRt.getParentPath(storageManager.expandMacro(PROJECT_CONFIG_DIR)) if (Registry.`is`("store.basedir.parent.detection", true) && PathUtilRt.getFileName(path).startsWith("${Project.DIRECTORY_STORE_FOLDER}.")) { @@ -253,7 +253,7 @@ private open class ProjectStoreImpl(project: ProjectImpl, private val pathMacroM assert(!project.isDefault) } - override final fun getPathMacroManagerForDefaults() = pathMacroManager + final override fun getPathMacroManagerForDefaults() = pathMacroManager override val storageManager = ProjectStateStorageManager(TrackingPathMacroSubstitutorImpl(pathMacroManager), project) diff --git a/platform/configuration-store-impl/src/SaveSessionBase.kt b/platform/configuration-store-impl/src/SaveSessionBase.kt index 5a5a10980e3f..25a0c62ac347 100644 --- a/platform/configuration-store-impl/src/SaveSessionBase.kt +++ b/platform/configuration-store-impl/src/SaveSessionBase.kt @@ -10,7 +10,7 @@ import com.intellij.openapi.vfs.SafeWriteRequestor import org.jdom.Element abstract class SaveSessionBase : StateStorage.SaveSession, StateStorage.SaveSessionProducer, SafeWriteRequestor, LargeFileWriteRequestor { - override final fun setState(component: Any?, componentName: String, state: Any?) { + final override fun setState(component: Any?, componentName: String, state: Any?) { if (state == null) { setSerializedState(componentName, null) return diff --git a/platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt b/platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt index 7c9f42b971e4..deb619d80379 100644 --- a/platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt +++ b/platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt @@ -30,7 +30,7 @@ sealed class SchemeManagerFactoryBase : SchemeManagerFactory(), SettingsSavingCo protected open fun createFileChangeSubscriber(): ((schemeManager: SchemeManagerImpl<*, *>) -> Unit)? = null - override final fun create(directoryName: String, + final override fun create(directoryName: String, processor: SchemeProcessor, presentableName: String?, roamingType: RoamingType, @@ -84,7 +84,7 @@ sealed class SchemeManagerFactoryBase : SchemeManagerFactory(), SettingsSavingCo } } - override final fun save() { + final override fun save() { val errors = SmartList() for (registeredManager in managers) { try { diff --git a/platform/configuration-store-impl/src/StateStorageManagerImpl.kt b/platform/configuration-store-impl/src/StateStorageManagerImpl.kt index ea1d8b5017a8..35f0a488ddac 100644 --- a/platform/configuration-store-impl/src/StateStorageManagerImpl.kt +++ b/platform/configuration-store-impl/src/StateStorageManagerImpl.kt @@ -34,7 +34,7 @@ private val MACRO_PATTERN = Pattern.compile("(\\$[^$]*\\$)") * If componentManager not specified, storage will not add file tracker */ open class StateStorageManagerImpl(private val rootTagName: String, - override final val macroSubstitutor: TrackingPathMacroSubstitutor? = null, + final override val macroSubstitutor: TrackingPathMacroSubstitutor? = null, override val componentManager: ComponentManager? = null, private val virtualFileTracker: StorageVirtualFileTracker? = StateStorageManagerImpl.createDefaultVirtualTracker(componentManager)) : StateStorageManager { private val macros: MutableList = ContainerUtil.createLockFreeCopyOnWriteList() @@ -131,7 +131,7 @@ open class StateStorageManagerImpl(private val rootTagName: String, } @Suppress("CAST_NEVER_SUCCEEDS") - override final fun getStateStorage(storageSpec: Storage): StateStorage = getOrCreateStorage( + final override fun getStateStorage(storageSpec: Storage): StateStorage = getOrCreateStorage( storageSpec.path, storageSpec.roamingType, storageSpec.storageClass.java, @@ -337,7 +337,7 @@ open class StateStorageManagerImpl(private val rootTagName: String, protected open fun beforeElementLoaded(element: Element) { } - override final fun rename(path: String, newName: String) { + final override fun rename(path: String, newName: String) { storageLock.write { val storage = getOrCreateStorage(collapseMacros(path), RoamingType.DEFAULT) as FileBasedStorage @@ -417,7 +417,7 @@ open class StateStorageManagerImpl(private val rootTagName: String, return normalizeFileSpec(result) } - override final fun getOldStorage(component: Any, componentName: String, operation: StateStorageOperation): StateStorage? { + final override fun getOldStorage(component: Any, componentName: String, operation: StateStorageOperation): StateStorage? { val oldStorageSpec = getOldStorageSpec(component, componentName, operation) ?: return null return getOrCreateStorage(oldStorageSpec, RoamingType.DEFAULT) } diff --git a/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt b/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt index 0e303dc2eaf9..a715c0dbc9fe 100644 --- a/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt +++ b/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt @@ -15,7 +15,8 @@ import java.util.concurrent.atomic.AtomicBoolean class StorageVirtualFileTracker(private val messageBus: MessageBus) { private val filePathToStorage: ConcurrentMap = ContainerUtil.newConcurrentMap() - private @Volatile var hasDirectoryBasedStorages = false + @Volatile + private var hasDirectoryBasedStorages = false private val vfsListenerAdded = AtomicBoolean() diff --git a/platform/configuration-store-impl/src/XmlElementStorage.kt b/platform/configuration-store-impl/src/XmlElementStorage.kt index 06754b860c86..185e7d5b6e82 100644 --- a/platform/configuration-store-impl/src/XmlElementStorage.kt +++ b/platform/configuration-store-impl/src/XmlElementStorage.kt @@ -34,7 +34,7 @@ abstract class XmlElementStorage protected constructor(val fileSpec: String, protected abstract fun loadLocalData(): Element? - override final fun getSerializedState(storageData: StateMap, component: Any?, componentName: String, archive: Boolean): Element? = storageData.getState(componentName, archive) + final override fun getSerializedState(storageData: StateMap, component: Any?, componentName: String, archive: Boolean): Element? = storageData.getState(componentName, archive) override fun archiveState(storageData: StateMap, componentName: String, serializedState: Element?) { storageData.archive(componentName, serializedState) @@ -396,7 +396,7 @@ internal fun DataWriter?.writeTo(file: Path, lineSeparator: String = LineSeparat } internal abstract class StringDataWriter : DataWriter { - override final fun write(output: OutputStream, lineSeparator: String, filter: DataWriterFilter?) { + final override fun write(output: OutputStream, lineSeparator: String, filter: DataWriterFilter?) { output.bufferedWriter().use { write(it, lineSeparator, filter) } diff --git a/platform/credential-store/src/kdbx/KdbxEntry.kt b/platform/credential-store/src/kdbx/KdbxEntry.kt index 4a39e6a4aa68..b5c338efe269 100644 --- a/platform/credential-store/src/kdbx/KdbxEntry.kt +++ b/platform/credential-store/src/kdbx/KdbxEntry.kt @@ -22,7 +22,7 @@ import org.jdom.Element private const val VALUE_ELEMENT_NAME = "Value" -internal class KdbxEntry(private val element: Element, private val database: KeePassDatabase, internal @Volatile var group: KdbxGroup?) { +internal class KdbxEntry(private val element: Element, private val database: KeePassDatabase, @Volatile internal var group: KdbxGroup?) { @Volatile var title: String? = element.removeProperty("Title") set(value) { if (field != value) { diff --git a/platform/credential-store/src/kdbx/KdbxGroup.kt b/platform/credential-store/src/kdbx/KdbxGroup.kt index 847d95f14221..061d4fad69be 100644 --- a/platform/credential-store/src/kdbx/KdbxGroup.kt +++ b/platform/credential-store/src/kdbx/KdbxGroup.kt @@ -11,7 +11,7 @@ import java.time.Instant import java.time.LocalDateTime import java.time.ZoneOffset -internal class KdbxGroup(private val element: Element, private val database: KeePassDatabase, private @Volatile var parent: KdbxGroup?) { +internal class KdbxGroup(private val element: Element, private val database: KeePassDatabase, @Volatile private var parent: KdbxGroup?) { @Volatile var name: String = element.getChildText(NAME_ELEMENT_NAME) ?: "Unnamed" set(value) { if (field != value) { @@ -23,7 +23,8 @@ internal class KdbxGroup(private val element: Element, private val database: Kee private val groups: MutableList val entries: MutableList - private @Volatile var locationChanged = element.get("Times")?.get("LocationChanged")?.text?.let(::parseTime) ?: 0 + @Volatile + private var locationChanged = element.get("Times")?.get("LocationChanged")?.text?.let(::parseTime) ?: 0 init { locationChanged = element.get("Times")?.get("LocationChanged")?.text?.let(::parseTime) ?: 0 diff --git a/platform/diff-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerBase.kt b/platform/diff-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerBase.kt index a0f9b2597f8a..fe9b1bb151fe 100644 --- a/platform/diff-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerBase.kt +++ b/platform/diff-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerBase.kt @@ -81,7 +81,7 @@ abstract class LineStatusTrackerBase { open val virtualFile: VirtualFile? get() = null - abstract protected fun Block.toRange(): R + protected abstract fun Block.toRange(): R protected open fun createDocumentTrackerHandler(): DocumentTracker.Handler = MyDocumentTrackerHandler() @@ -399,8 +399,8 @@ abstract class LineStatusTrackerBase { protected open class BlockData(internal var innerRanges: List? = null) - open protected fun createBlockData(): BlockData = BlockData() - open protected val Block.ourData: BlockData get() = getBlockData(this) + protected open fun createBlockData(): BlockData = BlockData() + protected open val Block.ourData: BlockData get() = getBlockData(this) protected fun getBlockData(block: Block): BlockData { if (block.data == null) block.data = createBlockData() return block.data as BlockData diff --git a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.kt b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.kt index 0693406f6ead..c028303bf984 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.kt +++ b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.kt @@ -34,7 +34,7 @@ abstract class GenericProgramRunner : BaseProgramRunn } abstract class AsyncProgramRunner : BaseProgramRunner() { - override final fun execute(environment: ExecutionEnvironment, callback: ProgramRunner.Callback?, state: RunProfileState) { + final override fun execute(environment: ExecutionEnvironment, callback: ProgramRunner.Callback?, state: RunProfileState) { startRunProfile(environment, state, callback, runProfileStarter { execute(environment, state) }) } diff --git a/platform/lang-impl/src/com/intellij/execution/runners/ConsoleTitleGen.kt b/platform/lang-impl/src/com/intellij/execution/runners/ConsoleTitleGen.kt index e203e29530cb..ff2a2049e69a 100644 --- a/platform/lang-impl/src/com/intellij/execution/runners/ConsoleTitleGen.kt +++ b/platform/lang-impl/src/com/intellij/execution/runners/ConsoleTitleGen.kt @@ -55,7 +55,7 @@ open class ConsoleTitleGen @JvmOverloads constructor(private val myProject: Proj } - open protected fun getActiveConsoles(consoleTitle: String): List { + protected open fun getActiveConsoles(consoleTitle: String): List { val consoles = ExecutionHelper.collectConsolesByDisplayName(myProject) { dom -> dom.contains(consoleTitle) } return consoles.filter({ input -> diff --git a/platform/platform-impl/src/com/intellij/configurationStore/StateStorageBase.kt b/platform/platform-impl/src/com/intellij/configurationStore/StateStorageBase.kt index 33641b5ec0b3..f30d9623cde3 100644 --- a/platform/platform-impl/src/com/intellij/configurationStore/StateStorageBase.kt +++ b/platform/platform-impl/src/com/intellij/configurationStore/StateStorageBase.kt @@ -32,7 +32,7 @@ abstract class StateStorageBase : StateStorage { protected abstract fun hasState(storageData: T, componentName: String): Boolean - override final fun hasState(componentName: String, reloadData: Boolean): Boolean { + final override fun hasState(componentName: String, reloadData: Boolean): Boolean { return hasState(getStorageData(reloadData), componentName) } diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymapImpl.kt b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymapImpl.kt index 5d4d834f4a48..5ccb9bb2e4af 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymapImpl.kt +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymapImpl.kt @@ -26,7 +26,7 @@ import org.jdom.Element import java.awt.event.MouseEvent open class DefaultKeymapImpl(dataHolder: SchemeDataHolder, private val defaultKeymapManager: DefaultKeymap) : KeymapImpl(dataHolder) { - override final var canModify: Boolean + final override var canModify: Boolean get() = false set(value) { // ignore diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.kt b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.kt index a44e240aa753..9afcdfcb200b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.kt +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.kt @@ -181,7 +181,7 @@ open class KeymapImpl @JvmOverloads constructor(private var dataHolder: SchemeDa override fun getParent(): KeymapImpl? = parent - override final fun canModify(): Boolean = canModify + final override fun canModify(): Boolean = canModify override fun addShortcut(actionId: String, shortcut: Shortcut) { val list = actionIdToShortcuts.getOrPut(actionId) { diff --git a/platform/projectModel-impl/src/com/intellij/configurationStore/scheme-impl.kt b/platform/projectModel-impl/src/com/intellij/configurationStore/scheme-impl.kt index c0334ffc4d81..87f559099422 100644 --- a/platform/projectModel-impl/src/com/intellij/configurationStore/scheme-impl.kt +++ b/platform/projectModel-impl/src/com/intellij/configurationStore/scheme-impl.kt @@ -111,7 +111,7 @@ abstract class SchemeWrapper(name: String) : ExternalizableSchemeAdapter( abstract class LazySchemeWrapper(name: String, dataHolder: SchemeDataHolder>, protected val writer: (scheme: T) -> Element) : SchemeWrapper(name) { protected val dataHolder: AtomicReference>> = AtomicReference(dataHolder) - override final fun writeScheme(): Element { + final override fun writeScheme(): Element { val dataHolder = dataHolder.get() @Suppress("IfThenToElvis") return if (dataHolder == null) writer(scheme) else dataHolder.read() diff --git a/platform/script-debugger/backend/src/debugger/BreakpointBase.kt b/platform/script-debugger/backend/src/debugger/BreakpointBase.kt index 3e19f551a4b4..cd995190ff96 100644 --- a/platform/script-debugger/backend/src/debugger/BreakpointBase.kt +++ b/platform/script-debugger/backend/src/debugger/BreakpointBase.kt @@ -29,7 +29,8 @@ abstract class BreakpointBase(override val target: BreakpointTarget, * Whether the breakpoint data have changed with respect * to the JavaScript VM data */ - protected @Volatile var dirty: Boolean = false + @Volatile + protected var dirty: Boolean = false override val isResolved: Boolean get() = !actualLocations.isEmpty() diff --git a/platform/script-debugger/backend/src/debugger/BreakpointManagerBase.kt b/platform/script-debugger/backend/src/debugger/BreakpointManagerBase.kt index 91175cf31073..19f4749c0286 100644 --- a/platform/script-debugger/backend/src/debugger/BreakpointManagerBase.kt +++ b/platform/script-debugger/backend/src/debugger/BreakpointManagerBase.kt @@ -60,7 +60,7 @@ abstract class BreakpointManagerBase> : BreakpointManager return BreakpointManager.BreakpointCreated(breakpoint, promise) } - override final fun remove(breakpoint: Breakpoint): Promise<*> { + final override fun remove(breakpoint: Breakpoint): Promise<*> { @Suppress("UNCHECKED_CAST") val b = breakpoint as T val existed = breakpoints.remove(b) @@ -70,7 +70,7 @@ abstract class BreakpointManagerBase> : BreakpointManager return if (!existed || !b.isVmRegistered()) nullPromise() else doClearBreakpoint(b) } - override final fun removeAll(): Promise<*> { + final override fun removeAll(): Promise<*> { val list = breakpoints.toList() breakpoints.clear() breakpointDuplicationByTarget.clear() @@ -85,7 +85,7 @@ abstract class BreakpointManagerBase> : BreakpointManager protected abstract fun doClearBreakpoint(breakpoint: T): Promise<*> - override final fun addBreakpointListener(listener: BreakpointListener) { + final override fun addBreakpointListener(listener: BreakpointListener) { dispatcher.addListener(listener) } diff --git a/platform/script-debugger/backend/src/debugger/ScriptBase.kt b/platform/script-debugger/backend/src/debugger/ScriptBase.kt index 2dff49250bb6..0f41a9cf6e76 100755 --- a/platform/script-debugger/backend/src/debugger/ScriptBase.kt +++ b/platform/script-debugger/backend/src/debugger/ScriptBase.kt @@ -28,7 +28,8 @@ abstract class ScriptBase(override val type: Script.Type, override val line: Int = Math.max(line, 0) @SuppressWarnings("UnusedDeclaration") - private @Volatile var source: Promise? = null + @Volatile + private var source: Promise? = null override var sourceMap: SourceMap? = null diff --git a/platform/script-debugger/backend/src/debugger/StandaloneVmHelper.kt b/platform/script-debugger/backend/src/debugger/StandaloneVmHelper.kt index d7c5df3bb94a..1d7889ef7f9b 100644 --- a/platform/script-debugger/backend/src/debugger/StandaloneVmHelper.kt +++ b/platform/script-debugger/backend/src/debugger/StandaloneVmHelper.kt @@ -14,7 +14,8 @@ import org.jetbrains.rpc.LOG import org.jetbrains.rpc.MessageProcessor open class StandaloneVmHelper(private val vm: Vm, private val messageProcessor: MessageProcessor, channel: Channel) : AttachStateManager { - private @Volatile var channel: Channel? = channel + @Volatile + private var channel: Channel? = channel fun getChannelIfActive(): Channel? { val currentChannel = channel diff --git a/platform/script-debugger/backend/src/debugger/SuspendContext.kt b/platform/script-debugger/backend/src/debugger/SuspendContext.kt index 4158e032d653..bc510650075d 100755 --- a/platform/script-debugger/backend/src/debugger/SuspendContext.kt +++ b/platform/script-debugger/backend/src/debugger/SuspendContext.kt @@ -46,7 +46,7 @@ interface SuspendContext { } abstract class ContextDependentAsyncResultConsumer(private val context: SuspendContext<*>) : java.util.function.Consumer { - override final fun accept(result: T) { + final override fun accept(result: T) { val vm = context.vm if (vm.attachStateManager.isAttached && !vm.suspendContextManager.isContextObsolete(context)) { accept(result, vm) diff --git a/platform/script-debugger/backend/src/debugger/values/ValueManager.kt b/platform/script-debugger/backend/src/debugger/values/ValueManager.kt index 2b6fbc557433..4d7eb2486dbd 100644 --- a/platform/script-debugger/backend/src/debugger/values/ValueManager.kt +++ b/platform/script-debugger/backend/src/debugger/values/ValueManager.kt @@ -35,7 +35,7 @@ abstract class ValueManager() : Obsolescent { fun getCacheStamp(): Int = cacheStamp.get() - override final fun isObsolete(): Boolean = obsolete + final override fun isObsolete(): Boolean = obsolete fun markObsolete() { obsolete = true diff --git a/platform/script-debugger/backend/src/rpc/CommandProcessor.kt b/platform/script-debugger/backend/src/rpc/CommandProcessor.kt index 029fc92140d6..6c5cff13578c 100644 --- a/platform/script-debugger/backend/src/rpc/CommandProcessor.kt +++ b/platform/script-debugger/backend/src/rpc/CommandProcessor.kt @@ -31,7 +31,7 @@ abstract class CommandProcessor doSend(message: Request, callback: RequestPromise) { + final override fun doSend(message: Request, callback: RequestPromise) { messageManager.send(message, callback) } } diff --git a/platform/script-debugger/debugger-ui/src/DebugProcessImpl.kt b/platform/script-debugger/debugger-ui/src/DebugProcessImpl.kt index cae1ddfd6da8..3fb9e5dac21c 100644 --- a/platform/script-debugger/debugger-ui/src/DebugProcessImpl.kt +++ b/platform/script-debugger/debugger-ui/src/DebugProcessImpl.kt @@ -66,22 +66,22 @@ abstract class DebugProcessImpl>(session: XDebugSession, protected val realProcessHandler: ProcessHandler? get() = executionResult?.processHandler - override final fun getSmartStepIntoHandler(): XSmartStepIntoHandler<*>? = smartStepIntoHandler + final override fun getSmartStepIntoHandler(): XSmartStepIntoHandler<*>? = smartStepIntoHandler - override final fun getBreakpointHandlers(): Array> = when (connection.state.status) { + final override fun getBreakpointHandlers(): Array> = when (connection.state.status) { ConnectionStatus.DISCONNECTED, ConnectionStatus.DETACHED, ConnectionStatus.CONNECTION_FAILED -> XBreakpointHandler.EMPTY_ARRAY else -> _breakpointHandlers } - override final fun getEditorsProvider(): XDebuggerEditorsProvider = editorsProvider + final override fun getEditorsProvider(): XDebuggerEditorsProvider = editorsProvider val vm: Vm? get() = connection.vm - override final val mainVm: Vm? + final override val mainVm: Vm? get() = connection.vm - override final val activeOrMainVm: Vm? + final override val activeOrMainVm: Vm? get() = (session.suspendContext?.activeExecutionStack as? ExecutionStackView)?.suspendContext?.vm ?: mainVm init { @@ -116,11 +116,11 @@ abstract class DebugProcessImpl>(session: XDebugSession, lastCallFrame = vm.suspendContextManager.context?.topFrame } - override final fun checkCanPerformCommands(): Boolean = activeOrMainVm != null + final override fun checkCanPerformCommands(): Boolean = activeOrMainVm != null - override final fun isValuesCustomSorted(): Boolean = true + final override fun isValuesCustomSorted(): Boolean = true - override final fun startStepOver(context: XSuspendContext?) { + final override fun startStepOver(context: XSuspendContext?) { val vm = context.vm updateLastCallFrame(vm) continueVm(vm, StepAction.OVER) @@ -129,18 +129,18 @@ abstract class DebugProcessImpl>(session: XDebugSession, val XSuspendContext?.vm: Vm get() = (this as? SuspendContextView)?.activeVm ?: mainVm!! - override final fun startForceStepInto(context: XSuspendContext?) { + final override fun startForceStepInto(context: XSuspendContext?) { isForceStep = true startStepInto(context) } - override final fun startStepInto(context: XSuspendContext?) { + final override fun startStepInto(context: XSuspendContext?) { val vm = context.vm updateLastCallFrame(vm) continueVm(vm, StepAction.IN) } - override final fun startStepOut(context: XSuspendContext?) { + final override fun startStepOut(context: XSuspendContext?) { val vm = context.vm if (isVmStepOutCorrect()) { lastCallFrame = null @@ -195,14 +195,14 @@ abstract class DebugProcessImpl>(session: XDebugSession, } } - override final fun startPausing() { + final override fun startPausing() { activeOrMainVm!!.suspendContextManager.suspend() .onError(RejectErrorReporter(session, "Cannot pause")) } - override final fun getCurrentStateMessage(): String = connection.state.message + final override fun getCurrentStateMessage(): String = connection.state.message - override final fun getCurrentStateHyperlinkListener(): HyperlinkListener? = connection.state.messageLinkListener + final override fun getCurrentStateHyperlinkListener(): HyperlinkListener? = connection.state.messageLinkListener override fun doGetProcessHandler(): ProcessHandler = executionResult?.processHandler ?: object : DefaultDebugProcessHandler() { override fun isSilentlyDestroyOnClose() = true } diff --git a/platform/script-debugger/debugger-ui/src/DebuggerViewSupport.kt b/platform/script-debugger/debugger-ui/src/DebuggerViewSupport.kt index 874e13dce88d..93fbc2d8a9e6 100644 --- a/platform/script-debugger/debugger-ui/src/DebuggerViewSupport.kt +++ b/platform/script-debugger/debugger-ui/src/DebuggerViewSupport.kt @@ -57,7 +57,7 @@ interface DebuggerViewSupport { } open class PromiseDebuggerEvaluator(protected val context: VariableContext) : XDebuggerEvaluator() { - override final fun evaluate(expression: String, callback: XDebuggerEvaluator.XEvaluationCallback, expressionPosition: XSourcePosition?) { + final override fun evaluate(expression: String, callback: XDebuggerEvaluator.XEvaluationCallback, expressionPosition: XSourcePosition?) { try { evaluate(expression, expressionPosition) .onSuccess { callback.evaluated(VariableView(VariableImpl(expression, it.value), context)) } diff --git a/platform/script-debugger/debugger-ui/src/VmConnection.kt b/platform/script-debugger/debugger-ui/src/VmConnection.kt index c0135d1900a4..082e776a2bd3 100644 --- a/platform/script-debugger/debugger-ui/src/VmConnection.kt +++ b/platform/script-debugger/debugger-ui/src/VmConnection.kt @@ -22,7 +22,7 @@ abstract class VmConnection : Disposable { private val stateRef = AtomicReference(ConnectionState(ConnectionStatus.NOT_CONNECTED)) - open protected val dispatcher: EventDispatcher = EventDispatcher.create(DebugEventListener::class.java) + protected open val dispatcher: EventDispatcher = EventDispatcher.create(DebugEventListener::class.java) private val connectionDispatcher = ContainerUtil.createLockFreeCopyOnWriteList<(ConnectionState) -> Unit>() @Volatile var vm: T? = null diff --git a/platform/script-debugger/protocol/protocol-reader/src/FileScope.kt b/platform/script-debugger/protocol/protocol-reader/src/FileScope.kt index 5e184a5d02d3..eb16195e4f85 100644 --- a/platform/script-debugger/protocol/protocol-reader/src/FileScope.kt +++ b/platform/script-debugger/protocol/protocol-reader/src/FileScope.kt @@ -5,5 +5,5 @@ internal fun FileScope(globalScope: GlobalScope, stringBuilder: StringBuilder) = internal open class FileScope(val output: TextOutput, globalScope: GlobalScope) : GlobalScope(globalScope.state) { fun newClassScope() = ClassScope(this, asClassScope()) - open protected fun asClassScope(): ClassScope? = null + protected open fun asClassScope(): ClassScope? = null } \ No newline at end of file diff --git a/platform/testFramework/src/com/intellij/testFramework/FixtureRule.kt b/platform/testFramework/src/com/intellij/testFramework/FixtureRule.kt index efb721eafe7e..f47501de6f49 100644 --- a/platform/testFramework/src/com/intellij/testFramework/FixtureRule.kt +++ b/platform/testFramework/src/com/intellij/testFramework/FixtureRule.kt @@ -43,7 +43,7 @@ open class ApplicationRule : ExternalResource() { } } - override public final fun before() { + public final override fun before() { IdeaTestApplication.getInstance() TestRunnerUtil.replaceIdeEventQueueSafely() (PersistentFS.getInstance() as PersistentFSImpl).cleanPersistedContents() @@ -92,7 +92,7 @@ class ProjectRule(val projectDescriptor: LightProjectDescriptor = LightProjectDe } } - override public fun after() { + public override fun after() { if (projectOpened.compareAndSet(true, false)) { sharedProject?.let { runInEdtAndWait { (ProjectManager.getInstance() as ProjectManagerImpl).forceCloseProject(it, false) } } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.kt index 9e9368d4558e..6ab21ccede99 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.kt @@ -49,7 +49,7 @@ abstract class LineStatusTracker constructor(override val project: Pr private val vcsDirtyScopeManager: VcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(project) - override abstract val renderer: LocalLineStatusMarkerRenderer + abstract override val renderer: LocalLineStatusMarkerRenderer var mode: Mode = mode set(value) { diff --git a/plugins/settings-repository/src/IcsManager.kt b/plugins/settings-repository/src/IcsManager.kt index 3df7d18af354..74047386aa02 100644 --- a/plugins/settings-repository/src/IcsManager.kt +++ b/plugins/settings-repository/src/IcsManager.kt @@ -65,7 +65,8 @@ class IcsManager @JvmOverloads constructor(dir: Path, val schemeManagerFactory: } }, settings.commitDelay) - private @Volatile var autoCommitEnabled = true + @Volatile + private var autoCommitEnabled = true @Volatile var isRepositoryActive: Boolean = false diff --git a/plugins/settings-repository/src/autoSync.kt b/plugins/settings-repository/src/autoSync.kt index 5f8381115159..92e6abd2fe61 100644 --- a/plugins/settings-repository/src/autoSync.kt +++ b/plugins/settings-repository/src/autoSync.kt @@ -19,7 +19,8 @@ import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier import java.util.concurrent.Future internal class AutoSyncManager(private val icsManager: IcsManager) { - private @Volatile var autoSyncFuture: Future<*>? = null + @Volatile + private var autoSyncFuture: Future<*>? = null @Volatile var enabled = true @@ -157,7 +158,7 @@ internal class AutoSyncManager(private val icsManager: IcsManager) { } } -inline internal fun catchAndLog(asWarning: Boolean = false, runnable: () -> Unit) { +internal inline fun catchAndLog(asWarning: Boolean = false, runnable: () -> Unit) { try { runnable() } diff --git a/plugins/settings-repository/src/git/dirCacheEditor.kt b/plugins/settings-repository/src/git/dirCacheEditor.kt index 175513dfa4ad..9c3d664c7c9e 100644 --- a/plugins/settings-repository/src/git/dirCacheEditor.kt +++ b/plugins/settings-repository/src/git/dirCacheEditor.kt @@ -131,7 +131,7 @@ interface PathEdit { fun apply(entry: DirCacheEntry, repository: Repository) } -abstract class PathEditBase(override final val path: ByteArray) : PathEdit +abstract class PathEditBase(final override val path: ByteArray) : PathEdit private fun encodePath(path: String): ByteArray { val bytes = Constants.CHARSET.encode(path).toByteArray() diff --git a/plugins/settings-repository/src/git/pull.kt b/plugins/settings-repository/src/git/pull.kt index 5052063b19f4..d66aaf87eef7 100644 --- a/plugins/settings-repository/src/git/pull.kt +++ b/plugins/settings-repository/src/git/pull.kt @@ -58,7 +58,7 @@ class GitRepositoryClientImpl(override val repository: Repository, private val c } } -open internal class Pull(val manager: GitRepositoryClient, val indicator: ProgressIndicator?, val commitMessageFormatter: CommitMessageFormatter = IdeaCommitMessageFormatter()) { +internal open class Pull(val manager: GitRepositoryClient, val indicator: ProgressIndicator?, val commitMessageFormatter: CommitMessageFormatter = IdeaCommitMessageFormatter()) { val repository = manager.repository // we must use the same StoredConfig instance during the operation diff --git a/python/src/com/jetbrains/python/run/PyBrowseActionListener.kt b/python/src/com/jetbrains/python/run/PyBrowseActionListener.kt index 2e25cbf1a93a..fc360ecbecac 100644 --- a/python/src/com/jetbrains/python/run/PyBrowseActionListener.kt +++ b/python/src/com/jetbrains/python/run/PyBrowseActionListener.kt @@ -16,7 +16,7 @@ constructor(private val configuration: AbstractPythonRunConfiguration<*>, chooserDescriptor: FileChooserDescriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor().withPythonFiles()) : TextBrowseFolderListener(chooserDescriptor, configuration.getProject()) { - override final fun getInitialFile(): VirtualFile? = + final override fun getInitialFile(): VirtualFile? = super.getInitialFile() ?: LocalFileSystem.getInstance().findFileByPath(configuration.getWorkingDirectorySafe()) } \ No newline at end of file diff --git a/python/src/com/jetbrains/python/sdk/add/PyAddSdkPanel.kt b/python/src/com/jetbrains/python/sdk/add/PyAddSdkPanel.kt index c52be30a4df7..c3f0a6c43299 100644 --- a/python/src/com/jetbrains/python/sdk/add/PyAddSdkPanel.kt +++ b/python/src/com/jetbrains/python/sdk/add/PyAddSdkPanel.kt @@ -50,7 +50,7 @@ abstract class PyAddSdkPanel : JPanel(), PyAddSdkView { override fun complete(): Unit = Unit - override abstract val panelName: String + abstract override val panelName: String override val icon: Icon = PythonIcons.Python.Python open val sdk: Sdk? = null open val nameExtensionComponent: JComponent? = null diff --git a/python/src/com/jetbrains/python/testing/PyTestLegacyInterop.kt b/python/src/com/jetbrains/python/testing/PyTestLegacyInterop.kt index 0bc9cca2e5cc..c69cdb2f250d 100644 --- a/python/src/com/jetbrains/python/testing/PyTestLegacyInterop.kt +++ b/python/src/com/jetbrains/python/testing/PyTestLegacyInterop.kt @@ -229,7 +229,7 @@ private abstract class LegacyConfigurationManager< /** * If one of these fields is not empty -- legacy configuration makes sence */ - open protected fun getFieldsToCheckForEmptiness() = listOf(legacyConfig.scriptName, legacyConfig.className, legacyConfig.methodName) + protected open fun getFieldsToCheckForEmptiness() = listOf(legacyConfig.scriptName, legacyConfig.className, legacyConfig.methodName) /** * @return true of legacy configuration loaded, false if configuration is pure new diff --git a/python/src/com/jetbrains/python/testing/PyTestsShared.kt b/python/src/com/jetbrains/python/testing/PyTestsShared.kt index 2fc11e9201e0..bff73c151d35 100644 --- a/python/src/com/jetbrains/python/testing/PyTestsShared.kt +++ b/python/src/com/jetbrains/python/testing/PyTestsShared.kt @@ -644,7 +644,7 @@ abstract class PyAbstractTestConfiguration(project: Project, abstract class PyAbstractTestFactory : PythonConfigurationFactoryBase( PythonTestConfigurationType.getInstance()) { - override abstract fun createTemplateConfiguration(project: Project): CONF_T + abstract override fun createTemplateConfiguration(project: Project): CONF_T } /** diff --git a/uast/uast-common/src/org/jetbrains/uast/evaluation/AbstractEvaluatorExtension.kt b/uast/uast-common/src/org/jetbrains/uast/evaluation/AbstractEvaluatorExtension.kt index 97354205010d..5de476ad7c6b 100644 --- a/uast/uast-common/src/org/jetbrains/uast/evaluation/AbstractEvaluatorExtension.kt +++ b/uast/uast-common/src/org/jetbrains/uast/evaluation/AbstractEvaluatorExtension.kt @@ -60,7 +60,7 @@ abstract class AbstractEvaluatorExtension(override val language: Language) : UEv } abstract class SimpleEvaluatorExtension : AbstractEvaluatorExtension(Language.ANY) { - override final fun evaluatePostfix(operator: UastPostfixOperator, operandValue: UValue, state: UEvaluationState): UEvaluationInfo { + final override fun evaluatePostfix(operator: UastPostfixOperator, operandValue: UValue, state: UEvaluationState): UEvaluationInfo { val result = evaluatePostfix(operator, operandValue) return if (result != UUndeterminedValue) result.toConstant() to state @@ -70,7 +70,7 @@ abstract class SimpleEvaluatorExtension : AbstractEvaluatorExtension(Language.AN open fun evaluatePostfix(operator: UastPostfixOperator, operandValue: UValue): Any? = UUndeterminedValue - override final fun evaluatePrefix(operator: UastPrefixOperator, operandValue: UValue, state: UEvaluationState): UEvaluationInfo { + final override fun evaluatePrefix(operator: UastPrefixOperator, operandValue: UValue, state: UEvaluationState): UEvaluationInfo { val result = evaluatePrefix(operator, operandValue) return if (result != UUndeterminedValue) result.toConstant() to state @@ -80,7 +80,7 @@ abstract class SimpleEvaluatorExtension : AbstractEvaluatorExtension(Language.AN open fun evaluatePrefix(operator: UastPrefixOperator, operandValue: UValue): Any? = UUndeterminedValue - override final fun evaluateBinary(binaryExpression: UBinaryExpression, + final override fun evaluateBinary(binaryExpression: UBinaryExpression, leftValue: UValue, rightValue: UValue, state: UEvaluationState): UEvaluationInfo { @@ -93,7 +93,7 @@ abstract class SimpleEvaluatorExtension : AbstractEvaluatorExtension(Language.AN open fun evaluateBinary(binaryExpression: UBinaryExpression, leftValue: UValue, rightValue: UValue): Any? = UUndeterminedValue - override final fun evaluateMethodCall(target: PsiMethod, argumentValues: List, state: UEvaluationState): UEvaluationInfo { + final override fun evaluateMethodCall(target: PsiMethod, argumentValues: List, state: UEvaluationState): UEvaluationInfo { val result = evaluateMethodCall(target, argumentValues) return if (result != UUndeterminedValue) result.toConstant() to state @@ -103,7 +103,7 @@ abstract class SimpleEvaluatorExtension : AbstractEvaluatorExtension(Language.AN open fun evaluateMethodCall(target: PsiMethod, argumentValues: List): Any? = UUndeterminedValue - override final fun evaluateVariable(variable: UVariable, state: UEvaluationState): UEvaluationInfo { + final override fun evaluateVariable(variable: UVariable, state: UEvaluationState): UEvaluationInfo { val result = evaluateVariable(variable) return if (result != UUndeterminedValue) result.toConstant() to state diff --git a/uast/uast-common/src/org/jetbrains/uast/values/UConstant.kt b/uast/uast-common/src/org/jetbrains/uast/values/UConstant.kt index 284fac62923f..786f319880a7 100644 --- a/uast/uast-common/src/org/jetbrains/uast/values/UConstant.kt +++ b/uast/uast-common/src/org/jetbrains/uast/values/UConstant.kt @@ -64,7 +64,7 @@ enum class UNumericType(val prefix: String = "") { } abstract class UNumericConstant(val type: UNumericType, override val source: ULiteralExpression?) : UAbstractConstant() { - override abstract val value: Number + abstract override val value: Number override fun toString(): String = "${type.prefix}$value" diff --git a/uast/uast-common/src/org/jetbrains/uast/values/UDependentValue.kt b/uast/uast-common/src/org/jetbrains/uast/values/UDependentValue.kt index 026eaa1c9b0b..33e03b464b3f 100644 --- a/uast/uast-common/src/org/jetbrains/uast/values/UDependentValue.kt +++ b/uast/uast-common/src/org/jetbrains/uast/values/UDependentValue.kt @@ -102,7 +102,7 @@ open class UDependentValue protected constructor( override fun toConstant(): UConstant? = value.toConstant() - open internal fun copy(dependencies: Set) = + internal open fun copy(dependencies: Set) = if (dependencies == this.dependencies) this else create(value, dependencies) override fun coerceConstant(constant: UConstant): UValue = diff --git a/uast/uast-common/src/org/jetbrains/uast/values/UValueBase.kt b/uast/uast-common/src/org/jetbrains/uast/values/UValueBase.kt index f09491b0cd18..d48f7f4c64db 100644 --- a/uast/uast-common/src/org/jetbrains/uast/values/UValueBase.kt +++ b/uast/uast-common/src/org/jetbrains/uast/values/UValueBase.kt @@ -97,5 +97,5 @@ abstract class UValueBase : UValue { override val reachable: Boolean = true - override abstract fun toString(): String + abstract override fun toString(): String } \ No newline at end of file diff --git a/uast/uast-java/src/org/jetbrains/uast/java/expressions/JavaUCompositeQualifiedExpression.kt b/uast/uast-java/src/org/jetbrains/uast/java/expressions/JavaUCompositeQualifiedExpression.kt index 67761c963692..14e97524d775 100644 --- a/uast/uast-java/src/org/jetbrains/uast/java/expressions/JavaUCompositeQualifiedExpression.kt +++ b/uast/uast-java/src/org/jetbrains/uast/java/expressions/JavaUCompositeQualifiedExpression.kt @@ -25,7 +25,7 @@ class JavaUCompositeQualifiedExpression( givenParent: UElement? ) : JavaAbstractUExpression(givenParent), UQualifiedReferenceExpression, UMultiResolvable { - lateinit internal var receiverInitializer: () -> UExpression + internal lateinit var receiverInitializer: () -> UExpression override val receiver: UExpression by lazy { receiverInitializer() }