cleanup — "might be const" inspection

This commit is contained in:
Vladimir Krivosheev
2018-11-05 12:29:36 +01:00
parent a06dd3ae9d
commit d358f0f9d3
53 changed files with 200 additions and 529 deletions
@@ -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<in MessageEvent>): Boolean {
@@ -38,7 +38,7 @@ class MethodCall(override val compilerRef: CompilerRef.JavaCompilerMethodRef,
private val context: ChainCompletionContext): RefChainOperation() {
private companion object {
val CONSTRUCTOR_METHOD_NAME = "<init>"
const val CONSTRUCTOR_METHOD_NAME = "<init>"
}
override val qualifierRawName: String
@@ -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
@@ -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 = "<target>"
private const val TARGET_MARKER = "<target>"
class BraceMatcherUtilTest : LightPlatformCodeInsightTestCase() {
fun testRightmostRParen0() = assertRightmostRParenth("(<caret>()([{()}])<target>)[]()")
@@ -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"
}
}
@@ -16,8 +16,8 @@ import java.util.*
internal val LOG = Logger.getInstance(SsiProcessor::class.java)
internal val COMMAND_START = "<!--#"
internal val COMMAND_END = "-->"
internal const val COMMAND_START = "<!--#"
internal const val COMMAND_END = "-->"
class SsiStopProcessingException : RuntimeException()
@@ -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)
@@ -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
@@ -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()
@@ -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`() {
@@ -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<String>, val removed: Set<String>) {
@@ -44,7 +44,7 @@ class ParameterNameHintsSettings : PersistentStateComponent<Element> {
private val removedPatterns = hashMapOf<String, Set<String>>()
private val addedPatterns = hashMapOf<String, Set<String>>()
private val options = hashMapOf<String, Boolean>()
fun addIgnorePattern(language: Language, pattern: String) {
val patternsBefore = getAddedPatterns(language)
setAddedPatterns(language, patternsBefore + pattern)
@@ -61,37 +61,37 @@ class ParameterNameHintsSettings : PersistentStateComponent<Element> {
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<Element> {
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<Element> {
options.remove(optionId)
}
else {
options[optionId] = value
options[optionId] = value
}
}
@@ -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<Pair<String, DebugLogLevel>>) : DialogWrapper(project, false) {
@@ -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 {
@@ -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<KeymapImpl>()
@@ -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
@@ -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")
@@ -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))
@@ -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")
@@ -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
@@ -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
@@ -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(" = ")
@@ -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"
/**
@@ -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
}
@@ -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?
@@ -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)
@@ -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
}
@@ -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
}
@@ -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")
@@ -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}"
@@ -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 = "<long>"
const val LONG_OPERATION_PREFIX: String = "<long>"
fun updateStatus(statusMessage: String) {
@@ -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()
@@ -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
@@ -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<String>): Set<File> {
val result = THashSet(FileUtil.FILE_HASHING_STRATEGY)
@@ -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)
@@ -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(
+2 -17
View File
@@ -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<ReadonlySource> = SmartList()
@@ -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 = """<application>
const val SAMPLE_FILE_NAME = "file.xml"
const val SAMPLE_FILE_CONTENT = """<application>
<component name="Encoding" default_encoding="UTF-8" />
</application>"""
@@ -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,
@@ -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<CompletionTimeStats>
}
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<ContributorsTimeStatistics>()
}
@@ -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() ?: ""
}
@@ -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
@@ -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() {
@@ -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)
@@ -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)
@@ -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
@@ -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 {
@@ -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),
@@ -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
}
}
@@ -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) {
@@ -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"
}
}
@@ -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
@@ -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)
@@ -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<UValue>) : UValueBase() {
@@ -26,7 +12,7 @@ class UPhiValue private constructor(val values: Set<UValue>) : 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>): UValue {
val flattenedValues = values.flatMapTo(linkedSetOf<UValue>()) { (it as? UPhiValue)?.values ?: listOf(it) }