From d358f0f9d3abce6bcba50840aa31cf8e332e5d1d Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 5 Nov 2018 12:29:36 +0100 Subject: [PATCH] =?UTF-8?q?cleanup=20=E2=80=94=20"might=20be=20const"=20in?= =?UTF-8?q?spection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../build/output/KotlincOutputParser.kt | 5 +-- .../chainsSearch/RefChainOperation.kt | 2 +- .../projectRoot/LibraryJarsDiffDialog.kt | 18 +-------- .../actions/BraceMatcherUtilTest.kt | 4 +- .../AtomicFieldUpdaterCompletionTest.kt | 8 ++-- .../builtInWebServer/ssi/SsiProcessor.kt | 4 +- .../jetbrains/io/fastCgi/FastCgiRequest.kt | 15 +++---- .../testSrc/org/jetbrains/ide/TestManager.kt | 3 +- .../testSrc/StorageManagerTest.kt | 18 +-------- .../com/intellij/diff/merge/MergeAutoTest.kt | 24 +++-------- .../settings/ParameterNameHintsSettings.kt | 40 +++++++++---------- .../ide/actions/DebugLogConfigureAction.kt | 4 +- .../statistic/utils/StatisticsUtil.kt | 18 +-------- .../openapi/keymap/impl/KeymapImpl.kt | 28 ++++++------- .../src/debugger/ObjectPropertyImpl.kt | 22 ++-------- .../src/debugger/values/PrimitiveValue.kt | 20 ++-------- .../javascript/debugger/NameMapper.kt | 2 +- .../protocol-model-generator/src/Generator.kt | 3 +- .../src/ExistingSubtypeAspect.kt | 3 +- .../protocol-reader/src/TextOutput.kt | 3 +- .../protocol-reader/src/TypeWriter.kt | 5 ++- .../protocol/protocol-reader/src/Util.kt | 9 +++-- .../src/ProtocolMetaModel.kt | 19 ++++----- .../testGuiFramework/framework/GuiTestUtil.kt | 8 ++-- .../testGuiFramework/generators/Generators.kt | 20 ++-------- .../testGuiFramework/impl/GuiTestStarter.kt | 24 +++-------- .../testGuiFramework/impl/GuiTestThread.kt | 18 +-------- .../testGuiFramework/recorder/Writer.kt | 18 +-------- .../recorder/compile/ScriptWrapper.kt | 18 +-------- .../testGuiFramework/recorder/ui/Notifier.kt | 18 +-------- .../openapi/vcs/changes/ChangeListUtil.kt | 18 +-------- .../vcs/LineStatusTrackerRevertAutoTest.kt | 24 +++-------- .../jps/ant/JpsAntSerializationTest.kt | 20 ++-------- .../git4idea/tests/git4idea/test/TestGit.kt | 18 +-------- ...DependenciesGradleCompletionContributor.kt | 10 ++--- .../settings-repository/src/IcsSettings.kt | 19 +-------- .../testSrc/IcsTestCase.kt | 4 +- .../stats/completion/LogEventFixtures.kt | 18 +-------- .../enhancer/ContributorsTimeStatistics.kt | 22 ++-------- .../experiment/WebServiceStatusProvider.kt | 38 ++++++------------ .../impl/CompletionFinishTypeFactors.kt | 27 ++++--------- .../completion/CompletionLoggingTestBase.kt | 20 ++-------- .../handler/unified/DistinctByKeyHandler.kt | 6 +-- .../impl/handler/unified/MatchHandler.kt | 4 +- .../streams/ui/impl/ValueWithPositionImpl.kt | 8 ++-- .../jetbrains/idea/svn/IdeaSVNConfigFile.kt | 14 +++---- .../org/jetbrains/idea/svn/api/ErrorCode.kt | 6 +-- .../python/console/pydev/PydevXmlRpcClient.kt | 5 ++- .../console/PythonConsoleToolWindow.java | 2 +- .../console/PythonConsoleToolWindowFactory.kt | 18 +-------- .../jetbrains/python/testing/PyTestsShared.kt | 2 +- .../python/tools/BuildStubsForSdk.kt | 7 ++-- .../org/jetbrains/uast/values/UPhiValue.kt | 18 +-------- 53 files changed, 200 insertions(+), 529 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/build/output/KotlincOutputParser.kt b/java/compiler/impl/src/com/intellij/build/output/KotlincOutputParser.kt index 4d62b9b5bb47..01942f7d0a0c 100644 --- a/java/compiler/impl/src/com/intellij/build/output/KotlincOutputParser.kt +++ b/java/compiler/impl/src/com/intellij/build/output/KotlincOutputParser.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.build.output import com.intellij.build.FilePosition @@ -7,7 +7,6 @@ import com.intellij.build.events.impl.FileMessageEventImpl import com.intellij.build.events.impl.MessageEventImpl import com.intellij.openapi.util.text.StringUtil import java.io.File -import java.lang.IllegalStateException import java.util.function.Consumer import java.util.regex.Pattern @@ -20,7 +19,7 @@ import java.util.regex.Pattern class KotlincOutputParser : BuildOutputParser { companion object { - private val COMPILER_MESSAGES_GROUP = "Kotlin compiler" + private const val COMPILER_MESSAGES_GROUP = "Kotlin compiler" } override fun parse(line: String, reader: BuildOutputInstantReader, consumer: Consumer): Boolean { diff --git a/java/compiler/impl/src/com/intellij/compiler/chainsSearch/RefChainOperation.kt b/java/compiler/impl/src/com/intellij/compiler/chainsSearch/RefChainOperation.kt index b2ea0716eb83..881186ece43c 100644 --- a/java/compiler/impl/src/com/intellij/compiler/chainsSearch/RefChainOperation.kt +++ b/java/compiler/impl/src/com/intellij/compiler/chainsSearch/RefChainOperation.kt @@ -38,7 +38,7 @@ class MethodCall(override val compilerRef: CompilerRef.JavaCompilerMethodRef, private val context: ChainCompletionContext): RefChainOperation() { private companion object { - val CONSTRUCTOR_METHOD_NAME = "" + const val CONSTRUCTOR_METHOD_NAME = "" } override val qualifierRawName: String diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibraryJarsDiffDialog.kt b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibraryJarsDiffDialog.kt index 1722bc5cf3f5..dc2bf3fb4198 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibraryJarsDiffDialog.kt +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibraryJarsDiffDialog.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.openapi.roots.ui.configuration.projectRoot import com.intellij.diff.DiffManager @@ -39,7 +25,7 @@ class LibraryJarsDiffDialog(libraryFile: VirtualFile, private val libraryName: String, project: Project) : DialogWrapper(project) { companion object { - val CHANGE_COORDINATES_CODE: Int = 2 + const val CHANGE_COORDINATES_CODE: Int = 2 } private val panel: DiffRequestPanel diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/BraceMatcherUtilTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/BraceMatcherUtilTest.kt index e8769bf57ec0..77a79d123068 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/BraceMatcherUtilTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/BraceMatcherUtilTest.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.java.codeInsight.actions import com.intellij.codeInsight.highlighting.BraceMatchingUtil @@ -12,7 +12,7 @@ import com.intellij.psi.JavaTokenType import com.intellij.testFramework.LightPlatformCodeInsightTestCase private typealias BraceMatcher = (HighlighterIterator, CharSequence, FileType) -> Int -private val TARGET_MARKER = "" +private const val TARGET_MARKER = "" class BraceMatcherUtilTest : LightPlatformCodeInsightTestCase() { fun testRightmostRParen0() = assertRightmostRParenth("(()([{()}]))[]()") diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/AtomicFieldUpdaterCompletionTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/AtomicFieldUpdaterCompletionTest.kt index b680f8e5688d..92611f63c46d 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/AtomicFieldUpdaterCompletionTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/AtomicFieldUpdaterCompletionTest.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.java.codeInsight.completion import com.intellij.codeInsight.completion.LightFixtureCompletionTestCase @@ -102,8 +102,8 @@ class Main { } companion object { - private val INTEGER = "AtomicIntegerFieldUpdater" - private val LONG = "AtomicLongFieldUpdater" - private val REFERENCE = "AtomicReferenceFieldUpdater" + private const val INTEGER = "AtomicIntegerFieldUpdater" + private const val LONG = "AtomicLongFieldUpdater" + private const val REFERENCE = "AtomicReferenceFieldUpdater" } } \ No newline at end of file diff --git a/platform/built-in-server/src/org/jetbrains/builtInWebServer/ssi/SsiProcessor.kt b/platform/built-in-server/src/org/jetbrains/builtInWebServer/ssi/SsiProcessor.kt index 32bab21dab73..f7504fc9f43d 100644 --- a/platform/built-in-server/src/org/jetbrains/builtInWebServer/ssi/SsiProcessor.kt +++ b/platform/built-in-server/src/org/jetbrains/builtInWebServer/ssi/SsiProcessor.kt @@ -16,8 +16,8 @@ import java.util.* internal val LOG = Logger.getInstance(SsiProcessor::class.java) -internal val COMMAND_START = "" +internal const val COMMAND_START = "" class SsiStopProcessingException : RuntimeException() diff --git a/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiRequest.kt b/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiRequest.kt index fa0a0b3638be..ac89b77f560a 100644 --- a/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiRequest.kt +++ b/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiRequest.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2018 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 org.jetbrains.io.fastCgi import com.intellij.openapi.util.io.FileUtil @@ -13,14 +14,14 @@ import java.net.InetSocketAddress import java.nio.CharBuffer import java.util.* -private val PARAMS = 4 -private val BEGIN_REQUEST = 1 -private val RESPONDER = 1 -private val FCGI_KEEP_CONNECTION = 1 -private val STDIN = 5 -private val VERSION = 1 +private const val PARAMS = 4 +private const val BEGIN_REQUEST = 1 +private const val RESPONDER = 1 +private const val FCGI_KEEP_CONNECTION = 1 +private const val STDIN = 5 +private const val VERSION = 1 -private val MAX_CONTENT_LENGTH = 0xFFFF +private const val MAX_CONTENT_LENGTH = 0xFFFF class FastCgiRequest(val requestId: Int, allocator: ByteBufAllocator) { private val params = allocator.ioBuffer(4096) diff --git a/platform/built-in-server/testSrc/org/jetbrains/ide/TestManager.kt b/platform/built-in-server/testSrc/org/jetbrains/ide/TestManager.kt index 7e23241c30dd..57d7332682dd 100644 --- a/platform/built-in-server/testSrc/org/jetbrains/ide/TestManager.kt +++ b/platform/built-in-server/testSrc/org/jetbrains/ide/TestManager.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2018 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 org.jetbrains.ide import com.intellij.openapi.application.runWriteAction @@ -15,7 +16,7 @@ import org.junit.rules.TestWatcher import org.junit.runner.Description import java.io.File -private val EXCLUDED_DIR_NAME = "excludedDir" +private const val EXCLUDED_DIR_NAME = "excludedDir" internal class TestManager(val projectRule: ProjectRule, private val tempDirManager: TemporaryDirectory) : TestWatcher() { var annotation: TestDescriptor? = null diff --git a/platform/configuration-store-impl/testSrc/StorageManagerTest.kt b/platform/configuration-store-impl/testSrc/StorageManagerTest.kt index 5d2e4d630e68..85ab41225ea2 100644 --- a/platform/configuration-store-impl/testSrc/StorageManagerTest.kt +++ b/platform/configuration-store-impl/testSrc/StorageManagerTest.kt @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 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. - */ +// Copyright 2000-2018 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.configurationStore import com.intellij.testFramework.ProjectRule @@ -26,7 +12,7 @@ import kotlin.properties.Delegates internal class StorageManagerTest { companion object { - val MACRO = "\$MACRO1$" + const val MACRO = "\$MACRO1$" @JvmField @ClassRule val projectRule = ProjectRule() diff --git a/platform/diff-impl/tests/com/intellij/diff/merge/MergeAutoTest.kt b/platform/diff-impl/tests/com/intellij/diff/merge/MergeAutoTest.kt index 2ee6e48d164c..5f8e8b6d4883 100644 --- a/platform/diff-impl/tests/com/intellij/diff/merge/MergeAutoTest.kt +++ b/platform/diff-impl/tests/com/intellij/diff/merge/MergeAutoTest.kt @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 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. - */ +// Copyright 2000-2018 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.diff.merge import com.intellij.diff.DiffTestCase @@ -22,10 +8,10 @@ import com.intellij.diff.util.ThreeSide class MergeAutoTest : MergeTestBase() { companion object { - private val RUNS = 10 - private val MODIFICATION_CYCLE_COUNT = 5 - private val MODIFICATION_CYCLE_SIZE = 3 - private val MAX_TEXT_LENGTH = 300 + private const val RUNS = 10 + private const val MODIFICATION_CYCLE_COUNT = 5 + private const val MODIFICATION_CYCLE_SIZE = 3 + private const val MAX_TEXT_LENGTH = 300 } fun `test undo - default policy`() { diff --git a/platform/lang-api/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsSettings.kt b/platform/lang-api/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsSettings.kt index 96a35f12f745..95ccb97ae1d4 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsSettings.kt +++ b/platform/lang-api/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsSettings.kt @@ -10,12 +10,12 @@ import com.intellij.util.getAttributeBooleanValue import org.jdom.Element private object XmlTagHelper { - val BLACKLISTS = "blacklists" - val LANGUAGE_LIST = "blacklist" - val LANGUAGE = "language" - val ADDED = "added" - val REMOVED = "removed" - val PATTERN = "pattern" + const val BLACKLISTS = "blacklists" + const val LANGUAGE_LIST = "blacklist" + const val LANGUAGE = "language" + const val ADDED = "added" + const val REMOVED = "removed" + const val PATTERN = "pattern" } class Diff(val added: Set, val removed: Set) { @@ -44,7 +44,7 @@ class ParameterNameHintsSettings : PersistentStateComponent { private val removedPatterns = hashMapOf>() private val addedPatterns = hashMapOf>() private val options = hashMapOf() - + fun addIgnorePattern(language: Language, pattern: String) { val patternsBefore = getAddedPatterns(language) setAddedPatterns(language, patternsBefore + pattern) @@ -61,37 +61,37 @@ class ParameterNameHintsSettings : PersistentStateComponent { setAddedPatterns(language, diff.added) setRemovedPatterns(language, diff.removed) } - + override fun getState(): Element { val root = Element("settings") if (removedPatterns.isNotEmpty() || addedPatterns.isNotEmpty()) { val blacklists = Element(XmlTagHelper.BLACKLISTS) root.addContent(blacklists) - + val allLanguages = removedPatterns.keys + addedPatterns.keys allLanguages.forEach { val removed = removedPatterns[it] ?: emptySet() val added = addedPatterns[it] ?: emptySet() - + val languageBlacklist = Element(XmlTagHelper.LANGUAGE_LIST).apply { setAttribute(XmlTagHelper.LANGUAGE, it) val removedElements = removed.map { it.toPatternElement(XmlTagHelper.REMOVED) } val addedElements = added.map { it.toPatternElement(XmlTagHelper.ADDED) } addContent(addedElements + removedElements) } - + blacklists.addContent(languageBlacklist) } } - + options.forEach { id, value -> val element = Element("option") element.setAttribute("id", id) element.setAttribute("value", value.toString()) root.addContent(element) } - + return root } @@ -99,26 +99,26 @@ class ParameterNameHintsSettings : PersistentStateComponent { addedPatterns.clear() removedPatterns.clear() options.clear() - + val allBlacklistElements = state.getChild(XmlTagHelper.BLACKLISTS) ?.getChildren(XmlTagHelper.LANGUAGE_LIST) ?: emptyList() allBlacklistElements.forEach { blacklistElement -> val language = blacklistElement.attributeValue(XmlTagHelper.LANGUAGE) ?: return@forEach - + val added = blacklistElement.extractPatterns(XmlTagHelper.ADDED) addedPatterns[language] = addedPatterns[language]?.plus(added) ?: added - + val removed = blacklistElement.extractPatterns(XmlTagHelper.REMOVED) removedPatterns[language] = removedPatterns[language]?.plus(removed) ?: removed } - - state.getChildren("option").forEach { + + state.getChildren("option").forEach { val id = it.getAttributeValue("id") options[id] = it.getAttributeBooleanValue("value") } } - + companion object { @JvmStatic fun getInstance(): ParameterNameHintsSettings = ServiceManager.getService(ParameterNameHintsSettings::class.java) @@ -133,7 +133,7 @@ class ParameterNameHintsSettings : PersistentStateComponent { options.remove(optionId) } else { - options[optionId] = value + options[optionId] = value } } diff --git a/platform/platform-impl/src/com/intellij/ide/actions/DebugLogConfigureAction.kt b/platform/platform-impl/src/com/intellij/ide/actions/DebugLogConfigureAction.kt index 7c1af1424a37..39b7c152b642 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/DebugLogConfigureAction.kt +++ b/platform/platform-impl/src/com/intellij/ide/actions/DebugLogConfigureAction.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.actions import com.intellij.diagnostic.DebugLogManager @@ -30,7 +30,7 @@ class DebugLogConfigureAction : DumbAwareAction() { } } -private val TRACE_SUFFIX = ":trace" +private const val TRACE_SUFFIX = ":trace" private val ALL_POSSIBLE_SEPARATORS = "[\n,;]+".toRegex() private class DebugLogConfigureDialog(project: Project, categories: List>) : DialogWrapper(project, false) { diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt b/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt index 36575105d583..12e36163f9f8 100644 --- a/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt +++ b/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.internal.statistic.utils import com.intellij.ide.plugins.PluginManager @@ -139,7 +125,7 @@ fun getCountingUsage(key: String, value: Int): UsageDescriptor { return UsageDescriptor("$key.$stepName+", 1) } -private val kilo = 1000 +private const val kilo = 1000 private val mega = kilo * kilo private fun humanize(number: Int): String { 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 9afcdfcb200b..af0b92fda821 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 @@ -27,20 +27,20 @@ import org.jdom.Element import java.util.* import javax.swing.KeyStroke -private val KEY_MAP = "keymap" -private val KEYBOARD_SHORTCUT = "keyboard-shortcut" -private val KEYBOARD_GESTURE_SHORTCUT = "keyboard-gesture-shortcut" -private val KEYBOARD_GESTURE_KEY = "keystroke" -private val KEYBOARD_GESTURE_MODIFIER = "modifier" -private val KEYSTROKE_ATTRIBUTE = "keystroke" -private val FIRST_KEYSTROKE_ATTRIBUTE = "first-keystroke" -private val SECOND_KEYSTROKE_ATTRIBUTE = "second-keystroke" -private val ACTION = "action" -private val VERSION_ATTRIBUTE = "version" -private val PARENT_ATTRIBUTE = "parent" -private val NAME_ATTRIBUTE = "name" -private val ID_ATTRIBUTE = "id" -private val MOUSE_SHORTCUT = "mouse-shortcut" +private const val KEY_MAP = "keymap" +private const val KEYBOARD_SHORTCUT = "keyboard-shortcut" +private const val KEYBOARD_GESTURE_SHORTCUT = "keyboard-gesture-shortcut" +private const val KEYBOARD_GESTURE_KEY = "keystroke" +private const val KEYBOARD_GESTURE_MODIFIER = "modifier" +private const val KEYSTROKE_ATTRIBUTE = "keystroke" +private const val FIRST_KEYSTROKE_ATTRIBUTE = "first-keystroke" +private const val SECOND_KEYSTROKE_ATTRIBUTE = "second-keystroke" +private const val ACTION = "action" +private const val VERSION_ATTRIBUTE = "version" +private const val PARENT_ATTRIBUTE = "parent" +private const val NAME_ATTRIBUTE = "name" +private const val ID_ATTRIBUTE = "id" +private const val MOUSE_SHORTCUT = "mouse-shortcut" private val LOG = logger() diff --git a/platform/script-debugger/backend/src/debugger/ObjectPropertyImpl.kt b/platform/script-debugger/backend/src/debugger/ObjectPropertyImpl.kt index 2fd3f0aa8d7d..8f17a76ad6dc 100644 --- a/platform/script-debugger/backend/src/debugger/ObjectPropertyImpl.kt +++ b/platform/script-debugger/backend/src/debugger/ObjectPropertyImpl.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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 org.jetbrains.debugger import com.intellij.util.BitUtil @@ -26,9 +12,9 @@ class ObjectPropertyImpl(name: String, valueModifier: ValueModifier? = null, private val flags: Int = 0) : VariableImpl(name, value, valueModifier), ObjectProperty { companion object { - val WRITABLE: Int = 0x01 - val CONFIGURABLE: Int = 0x02 - val ENUMERABLE: Int = 0x04 + const val WRITABLE: Int = 0x01 + const val CONFIGURABLE: Int = 0x02 + const val ENUMERABLE: Int = 0x04 } override val isWritable: Boolean diff --git a/platform/script-debugger/backend/src/debugger/values/PrimitiveValue.kt b/platform/script-debugger/backend/src/debugger/values/PrimitiveValue.kt index 995e905c6799..a2785f2379b4 100644 --- a/platform/script-debugger/backend/src/debugger/values/PrimitiveValue.kt +++ b/platform/script-debugger/backend/src/debugger/values/PrimitiveValue.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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 org.jetbrains.debugger.values open class PrimitiveValue(type: ValueType, override val valueString: String) : ValueBase(type) { @@ -24,8 +10,8 @@ open class PrimitiveValue(type: ValueType, override val valueString: String) : V } companion object { - val NA_N_VALUE: String = "NaN" - val INFINITY_VALUE: String = "Infinity" + const val NA_N_VALUE: String = "NaN" + const val INFINITY_VALUE: String = "Infinity" @JvmField val NULL: PrimitiveValue = PrimitiveValue(ValueType.NULL, "null") diff --git a/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt b/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt index fc573e3a47f8..74cee84a68d5 100644 --- a/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt +++ b/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt @@ -12,7 +12,7 @@ import org.jetbrains.debugger.sourcemap.Mappings import org.jetbrains.debugger.sourcemap.SourceMap import org.jetbrains.rpc.LOG -private val S1 = ",()[]{}=" +private const val S1 = ",()[]{}=" // don't trim trailing .&: - could be part of expression private val OPERATOR_TRIMMER = CharMatcher.invisible().or(CharMatcher.anyOf(S1)) diff --git a/platform/script-debugger/protocol/protocol-model-generator/src/Generator.kt b/platform/script-debugger/protocol/protocol-model-generator/src/Generator.kt index b93c45fa9671..0cb9d6b2026d 100644 --- a/platform/script-debugger/protocol/protocol-model-generator/src/Generator.kt +++ b/platform/script-debugger/protocol/protocol-model-generator/src/Generator.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2018 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 org.jetbrains.protocolModelGenerator import com.intellij.openapi.util.text.StringUtil @@ -228,7 +229,7 @@ internal class Generator(outputDir: String, private val rootPackage: String, req } } -val READER_INTERFACE_NAME: String = "ProtocolResponseReader" +const val READER_INTERFACE_NAME: String = "ProtocolResponseReader" private val INCLUDED_DOMAINS = arrayOf("CSS", "Debugger", "DOM", "Inspector", "Log", "Network", "Page", "Runtime", "ServiceWorker", "Tracing", "Target", "Overlay", "Console", "DOMDebugger", "Profiler", "HeapProfiler", "NodeWorker") diff --git a/platform/script-debugger/protocol/protocol-reader/src/ExistingSubtypeAspect.kt b/platform/script-debugger/protocol/protocol-reader/src/ExistingSubtypeAspect.kt index b0fd3039f739..482b7ebc4801 100644 --- a/platform/script-debugger/protocol/protocol-reader/src/ExistingSubtypeAspect.kt +++ b/platform/script-debugger/protocol/protocol-reader/src/ExistingSubtypeAspect.kt @@ -1,6 +1,7 @@ +// Copyright 2000-2018 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 org.jetbrains.protocolReader -private val BASE_VALUE_PREFIX = "baseMessage" +private const val BASE_VALUE_PREFIX = "baseMessage" internal class ExistingSubtypeAspect(private val jsonSuperClass: TypeRef<*>) { private var subtypeCaster: SubtypeCaster? = null diff --git a/platform/script-debugger/protocol/protocol-reader/src/TextOutput.kt b/platform/script-debugger/protocol/protocol-reader/src/TextOutput.kt index fc7e8277e347..19276b27a709 100644 --- a/platform/script-debugger/protocol/protocol-reader/src/TextOutput.kt +++ b/platform/script-debugger/protocol/protocol-reader/src/TextOutput.kt @@ -1,9 +1,10 @@ +// Copyright 2000-2018 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 org.jetbrains.protocolReader import java.util.* val EMPTY_CHARS: CharArray = CharArray(0) -private val indentGranularity = 2 +private const val indentGranularity = 2 class TextOutput(val out: StringBuilder) { private var identLevel: Int = 0 diff --git a/platform/script-debugger/protocol/protocol-reader/src/TypeWriter.kt b/platform/script-debugger/protocol/protocol-reader/src/TypeWriter.kt index ddf40950e211..2dd29190eddc 100644 --- a/platform/script-debugger/protocol/protocol-reader/src/TypeWriter.kt +++ b/platform/script-debugger/protocol/protocol-reader/src/TypeWriter.kt @@ -1,12 +1,13 @@ +// Copyright 2000-2018 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 org.jetbrains.protocolReader import org.jetbrains.jsonProtocol.JsonObjectBased import java.lang.reflect.Method import java.util.* -internal val FIELD_PREFIX = '_' +internal const val FIELD_PREFIX = '_' -internal val NAME_VAR_NAME = "_n" +internal const val NAME_VAR_NAME = "_n" private fun assignField(out: TextOutput, fieldName: String) = out.append(FIELD_PREFIX).append(fieldName).append(" = ") diff --git a/platform/script-debugger/protocol/protocol-reader/src/Util.kt b/platform/script-debugger/protocol/protocol-reader/src/Util.kt index 994ae5e16857..0d560072b8dc 100644 --- a/platform/script-debugger/protocol/protocol-reader/src/Util.kt +++ b/platform/script-debugger/protocol/protocol-reader/src/Util.kt @@ -1,15 +1,16 @@ +// Copyright 2000-2018 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 org.jetbrains.protocolReader import java.lang.reflect.ParameterizedType import java.lang.reflect.Type import java.lang.reflect.WildcardType -val TYPE_FACTORY_NAME_PREFIX: Char = 'F' +const val TYPE_FACTORY_NAME_PREFIX: Char = 'F' -val READER_NAME: String = "reader" -val PENDING_INPUT_READER_NAME: String = "inputReader" +const val READER_NAME: String = "reader" +const val PENDING_INPUT_READER_NAME: String = "inputReader" -val JSON_READER_CLASS_NAME: String = "JsonReaderEx" +const val JSON_READER_CLASS_NAME: String = "JsonReaderEx" val JSON_READER_PARAMETER_DEF: String = "$READER_NAME: $JSON_READER_CLASS_NAME" /** diff --git a/platform/script-debugger/protocol/schema-reader-generator/src/ProtocolMetaModel.kt b/platform/script-debugger/protocol/schema-reader-generator/src/ProtocolMetaModel.kt index 39cd44dba6b8..a005900adc8b 100644 --- a/platform/script-debugger/protocol/schema-reader-generator/src/ProtocolMetaModel.kt +++ b/platform/script-debugger/protocol/schema-reader-generator/src/ProtocolMetaModel.kt @@ -1,15 +1,16 @@ +// Copyright 2000-2018 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 org.jetbrains.jsonProtocol import org.jetbrains.io.JsonReaderEx -val STRING_TYPE: String = "string" -val INTEGER_TYPE: String = "integer" -val NUMBER_TYPE: String = "number" -val BOOLEAN_TYPE: String = "boolean" -public val OBJECT_TYPE: String = "object" -val ARRAY_TYPE: String = "array" -val UNKNOWN_TYPE: String = "unknown" -val ANY_TYPE: String = "any" +const val STRING_TYPE: String = "string" +const val INTEGER_TYPE: String = "integer" +const val NUMBER_TYPE: String = "number" +const val BOOLEAN_TYPE: String = "boolean" +public const val OBJECT_TYPE: String = "object" +const val ARRAY_TYPE: String = "array" +const val UNKNOWN_TYPE: String = "unknown" +const val ANY_TYPE: String = "any" interface ItemDescriptor { val description: String? @@ -71,7 +72,7 @@ interface ProtocolMetaModel { val description: String? val hidden: Boolean - + val experimental: Boolean } diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.kt index 3ed3e07e4103..3ff540e0203f 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.kt @@ -78,7 +78,7 @@ import javax.swing.* import javax.swing.text.JTextComponent object GuiTestUtil { - val GUI_TESTS_RUNNING_IN_SUITE_PROPERTY = "gui.tests.running.in.suite" + const val GUI_TESTS_RUNNING_IN_SUITE_PROPERTY = "gui.tests.running.in.suite" private val LOG = Logger.getInstance("#com.intellij.tests.gui.framework.GuiTestUtil") @@ -86,9 +86,9 @@ object GuiTestUtil { * Environment variable pointing to the JDK to be used for tests */ - val JDK_HOME_FOR_TESTS = "JDK_HOME_FOR_TESTS" - val TEST_DATA_DIR = "GUI_TEST_DATA_DIR" - val FIRST_START = "GUI_FIRST_START" + const val JDK_HOME_FOR_TESTS = "JDK_HOME_FOR_TESTS" + const val TEST_DATA_DIR = "GUI_TEST_DATA_DIR" + const val FIRST_START = "GUI_FIRST_START" private val SYSTEM_EVENT_QUEUE = Toolkit.getDefaultToolkit().systemEventQueue val gradleHomePath: File? diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt index 5ff8beab4997..57d7dc848179 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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. @file:Suppress("unused") package com.intellij.testGuiFramework.generators @@ -86,8 +72,8 @@ import javax.swing.tree.TreePath //**********COMPONENT GENERATORS********** -private val leftButton = MouseEvent.BUTTON1 -private val rightButton = MouseEvent.BUTTON3 +private const val leftButton = MouseEvent.BUTTON1 +private const val rightButton = MouseEvent.BUTTON3 private fun MouseEvent.isLeftButton() = (this.button == leftButton) private fun MouseEvent.isRightButton() = (this.button == rightButton) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestStarter.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestStarter.kt index b0411e4da0ff..e294b45555bf 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestStarter.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestStarter.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.testGuiFramework.impl import com.intellij.idea.IdeaApplication @@ -25,11 +11,11 @@ import com.intellij.openapi.diagnostic.Logger class GuiTestStarter : IdeaApplication.IdeStarter(), ApplicationStarter { companion object { - val COMMAND_NAME: String = "guitest" + const val COMMAND_NAME: String = "guitest" - val GUI_TEST_PORT: String = "idea.gui.test.port" - val GUI_TEST_HOST: String = "idea.gui.test.host" - val GUI_TEST_LIST: String = "idea.gui.test.list" + const val GUI_TEST_PORT: String = "idea.gui.test.port" + const val GUI_TEST_HOST: String = "idea.gui.test.host" + const val GUI_TEST_LIST: String = "idea.gui.test.list" fun isGuiTestThread(): Boolean = Thread.currentThread().name == GuiTestThread.GUI_TEST_THREAD_NAME } diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestThread.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestThread.kt index d9f852ecb399..755bc6e942c3 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestThread.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestThread.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.testGuiFramework.impl import com.intellij.openapi.application.ApplicationManager @@ -45,7 +31,7 @@ class GuiTestThread : Thread(GUI_TEST_THREAD_NAME) { private val LOG = Logger.getInstance("#com.intellij.testGuiFramework.impl.GuiTestThread") companion object { - val GUI_TEST_THREAD_NAME: String = "GuiTest Thread" + const val GUI_TEST_THREAD_NAME: String = "GuiTest Thread" var client: JUnitClient? = null } diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/Writer.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/Writer.kt index 701dec4aa2e0..d74217db69d3 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/Writer.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/Writer.kt @@ -1,25 +1,11 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.testGuiFramework.recorder import com.intellij.openapi.command.WriteCommandAction object Writer { - val indent: Int = 2 + const val indent: Int = 2 private fun writeln(str: String) { write(str + "\n") diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/compile/ScriptWrapper.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/compile/ScriptWrapper.kt index 1174ec26329a..774a1ef182a9 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/compile/ScriptWrapper.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/compile/ScriptWrapper.kt @@ -1,23 +1,9 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.testGuiFramework.recorder.compile object ScriptWrapper { - val TEST_METHOD_NAME: String = "testMe" + const val TEST_METHOD_NAME: String = "testMe" private fun classWrap(function: () -> (String)): String = "class CurrentTest: GuiTestCase() {\n${function.invoke()}\n}" private fun funWrap(function: () -> String): String = "fun $TEST_METHOD_NAME(){\n${function.invoke()}\n}" diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/ui/Notifier.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/ui/Notifier.kt index 2cb5560053ef..ef0374d3e580 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/ui/Notifier.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/recorder/ui/Notifier.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.testGuiFramework.recorder.ui import com.intellij.testGuiFramework.recorder.GuiRecorderManager @@ -23,7 +9,7 @@ import javax.swing.SwingUtilities */ object Notifier { - val LONG_OPERATION_PREFIX: String = "" + const val LONG_OPERATION_PREFIX: String = "" fun updateStatus(statusMessage: String) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListUtil.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListUtil.kt index 6f35d4d02fdd..9ae04945a03c 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListUtil.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListUtil.kt @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 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. - */ +// Copyright 2000-2018 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. @file:JvmName("ChangeListUtil") package com.intellij.openapi.vcs.changes @@ -22,7 +8,7 @@ import com.intellij.openapi.vcs.VcsBundle import com.intellij.openapi.vcs.changes.shelf.ShelvedChangeList import com.intellij.util.text.UniqueNameGenerator -private val CHANGELIST_NAME_PATTERN = "\\s\\[(.*)\\]" +private const val CHANGELIST_NAME_PATTERN = "\\s\\[(.*)\\]" private val STASH_MESSAGE_PATTERN = VcsBundle.message("stash.changes.message", ".*") private val SYSTEM_CHANGELIST_REGEX = (STASH_MESSAGE_PATTERN + CHANGELIST_NAME_PATTERN).toRegex() diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.kt b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.kt index c08d4a554b86..76b11930f451 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.kt +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.openapi.vcs import com.intellij.openapi.diagnostic.Logger @@ -24,10 +10,10 @@ class LineStatusTrackerRevertAutoTest : BaseLineStatusTrackerTestCase() { companion object { private val LOG = Logger.getInstance(LineStatusTrackerRevertAutoTest::class.java) - private val TEST_RUNS = 100 - private val MODIFICATIONS = 10 - private val TEXT_LENGTH = 10 - private val CHANGE_LENGTH = 10 + private const val TEST_RUNS = 100 + private const val MODIFICATIONS = 10 + private const val TEXT_LENGTH = 10 + private const val CHANGE_LENGTH = 10 } private lateinit var myRng: Random diff --git a/plugins/ant/jps-plugin/testSrc/org/jetbrains/jps/ant/JpsAntSerializationTest.kt b/plugins/ant/jps-plugin/testSrc/org/jetbrains/jps/ant/JpsAntSerializationTest.kt index a5883eec95bd..78648f6017c1 100644 --- a/plugins/ant/jps-plugin/testSrc/org/jetbrains/jps/ant/JpsAntSerializationTest.kt +++ b/plugins/ant/jps-plugin/testSrc/org/jetbrains/jps/ant/JpsAntSerializationTest.kt @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2012 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. - */ +// Copyright 2000-2018 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 org.jetbrains.jps.ant import com.intellij.openapi.util.io.FileUtil @@ -123,8 +109,8 @@ class JpsAntSerializationTest : JpsSerializationTestCase() { } companion object { - val PROJECT_PATH = "plugins/ant/jps-plugin/testData/ant-project" - val OPTIONS_PATH = "plugins/ant/jps-plugin/testData/config/options" + const val PROJECT_PATH = "plugins/ant/jps-plugin/testData/ant-project" + const val OPTIONS_PATH = "plugins/ant/jps-plugin/testData/config/options" private fun toFiles(classpath: List): Set { val result = THashSet(FileUtil.FILE_HASHING_STRATEGY) diff --git a/plugins/git4idea/tests/git4idea/test/TestGit.kt b/plugins/git4idea/tests/git4idea/test/TestGit.kt index efaf1fcc1a6b..db3da9ab05de 100644 --- a/plugins/git4idea/tests/git4idea/test/TestGit.kt +++ b/plugins/git4idea/tests/git4idea/test/TestGit.kt @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 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. - */ +// Copyright 2000-2018 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 git4idea.test import com.intellij.openapi.diagnostic.Logger @@ -30,7 +16,7 @@ import java.io.File /** * Any unknown error that could be returned by Git. */ -val UNKNOWN_ERROR_TEXT: String = "unknown error" +const val UNKNOWN_ERROR_TEXT: String = "unknown error" class TestGitImpl : GitImpl() { private val LOG = Logger.getInstance(TestGitImpl::class.java) diff --git a/plugins/gradle/java/src/integrations/maven/codeInsight/completion/MavenDependenciesGradleCompletionContributor.kt b/plugins/gradle/java/src/integrations/maven/codeInsight/completion/MavenDependenciesGradleCompletionContributor.kt index 18ab670983cf..5ae195eecfdd 100644 --- a/plugins/gradle/java/src/integrations/maven/codeInsight/completion/MavenDependenciesGradleCompletionContributor.kt +++ b/plugins/gradle/java/src/integrations/maven/codeInsight/completion/MavenDependenciesGradleCompletionContributor.kt @@ -102,11 +102,11 @@ class MavenDependenciesGradleCompletionContributor : AbstractGradleCompletionCon } companion object { - private val GROUP_LABEL = "group" - private val NAME_LABEL = "name" - private val VERSION_LABEL = "version" - private val DEPENDENCIES_SCRIPT_BLOCK = "dependencies" - private val MAX_RESULT = 1000 + private const val GROUP_LABEL = "group" + private const val NAME_LABEL = "name" + private const val VERSION_LABEL = "version" + private const val DEPENDENCIES_SCRIPT_BLOCK = "dependencies" + private const val MAX_RESULT = 1000 private val DEPENDENCIES_CALL_PATTERN = psiElement() .inside(true, psiElement(GrMethodCallExpression::class.java).with( diff --git a/plugins/settings-repository/src/IcsSettings.kt b/plugins/settings-repository/src/IcsSettings.kt index f317fd77529d..bb80609e1e60 100644 --- a/plugins/settings-repository/src/IcsSettings.kt +++ b/plugins/settings-repository/src/IcsSettings.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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 org.jetbrains.settingsRepository import com.fasterxml.jackson.annotation.JsonIgnore @@ -30,7 +16,7 @@ import com.intellij.util.io.sanitizeFileName import com.intellij.util.io.write import java.nio.file.Path -private val DEFAULT_COMMIT_DELAY = 10 * Time.MINUTE +private const val DEFAULT_COMMIT_DELAY = 10 * Time.MINUTE class MyPrettyPrinter : DefaultPrettyPrinter() { init { @@ -86,7 +72,6 @@ fun loadSettings(settingsFile: Path): IcsSettings { @JsonInclude(value = JsonInclude.Include.NON_DEFAULT) @JsonIgnoreProperties(ignoreUnknown = true) class IcsSettings { - var shareProjectWorkspace: Boolean = false var commitDelay: Int = DEFAULT_COMMIT_DELAY var doNoAskMapProject: Boolean = false var readOnlySources: List = SmartList() diff --git a/plugins/settings-repository/testSrc/IcsTestCase.kt b/plugins/settings-repository/testSrc/IcsTestCase.kt index d96307980807..7f2720192719 100644 --- a/plugins/settings-repository/testSrc/IcsTestCase.kt +++ b/plugins/settings-repository/testSrc/IcsTestCase.kt @@ -31,8 +31,8 @@ fun Repository.delete(path: String): Repository { val Repository.workTreePath: Path get() = workTree.toPath() -val SAMPLE_FILE_NAME = "file.xml" -val SAMPLE_FILE_CONTENT = """ +const val SAMPLE_FILE_NAME = "file.xml" +const val SAMPLE_FILE_CONTENT = """ """ diff --git a/plugins/stats-collector/log-events/test/com/intellij/stats/completion/LogEventFixtures.kt b/plugins/stats-collector/log-events/test/com/intellij/stats/completion/LogEventFixtures.kt index b4fa5e2c9b91..f438bcb721b3 100644 --- a/plugins/stats-collector/log-events/test/com/intellij/stats/completion/LogEventFixtures.kt +++ b/plugins/stats-collector/log-events/test/com/intellij/stats/completion/LogEventFixtures.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.stats.completion @@ -21,7 +7,7 @@ import com.intellij.stats.completion.events.* @Suppress("unused") object LogEventFixtures { - val sessionId = "session-id-xxx" + const val sessionId = "session-id-xxx" val completion_started_3_items_shown = CompletionStartedEvent("", "", "", "1", sessionId, "Java", true, 1, Fixtures.lookupList, diff --git a/plugins/stats-collector/src/com/intellij/completion/enhancer/ContributorsTimeStatistics.kt b/plugins/stats-collector/src/com/intellij/completion/enhancer/ContributorsTimeStatistics.kt index f408e941b097..6e67e40f4ff4 100644 --- a/plugins/stats-collector/src/com/intellij/completion/enhancer/ContributorsTimeStatistics.kt +++ b/plugins/stats-collector/src/com/intellij/completion/enhancer/ContributorsTimeStatistics.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.completion.enhancer @@ -79,9 +65,9 @@ class ContributorsTimeStatistics : PersistentStateComponent } companion object { - private val MIN_POWER = 7 - private val MAX_POWER = 17 - private val EXPONENT = 2.0 + private const val MIN_POWER = 7 + private const val MAX_POWER = 17 + private const val EXPONENT = 2.0 fun getInstance(): ContributorsTimeStatistics = service() } diff --git a/plugins/stats-collector/src/com/intellij/stats/experiment/WebServiceStatusProvider.kt b/plugins/stats-collector/src/com/intellij/stats/experiment/WebServiceStatusProvider.kt index f5af9aeee334..a779012a60fc 100644 --- a/plugins/stats-collector/src/com/intellij/stats/experiment/WebServiceStatusProvider.kt +++ b/plugins/stats-collector/src/com/intellij/stats/experiment/WebServiceStatusProvider.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.stats.experiment @@ -32,14 +18,14 @@ class WebServiceStatusProvider( ): WebServiceStatus { companion object { - val STATUS_URL: String = "https://www.jetbrains.com/config/features-service-status.json" + const val STATUS_URL: String = "https://www.jetbrains.com/config/features-service-status.json" private val GSON = Gson() - private val SALT = "completion.stats.experiment.salt" - private val EXPERIMENT_VERSION_KEY = "completion.stats.experiment.version" - private val PERFORM_EXPERIMENT_KEY = "completion.ml.perform.experiment" - private val STATUS_UPDATED_TIMESTAMP_KEY = "completion.stats.status.updated.ts" + private const val SALT = "completion.stats.experiment.salt" + private const val EXPERIMENT_VERSION_KEY = "completion.stats.experiment.version" + private const val PERFORM_EXPERIMENT_KEY = "completion.ml.perform.experiment" + private const val STATUS_UPDATED_TIMESTAMP_KEY = "completion.stats.status.updated.ts" private val INFO_TTL = TimeUnit.DAYS.toMillis(7) private val DEFAULT_INFO = ExperimentInfo(0, "", false) @@ -52,24 +38,24 @@ class WebServiceStatusProvider( @Volatile private var dataServerUrl = "" override fun experimentVersion(): Int = info.experimentVersion - + override fun dataServerUrl(): String = dataServerUrl override fun isServerOk(): Boolean = serverStatus.equals("ok", ignoreCase = true) - + override fun isExperimentOnCurrentIDE(): Boolean { return experimentVersion() == 6 && !Registry.`is`("java.completion.ml.exit.experiment") } - + override fun updateStatus() { serverStatus = "" dataServerUrl = "" - + assertNotEDT() val response = requestSender.get(STATUS_URL) if (response != null && response.isOK()) { val map = parseServerResponse(response.text) - + val salt = map["salt"]?.toString() val experimentVersion = map["experimentVersion"]?.toString() val performExperiment = map["performExperiment"]?.toString() ?: "false" @@ -87,7 +73,7 @@ class WebServiceStatusProvider( } saveInfo(info) } - + serverStatus = map["status"]?.toString() ?: "" dataServerUrl = map["urlForZipBase64Content"]?.toString() ?: "" } diff --git a/plugins/stats-collector/src/com/intellij/stats/personalization/impl/CompletionFinishTypeFactors.kt b/plugins/stats-collector/src/com/intellij/stats/personalization/impl/CompletionFinishTypeFactors.kt index 02ebbedf8c9b..05968960c988 100644 --- a/plugins/stats-collector/src/com/intellij/stats/personalization/impl/CompletionFinishTypeFactors.kt +++ b/plugins/stats-collector/src/com/intellij/stats/personalization/impl/CompletionFinishTypeFactors.kt @@ -1,29 +1,18 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.stats.personalization.impl -import com.intellij.stats.personalization.* +import com.intellij.stats.personalization.FactorReader +import com.intellij.stats.personalization.FactorUpdater +import com.intellij.stats.personalization.UserFactorBase +import com.intellij.stats.personalization.UserFactorDescriptions /** * @author Vitaliy.Bibaev */ -private val explicitSelectKey = "explicitSelect" -private val typedSelectKey = "typedSelect" -private val cancelledKey = "cancelled" +private const val explicitSelectKey = "explicitSelect" +private const val typedSelectKey = "typedSelect" +private const val cancelledKey = "cancelled" class CompletionFinishTypeReader(private val factor: DailyAggregatedDoubleFactor) : FactorReader { fun getCountByKey(key: String): Double = factor.aggregateSum()[key] ?: 0.0 diff --git a/plugins/stats-collector/test/com/intellij/stats/completion/CompletionLoggingTestBase.kt b/plugins/stats-collector/test/com/intellij/stats/completion/CompletionLoggingTestBase.kt index d94298af0c0c..3f30de71db1d 100644 --- a/plugins/stats-collector/test/com/intellij/stats/completion/CompletionLoggingTestBase.kt +++ b/plugins/stats-collector/test/com/intellij/stats/completion/CompletionLoggingTestBase.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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.stats.completion @@ -26,8 +12,8 @@ import org.mockito.Mockito import org.picocontainer.MutablePicoContainer -val runnableInterface = "interface Runnable { void run(); void runFast(); }" -val testText = """ +const val runnableInterface = "interface Runnable { void run(); void runFast(); }" +const val testText = """ class Test { public void run() { Runnable r = new Runnable() { diff --git a/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/DistinctByKeyHandler.kt b/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/DistinctByKeyHandler.kt index 6eabd19e430c..14035cc7d178 100644 --- a/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/DistinctByKeyHandler.kt +++ b/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/DistinctByKeyHandler.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.debugger.streams.trace.impl.handler.unified import com.intellij.debugger.streams.trace.dsl.* @@ -19,8 +19,8 @@ open class DistinctByKeyHandler(callNumber: Int, dsl: Dsl, private val functionApplyName: String = "apply") : HandlerBase.Intermediate(dsl) { private companion object { - val KEY_EXTRACTOR_VARIABLE_PREFIX = "keyExtractor" - val TRANSITIONS_ARRAY_NAME = "transitionsArray" + const val KEY_EXTRACTOR_VARIABLE_PREFIX = "keyExtractor" + const val TRANSITIONS_ARRAY_NAME = "transitionsArray" } private val myPeekHandler = PeekTraceHandler(callNumber, "distinct", myCall.typeBefore, myCall.typeAfter, dsl) diff --git a/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/MatchHandler.kt b/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/MatchHandler.kt index 5c98448ca661..fe10eead89fc 100644 --- a/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/MatchHandler.kt +++ b/plugins/stream-debugger/src/com/intellij/debugger/streams/trace/impl/handler/unified/MatchHandler.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.debugger.streams.trace.impl.handler.unified import com.intellij.debugger.streams.trace.dsl.CodeBlock @@ -20,7 +20,7 @@ import com.intellij.openapi.util.TextRange */ class MatchHandler(private val call: TerminatorStreamCall, dsl: Dsl) : HandlerBase.Terminal(dsl) { private companion object { - val PREDICATE_NAME = "predicate42" + const val PREDICATE_NAME = "predicate42" } private val myPeekHandler = PeekTraceHandler(0, "filterMatch", call.typeBefore, call.typeBefore, dsl) diff --git a/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/ValueWithPositionImpl.kt b/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/ValueWithPositionImpl.kt index 719af792e717..a69db5abdcd0 100644 --- a/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/ValueWithPositionImpl.kt +++ b/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/ValueWithPositionImpl.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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.debugger.streams.ui.impl import com.intellij.debugger.streams.trace.TraceElement @@ -9,9 +9,9 @@ import com.intellij.debugger.streams.ui.ValueWithPosition */ data class ValueWithPositionImpl(override val traceElement: TraceElement) : ValueWithPosition { companion object { - val INVALID_POSITION: Int = Int.MIN_VALUE - val DEFAULT_VISIBLE_VALUE: Boolean = false - val DEFAULT_HIGHLIGHTING_VALUE: Boolean = false + const val INVALID_POSITION: Int = Int.MIN_VALUE + const val DEFAULT_VISIBLE_VALUE: Boolean = false + const val DEFAULT_HIGHLIGHTING_VALUE: Boolean = false } private var myPosition: Int = INVALID_POSITION diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/IdeaSVNConfigFile.kt b/plugins/svn4idea/src/org/jetbrains/idea/svn/IdeaSVNConfigFile.kt index 88d5ae5482e9..c2da1df9f7d2 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/IdeaSVNConfigFile.kt +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/IdeaSVNConfigFile.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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 org.jetbrains.idea.svn import com.intellij.openapi.diagnostic.logger @@ -121,15 +121,11 @@ class IdeaSVNConfigFile(private val myPath: Path) { } companion object { - @JvmField - val SERVERS_FILE_NAME: String = "servers" - @JvmField - val CONFIG_FILE_NAME: String = "config" + const val SERVERS_FILE_NAME: String = "servers" + const val CONFIG_FILE_NAME: String = "config" - @JvmField - val DEFAULT_GROUP_NAME: String = "global" - @JvmField - val GROUPS_GROUP_NAME: String = "groups" + const val DEFAULT_GROUP_NAME: String = "global" + const val GROUPS_GROUP_NAME: String = "groups" @JvmStatic fun getNewGroupName(host: String, configFile: IdeaSVNConfigFile): String { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ErrorCode.kt b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ErrorCode.kt index 0f05de2e933c..4d74a1e9bdb7 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ErrorCode.kt +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ErrorCode.kt @@ -1,10 +1,10 @@ -// Copyright 2000-2017 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. +// Copyright 2000-2018 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 org.jetbrains.idea.svn.api import org.jetbrains.idea.svn.api.ErrorCategory.* -private val ERROR_BASE = 120000 -private val ERROR_CATEGORY_SIZE = 5000 +private const val ERROR_BASE = 120000 +private const val ERROR_CATEGORY_SIZE = 5000 enum class ErrorCategory(val code: Int) { ENTRY(6), diff --git a/python/pydevSrc/com/jetbrains/python/console/pydev/PydevXmlRpcClient.kt b/python/pydevSrc/com/jetbrains/python/console/pydev/PydevXmlRpcClient.kt index f14e43de75bc..d764294ebf91 100644 --- a/python/pydevSrc/com/jetbrains/python/console/pydev/PydevXmlRpcClient.kt +++ b/python/pydevSrc/com/jetbrains/python/console/pydev/PydevXmlRpcClient.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2018 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.jetbrains.python.console.pydev import com.intellij.openapi.diagnostic.Logger @@ -130,7 +131,7 @@ constructor(private val process: Process, hostname: String?, port: Int) : IPydev * ItelliJ Logging */ private val LOG = Logger.getInstance(PydevXmlRpcClient::class.java.name) - private val MIN_TIME_SLICE: Long = 1000 - private val TIME_LIMIT: Long = 40000 + private const val MIN_TIME_SLICE: Long = 1000 + private const val TIME_LIMIT: Long = 40000 } } diff --git a/python/src/com/jetbrains/python/console/PythonConsoleToolWindow.java b/python/src/com/jetbrains/python/console/PythonConsoleToolWindow.java index d4be819b229a..903427a9bf3e 100644 --- a/python/src/com/jetbrains/python/console/PythonConsoleToolWindow.java +++ b/python/src/com/jetbrains/python/console/PythonConsoleToolWindow.java @@ -105,7 +105,7 @@ public class PythonConsoleToolWindow { } public static ToolWindow getToolWindow(Project project) { - return ToolWindowManager.getInstance(project).getToolWindow(PythonConsoleToolWindowFactory.Companion.getID()); + return ToolWindowManager.getInstance(project).getToolWindow(PythonConsoleToolWindowFactory.ID); } public void setContent(RunContentDescriptor contentDescriptor) { diff --git a/python/src/com/jetbrains/python/console/PythonConsoleToolWindowFactory.kt b/python/src/com/jetbrains/python/console/PythonConsoleToolWindowFactory.kt index 9d632ea0889b..228dfe3a7ee1 100644 --- a/python/src/com/jetbrains/python/console/PythonConsoleToolWindowFactory.kt +++ b/python/src/com/jetbrains/python/console/PythonConsoleToolWindowFactory.kt @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 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. - */ +// Copyright 2000-2018 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.jetbrains.python.console import com.intellij.openapi.application.TransactionGuard @@ -36,6 +22,6 @@ class PythonConsoleToolWindowFactory : ToolWindowFactory, DumbAware { } companion object { - val ID: String = "Python Console" + const val ID: String = "Python Console" } } diff --git a/python/src/com/jetbrains/python/testing/PyTestsShared.kt b/python/src/com/jetbrains/python/testing/PyTestsShared.kt index 30af97b8622a..2f3127dd424f 100644 --- a/python/src/com/jetbrains/python/testing/PyTestsShared.kt +++ b/python/src/com/jetbrains/python/testing/PyTestsShared.kt @@ -281,7 +281,7 @@ abstract class PyAbstractTestSettingsEditor(private val sharedForm: PyTestShared /** * Default target path (run all tests ion project folder) */ -private val DEFAULT_PATH = "" +private const val DEFAULT_PATH = "" /** * Target depends on target type. It could be path to file/folder or python target diff --git a/python/tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt b/python/tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt index 15e94e0c6649..5328021c4bb1 100644 --- a/python/tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt +++ b/python/tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2018 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.jetbrains.python.tools import com.intellij.execution.configurations.GeneralCommandLine @@ -26,11 +27,11 @@ import java.io.File * @author traff */ -val stubsFileName: String = SDK_STUBS_STORAGE_NAME +const val stubsFileName: String = SDK_STUBS_STORAGE_NAME -val MERGE_STUBS_FROM_PATHS: String = "MERGE_STUBS_FROM_PATHS" +const val MERGE_STUBS_FROM_PATHS: String = "MERGE_STUBS_FROM_PATHS" -val PACK_STDLIB_FROM_PATH: String = "PACK_STDLIB_FROM_PATH" +const val PACK_STDLIB_FROM_PATH: String = "PACK_STDLIB_FROM_PATH" fun getBaseDirValue(): String? { val path: String? = System.getProperty(PREBUILT_INDICES_PATH_PROPERTY) diff --git a/uast/uast-common/src/org/jetbrains/uast/values/UPhiValue.kt b/uast/uast-common/src/org/jetbrains/uast/values/UPhiValue.kt index b068ccc3f908..0eada83a7f1e 100644 --- a/uast/uast-common/src/org/jetbrains/uast/values/UPhiValue.kt +++ b/uast/uast-common/src/org/jetbrains/uast/values/UPhiValue.kt @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2018 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 org.jetbrains.uast.values class UPhiValue private constructor(val values: Set) : UValueBase() { @@ -26,7 +12,7 @@ class UPhiValue private constructor(val values: Set) : UValueBase() { override fun toString(): String = values.joinToString(prefix = "Phi(", postfix = ")", separator = ", ") companion object { - private val PHI_LIMIT = 4 + private const val PHI_LIMIT = 4 fun create(values: Iterable): UValue { val flattenedValues = values.flatMapTo(linkedSetOf()) { (it as? UPhiValue)?.values ?: listOf(it) }