ReplaceJavaStaticMethodWithKotlinAnalogInspection: apply inspection on idea module
This commit is contained in:
@@ -66,7 +66,7 @@ abstract class NodeIndentStrategy {
|
|||||||
throw IllegalArgumentException("Empty token set is unexpected")
|
throw IllegalArgumentException("Empty token set is unexpected")
|
||||||
}
|
}
|
||||||
|
|
||||||
fillTypes(within, types[0], Arrays.copyOfRange(types, 1, types.size))
|
fillTypes(within, types[0], types.copyOfRange(1, types.size))
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor
|
|||||||
import com.intellij.ide.plugins.PluginManagerCore
|
import com.intellij.ide.plugins.PluginManagerCore
|
||||||
import com.intellij.openapi.extensions.PluginId
|
import com.intellij.openapi.extensions.PluginId
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinPluginUtil {
|
object KotlinPluginUtil {
|
||||||
private class KotlinPluginInfo(val id: PluginId, val version: String, val path: File) {
|
private class KotlinPluginInfo(val id: PluginId, val version: String, val path: File) {
|
||||||
@@ -24,7 +23,7 @@ object KotlinPluginUtil {
|
|||||||
|
|
||||||
private val KOTLIN_PLUGIN_INFO: KotlinPluginInfo by lazy {
|
private val KOTLIN_PLUGIN_INFO: KotlinPluginInfo by lazy {
|
||||||
val plugin = PluginManagerCore.getPlugins().firstOrNull { it.pluginId.idString in KNOWN_KOTLIN_PLUGIN_IDS }
|
val plugin = PluginManagerCore.getPlugins().firstOrNull { it.pluginId.idString in KNOWN_KOTLIN_PLUGIN_IDS }
|
||||||
?: error("Kotlin plugin not found: " + Arrays.toString(PluginManagerCore.getPlugins()))
|
?: error("Kotlin plugin not found: " + PluginManagerCore.getPlugins().contentToString())
|
||||||
|
|
||||||
KotlinPluginInfo(plugin)
|
KotlinPluginInfo(plugin)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -6,14 +6,12 @@
|
|||||||
package org.jetbrains.kotlin.idea.debugger.stackFrame
|
package org.jetbrains.kotlin.idea.debugger.stackFrame
|
||||||
|
|
||||||
import com.intellij.debugger.engine.JavaValue
|
import com.intellij.debugger.engine.JavaValue
|
||||||
import com.intellij.debugger.ui.impl.watch.*
|
import com.intellij.debugger.ui.impl.watch.ThisDescriptorImpl
|
||||||
import com.intellij.openapi.diagnostic.Logger
|
import com.intellij.openapi.diagnostic.Logger
|
||||||
import com.intellij.xdebugger.frame.XValue
|
import com.intellij.xdebugger.frame.XValue
|
||||||
import com.intellij.xdebugger.frame.XValueChildrenList
|
import com.intellij.xdebugger.frame.XValueChildrenList
|
||||||
import org.jetbrains.org.objectweb.asm.Type as AsmType
|
|
||||||
import org.jetbrains.kotlin.utils.getSafe
|
import org.jetbrains.kotlin.utils.getSafe
|
||||||
import java.lang.reflect.Modifier
|
import java.lang.reflect.Modifier
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
// Very Dirty Work-around.
|
// Very Dirty Work-around.
|
||||||
// We should stop delegating to the Java stack frame and generate our trace elements from scratch.
|
// We should stop delegating to the Java stack frame and generate our trace elements from scratch.
|
||||||
@@ -90,7 +88,7 @@ class ExistingInstanceThisRemapper(
|
|||||||
|
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"Can't find name/value lists, existing fields: "
|
"Can't find name/value lists, existing fields: "
|
||||||
+ Arrays.toString(XValueChildrenList::class.java.declaredFields)
|
+ XValueChildrenList::class.java.declaredFields?.contentToString()
|
||||||
)
|
)
|
||||||
|
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.asJava.toLightClass
|
|||||||
import org.jetbrains.kotlin.cfg.pseudocode.containingDeclarationForPseudocode
|
import org.jetbrains.kotlin.cfg.pseudocode.containingDeclarationForPseudocode
|
||||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||||
import org.jetbrains.kotlin.psi.KtVisitorVoid
|
import org.jetbrains.kotlin.psi.KtVisitorVoid
|
||||||
import java.util.*
|
|
||||||
import kotlin.system.measureNanoTime
|
import kotlin.system.measureNanoTime
|
||||||
import kotlin.test.Ignore
|
import kotlin.test.Ignore
|
||||||
|
|
||||||
@@ -38,9 +37,9 @@ class WholeProjectLightClassTest : WholeProjectPerformanceTest(), WholeProjectKo
|
|||||||
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
|
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
|
||||||
if (!predicate(classOrObject)) return
|
if (!predicate(classOrObject)) return
|
||||||
val lightClass = classOrObject.toLightClass() as? KtLightClassForSourceDeclaration ?: return
|
val lightClass = classOrObject.toLightClass() as? KtLightClassForSourceDeclaration ?: return
|
||||||
Arrays.hashCode(lightClass.superTypes)
|
lightClass.superTypes.contentHashCode()
|
||||||
Arrays.hashCode(lightClass.fields)
|
lightClass.fields.contentHashCode()
|
||||||
Arrays.hashCode(lightClass.methods)
|
lightClass.methods.contentHashCode()
|
||||||
// Just to be sure: access types
|
// Just to be sure: access types
|
||||||
lightClass.fields.map { it.type }.hashCode()
|
lightClass.fields.map { it.type }.hashCode()
|
||||||
lightClass.methods.map { it.returnType }.hashCode()
|
lightClass.methods.map { it.returnType }.hashCode()
|
||||||
|
|||||||
Reference in New Issue
Block a user