Fix compilation after moving to idea 173

This commit is contained in:
Vyacheslav Gerasimov
2017-08-14 15:37:26 +03:00
committed by Nikolay Krasko
parent 8f7a354592
commit 35fa8efbf3
8 changed files with 34 additions and 11 deletions
@@ -30,14 +30,15 @@ import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
public class MockFileManager implements FileManager {
private final PsiManagerEx myManager;
// in mock tests it's LightVirtualFile, they're only alive when they're referenced,
// and there can not be several instances representing the same file
private final FactoryMap<VirtualFile, FileViewProvider> myViewProviders = new ConcurrentWeakFactoryMap<VirtualFile, FileViewProvider>() {
private final ConcurrentMap<VirtualFile, FileViewProvider> myViewProviders = new ConcurrentWeakFactoryMap<VirtualFile, FileViewProvider>() {
@Override
protected Map<VirtualFile, FileViewProvider> createMap() {
protected ConcurrentMap<VirtualFile, FileViewProvider> createMap() {
return ContainerUtil.createConcurrentWeakKeyWeakValueMap();
}
@@ -33,7 +33,7 @@ class KtLightClassForDecompiledDeclaration(
override val kotlinOrigin: KtClassOrObject?,
private val file: KtClsFile
) : KtLightClassBase(clsDelegate.manager) {
val fqName = kotlinOrigin?.fqName ?: FqName(clsDelegate.qualifiedName)
val fqName = kotlinOrigin?.fqName ?: FqName(clsDelegate.qualifiedName.orEmpty())
override fun copy() = this
@@ -259,7 +259,6 @@ class GradleInspectionTest : GradleImportingTestCase() {
val foundProblems = presentation.problemElements
.values
.flatMap { it.toList() }
.mapNotNull { it as? ProblemDescriptorBase }
.map { it.descriptionTemplate }
@@ -54,6 +54,7 @@ import org.jetbrains.kotlin.utils.getOrPutNullable
import org.jetbrains.org.objectweb.asm.*
import java.io.File
import java.util.*
import java.util.concurrent.ConcurrentMap
fun isInlineFunctionLineNumber(file: VirtualFile, lineNumber: Int, project: Project): Boolean {
if (ProjectRootsUtil.isProjectSourceFile(project, file)) {
@@ -118,7 +119,7 @@ class WeakBytecodeDebugInfoStorage : ConcurrentWeakFactoryMap<BinaryCacheKey, By
return BytecodeDebugInfo(smapData, lineNumberMapping)
}
override fun createMap(): Map<BinaryCacheKey, BytecodeDebugInfo?> {
override fun createMap(): ConcurrentMap<BinaryCacheKey, BytecodeDebugInfo?> {
return ContainerUtil.createConcurrentWeakKeyWeakValueMap()
}
}
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.idea.maven
import com.intellij.codeInspection.CommonProblemDescriptor
import com.intellij.codeInspection.ProblemDescriptorBase
import com.intellij.codeInspection.QuickFix
import com.intellij.codeInspection.reference.RefEntity
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.Result
@@ -64,11 +65,11 @@ abstract class AbstractKotlinMavenInspectionTest : MavenImportingTestCase() {
val matcher = "<!--\\s*problem:\\s*on\\s*([^,]+),\\s*title\\s*(.+)\\s*-->".toRegex()
val expected = pomText.lines().mapNotNull { matcher.find(it) }.map { SimplifiedProblemDescription(it.groups[2]!!.value.trim(), it.groups[1]!!.value.trim()) }
val actualProblems =
runInspection(inspectionClass, myProject)
.problemElements
.filter { it.key.name == "pom.xml" }
.values
val problemElements = runInspection(inspectionClass, myProject).problemElements
val actualProblems = problemElements
.keys()
.filter { it.name == "pom.xml" }
.map { problemElements.get(it) }
.flatMap { it.toList() }
.mapNotNull { it as? ProblemDescriptorBase }
@@ -21,6 +21,7 @@ import com.intellij.execution.process.ProcessOutputTypes
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.TextRange
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.annotations.NotNull
import org.jetbrains.kotlin.console.actions.logError
import org.jetbrains.kotlin.diagnostics.Severity
import org.w3c.dom.Element
@@ -47,7 +48,7 @@ class ReplOutputHandler(
override fun isSilentlyDestroyOnClose() = true
override fun notifyTextAvailable(text: String, key: Key<*>?) {
override fun notifyTextAvailable(text: String, key: Key<*>) {
// hide warning about adding test folder to classpath
if (text.startsWith("warning: classpath entry points to a non-existent location")) return
@@ -68,6 +68,11 @@ public class MockParameterInfoUIContext implements ParameterInfoUIContext {
return myParameterOwner;
}
@Override
public boolean isSingleParameterInfo() {
return false;
}
@Override
public Color getDefaultParameterColor() {
return null;
@@ -86,6 +86,21 @@ public class MockUpdateParameterInfoContext implements UpdateParameterInfoContex
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
@Override
public boolean isPreservedOnHintHidden() {
return false;
}
@Override
public void setPreservedOnHintHidden(boolean value) {
}
@Override
public boolean isInnermostContext() {
return false;
}
@Override
public Project getProject() {
return null;