Fix compilation.
- rename isFinal extension property to avoid ambiguity with synthetic property in DeserializedClassTypeConstructor - add explicit parameter to lambda File.listFiles - return true from lambda Query.forEach
This commit is contained in:
@@ -154,7 +154,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase implements Class
|
|||||||
this.typeConstructor = TypeConstructorImpl.createForClass(
|
this.typeConstructor = TypeConstructorImpl.createForClass(
|
||||||
this,
|
this,
|
||||||
Annotations.Companion.getEMPTY(),
|
Annotations.Companion.getEMPTY(),
|
||||||
ModalityKt.isFinal(this),
|
ModalityKt.isFinalClass(this),
|
||||||
getName().asString(),
|
getName().asString(),
|
||||||
typeParameters,
|
typeParameters,
|
||||||
supertypes
|
supertypes
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ private fun KotlinType.canHaveSubtypesIgnoringNullability(): Boolean {
|
|||||||
|
|
||||||
when (descriptor) {
|
when (descriptor) {
|
||||||
is TypeParameterDescriptor -> return true
|
is TypeParameterDescriptor -> return true
|
||||||
is ClassDescriptor -> if (!descriptor.isFinal) return true
|
is ClassDescriptor -> if (!descriptor.isFinalClass) return true
|
||||||
}
|
}
|
||||||
|
|
||||||
for ((parameter, argument) in constructor.parameters.zip(arguments)) {
|
for ((parameter, argument) in constructor.parameters.zip(arguments)) {
|
||||||
|
|||||||
+2
-2
@@ -55,7 +55,7 @@ public class MultiModuleJavaAnalysisCustomTest : UsefulTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun testJavaEntitiesBelongToCorrectModule() {
|
fun testJavaEntitiesBelongToCorrectModule() {
|
||||||
val moduleDirs = File(PATH_TO_TEST_ROOT_DIR).listFiles { it.isDirectory() }!!
|
val moduleDirs = File(PATH_TO_TEST_ROOT_DIR).listFiles { it -> it.isDirectory() }!!
|
||||||
val environment = createEnvironment(moduleDirs)
|
val environment = createEnvironment(moduleDirs)
|
||||||
val modules = setupModules(environment, moduleDirs)
|
val modules = setupModules(environment, moduleDirs)
|
||||||
val resolverForProject = JvmAnalyzerFacade.setupResolverForProject(
|
val resolverForProject = JvmAnalyzerFacade.setupResolverForProject(
|
||||||
@@ -85,7 +85,7 @@ public class MultiModuleJavaAnalysisCustomTest : UsefulTestCase() {
|
|||||||
val modules = HashMap<String, TestModule>()
|
val modules = HashMap<String, TestModule>()
|
||||||
for (dir in moduleDirs) {
|
for (dir in moduleDirs) {
|
||||||
val name = dir.getName()
|
val name = dir.getName()
|
||||||
val kotlinFiles = KotlinTestUtils.loadToJetFiles(environment, dir.listFiles { it.extension == "kt" }?.toList().orEmpty())
|
val kotlinFiles = KotlinTestUtils.loadToJetFiles(environment, dir.listFiles { it -> it.extension == "kt" }?.toList().orEmpty())
|
||||||
val javaFilesScope = object : DelegatingGlobalSearchScope(GlobalSearchScope.allScope(project)) {
|
val javaFilesScope = object : DelegatingGlobalSearchScope(GlobalSearchScope.allScope(project)) {
|
||||||
override fun contains(file: VirtualFile): Boolean {
|
override fun contains(file: VirtualFile): Boolean {
|
||||||
if (file !in myBaseScope!!) return false
|
if (file !in myBaseScope!!) return false
|
||||||
|
|||||||
+1
-1
@@ -206,7 +206,7 @@ class LazyJavaClassDescriptor(
|
|||||||
|
|
||||||
override fun getAnnotations() = Annotations.EMPTY
|
override fun getAnnotations() = Annotations.EMPTY
|
||||||
|
|
||||||
override fun isFinal(): Boolean = isFinal
|
override fun isFinal(): Boolean = isFinalClass
|
||||||
|
|
||||||
override fun isDenotable() = true
|
override fun isDenotable() = true
|
||||||
|
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ enum class Modality {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val CallableMemberDescriptor.isOverridable: Boolean
|
val CallableMemberDescriptor.isOverridable: Boolean
|
||||||
get() = modality != Modality.FINAL && (containingDeclaration as? ClassDescriptor)?.isFinal != true
|
get() = modality != Modality.FINAL && (containingDeclaration as? ClassDescriptor)?.isFinalClass != true
|
||||||
|
|
||||||
val CallableMemberDescriptor.isOverridableOrOverrides: Boolean
|
val CallableMemberDescriptor.isOverridableOrOverrides: Boolean
|
||||||
get() = isOverridable || DescriptorUtils.isOverride(this)
|
get() = isOverridable || DescriptorUtils.isOverride(this)
|
||||||
|
|
||||||
val ClassDescriptor.isFinal: Boolean
|
val ClassDescriptor.isFinalClass: Boolean
|
||||||
get() = modality == Modality.FINAL && kind != ClassKind.ENUM_CLASS
|
get() = modality == Modality.FINAL && kind != ClassKind.ENUM_CLASS
|
||||||
|
|
||||||
val ClassDescriptor.isFinalOrEnum: Boolean
|
val ClassDescriptor.isFinalOrEnum: Boolean
|
||||||
|
|||||||
+1
-1
@@ -181,7 +181,7 @@ public class DeserializedClassDescriptor(
|
|||||||
|
|
||||||
override fun getSupertypes() = supertypes()
|
override fun getSupertypes() = supertypes()
|
||||||
|
|
||||||
override fun isFinal(): Boolean = isFinal
|
override fun isFinal(): Boolean = isFinalClass
|
||||||
|
|
||||||
override fun isDenotable() = true
|
override fun isDenotable() = true
|
||||||
|
|
||||||
|
|||||||
@@ -511,6 +511,7 @@ public class KotlinPositionManager(private val myDebugProcess: DebugProcess) : M
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result
|
result
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ public open class KotlinChangeInfo(
|
|||||||
|
|
||||||
for (caller in value) {
|
for (caller in value) {
|
||||||
add(caller)
|
add(caller)
|
||||||
OverridingMethodsSearch.search(caller.getRepresentativeLightMethod() ?: continue).forEach { add(it) }
|
OverridingMethodsSearch.search(caller.getRepresentativeLightMethod() ?: continue).forEach { add(it); true }
|
||||||
}
|
}
|
||||||
|
|
||||||
propagationTargetUsageInfos = result.toList()
|
propagationTargetUsageInfos = result.toList()
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ public class RenameKotlinPropertyProcessor : RenamePsiElementProcessor() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public abstract class AbstractInspectionTest : KotlinLightCodeInsightFixtureTest
|
|||||||
with(myFixture) {
|
with(myFixture) {
|
||||||
setTestDataPath("${KotlinTestUtils.getHomeDirectory()}/$srcDir")
|
setTestDataPath("${KotlinTestUtils.getHomeDirectory()}/$srcDir")
|
||||||
|
|
||||||
val afterFiles = srcDir.listFiles { it.name == "inspectionData" }?.single()?.listFiles { it.extension == "after" } ?: emptyArray()
|
val afterFiles = srcDir.listFiles { it -> it.name == "inspectionData" }?.single()?.listFiles { it -> it.extension == "after" } ?: emptyArray()
|
||||||
val psiFiles = srcDir.walkTopDown().treeFilter { it.name != "inspectionData" }.mapNotNull {
|
val psiFiles = srcDir.walkTopDown().treeFilter { it.name != "inspectionData" }.mapNotNull {
|
||||||
file ->
|
file ->
|
||||||
if (file.isDirectory) {
|
if (file.isDirectory) {
|
||||||
|
|||||||
@@ -245,8 +245,8 @@ public abstract class AbstractIncrementalJpsTest(
|
|||||||
return modifications
|
return modifications
|
||||||
}
|
}
|
||||||
|
|
||||||
val haveFilesWithoutNumbers = testDataDir.listFiles { it.getName().matches(".+\\.($COMMANDS_AS_REGEX_PART)$".toRegex()) }?.isNotEmpty() ?: false
|
val haveFilesWithoutNumbers = testDataDir.listFiles { it -> it.getName().matches(".+\\.($COMMANDS_AS_REGEX_PART)$".toRegex()) }?.isNotEmpty() ?: false
|
||||||
val haveFilesWithNumbers = testDataDir.listFiles { it.getName().matches(".+\\.($COMMANDS_AS_REGEX_PART)\\.\\d+$".toRegex()) }?.isNotEmpty() ?: false
|
val haveFilesWithNumbers = testDataDir.listFiles { it -> it.getName().matches(".+\\.($COMMANDS_AS_REGEX_PART)\\.\\d+$".toRegex()) }?.isNotEmpty() ?: false
|
||||||
|
|
||||||
if (haveFilesWithoutNumbers && haveFilesWithNumbers) {
|
if (haveFilesWithoutNumbers && haveFilesWithNumbers) {
|
||||||
fail("Bad test data format: files ending with both unnumbered and numbered $COMMANDS_AS_MESSAGE_PART were found")
|
fail("Bad test data format: files ending with both unnumbered and numbered $COMMANDS_AS_MESSAGE_PART were found")
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public abstract class AbstractProtoComparisonTest : UsefulTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun compileFileAndGetClasses(testPath: String, testDir: File, prefix: String): List<File> {
|
private fun compileFileAndGetClasses(testPath: String, testDir: File, prefix: String): List<File> {
|
||||||
val files = File(testPath).listFiles { it.name.startsWith(prefix) }!!
|
val files = File(testPath).listFiles { it -> it.name.startsWith(prefix) }!!
|
||||||
val sourcesDirectory = testDir.createSubDirectory("sources")
|
val sourcesDirectory = testDir.createSubDirectory("sources")
|
||||||
val classesDirectory = testDir.createSubDirectory("$prefix.src")
|
val classesDirectory = testDir.createSubDirectory("$prefix.src")
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public abstract class AbstractProtoComparisonTest : UsefulTestCase() {
|
|||||||
}
|
}
|
||||||
MockLibraryUtil.compileKotlin(sourcesDirectory.path, classesDirectory)
|
MockLibraryUtil.compileKotlin(sourcesDirectory.path, classesDirectory)
|
||||||
|
|
||||||
return File(classesDirectory, "test").listFiles() { it.name.endsWith(".class") }?.sortedBy { it.name }!!
|
return File(classesDirectory, "test").listFiles() { it -> it.name.endsWith(".class") }?.sortedBy { it.name }!!
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Printer.printDifference(oldClassFile: File, newClassFile: File) {
|
private fun Printer.printDifference(oldClassFile: File, newClassFile: File) {
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public class CompilerSmokeTest {
|
|||||||
|
|
||||||
private val javaExecutable = File( File(System.getProperty("java.home"), "bin"), "java")
|
private val javaExecutable = File( File(System.getProperty("java.home"), "bin"), "java")
|
||||||
|
|
||||||
private val embeddableJar = File(".").listFiles { it.name.startsWith("kotlin-compiler-embeddable", ignoreCase = true) && it.name.endsWith(".jar", ignoreCase = true) }?.firstOrNull()
|
private val embeddableJar = File(".").listFiles { it -> it.name.startsWith("kotlin-compiler-embeddable", ignoreCase = true) && it.name.endsWith(".jar", ignoreCase = true) }?.firstOrNull()
|
||||||
?: throw FileNotFoundException("cannot find kotlin-compiler-embeddable*.jar in the directory " + File(".").absolutePath)
|
?: throw FileNotFoundException("cannot find kotlin-compiler-embeddable*.jar in the directory " + File(".").absolutePath)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+2
-2
@@ -62,7 +62,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractCo
|
|||||||
afterCompileHook(args)
|
afterCompileHook(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getKotlinSources(): List<File> = getSource().filter { it.isKotlinFile() }
|
private fun getKotlinSources(): List<File> = (getSource() as Iterable<File>).filter { it.isKotlinFile() }
|
||||||
|
|
||||||
private fun File.isKotlinFile(): Boolean {
|
private fun File.isKotlinFile(): Boolean {
|
||||||
return when (FilenameUtils.getExtension(getName()).toLowerCase()) {
|
return when (FilenameUtils.getExtension(getName()).toLowerCase()) {
|
||||||
@@ -158,7 +158,7 @@ public open class KotlinCompile() : AbstractKotlinCompile<K2JVMCompilerArguments
|
|||||||
testsMap.get(this.name)?.let {
|
testsMap.get(this.name)?.let {
|
||||||
addFriendPathForTestTask(it)
|
addFriendPathForTestTask(it)
|
||||||
}
|
}
|
||||||
9
|
|
||||||
getLogger().kotlinDebug("args.moduleName = ${args.moduleName}")
|
getLogger().kotlinDebug("args.moduleName = ${args.moduleName}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ public abstract class AbstractAndroidBoxTest : AbstractBlackBoxCodegenTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun createEnvironmentForConfiguration(configuration: CompilerConfiguration, path: String) {
|
private fun createEnvironmentForConfiguration(configuration: CompilerConfiguration, path: String) {
|
||||||
val layoutPaths = File(path).listFiles { it.name.startsWith("layout") && it.isDirectory }!!.map { "$path${it.name}/" }
|
val layoutPaths = File(path).listFiles { it -> it.name.startsWith("layout") && it.isDirectory }!!.map { "$path${it.name}/" }
|
||||||
myEnvironment = createAndroidTestEnvironment(configuration, layoutPaths)
|
myEnvironment = createAndroidTestEnvironment(configuration, layoutPaths)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -54,5 +54,5 @@ fun UsefulTestCase.createAndroidTestEnvironment(configuration: CompilerConfigura
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getResPaths(path: String): List<String> {
|
fun getResPaths(path: String): List<String> {
|
||||||
return File(path).listFiles { it.name.startsWith("res") && it.isDirectory }!!.map { "$path${it.name}/" }
|
return File(path).listFiles { it -> it.name.startsWith("res") && it.isDirectory }!!.map { "$path${it.name}/" }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user