ReplaceJavaStaticMethodWithKotlinAnalogInspection: apply inspection on idea module

This commit is contained in:
Dmitry Gridin
2019-07-09 13:39:35 +03:00
parent 026949a758
commit d47a7234bb
4 changed files with 7 additions and 11 deletions
@@ -66,7 +66,7 @@ abstract class NodeIndentStrategy {
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
}
@@ -9,7 +9,6 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.extensions.PluginId
import java.io.File
import java.util.*
object KotlinPluginUtil {
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 {
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)
}
@@ -6,14 +6,12 @@
package org.jetbrains.kotlin.idea.debugger.stackFrame
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.xdebugger.frame.XValue
import com.intellij.xdebugger.frame.XValueChildrenList
import org.jetbrains.org.objectweb.asm.Type as AsmType
import org.jetbrains.kotlin.utils.getSafe
import java.lang.reflect.Modifier
import java.util.*
// Very Dirty Work-around.
// We should stop delegating to the Java stack frame and generate our trace elements from scratch.
@@ -90,7 +88,7 @@ class ExistingInstanceThisRemapper(
LOG.error(
"Can't find name/value lists, existing fields: "
+ Arrays.toString(XValueChildrenList::class.java.declaredFields)
+ XValueChildrenList::class.java.declaredFields?.contentToString()
)
return null
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.asJava.toLightClass
import org.jetbrains.kotlin.cfg.pseudocode.containingDeclarationForPseudocode
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtVisitorVoid
import java.util.*
import kotlin.system.measureNanoTime
import kotlin.test.Ignore
@@ -38,9 +37,9 @@ class WholeProjectLightClassTest : WholeProjectPerformanceTest(), WholeProjectKo
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
if (!predicate(classOrObject)) return
val lightClass = classOrObject.toLightClass() as? KtLightClassForSourceDeclaration ?: return
Arrays.hashCode(lightClass.superTypes)
Arrays.hashCode(lightClass.fields)
Arrays.hashCode(lightClass.methods)
lightClass.superTypes.contentHashCode()
lightClass.fields.contentHashCode()
lightClass.methods.contentHashCode()
// Just to be sure: access types
lightClass.fields.map { it.type }.hashCode()
lightClass.methods.map { it.returnType }.hashCode()