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,
|
||||
Annotations.Companion.getEMPTY(),
|
||||
ModalityKt.isFinal(this),
|
||||
ModalityKt.isFinalClass(this),
|
||||
getName().asString(),
|
||||
typeParameters,
|
||||
supertypes
|
||||
|
||||
@@ -40,7 +40,7 @@ private fun KotlinType.canHaveSubtypesIgnoringNullability(): Boolean {
|
||||
|
||||
when (descriptor) {
|
||||
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)) {
|
||||
|
||||
+2
-2
@@ -55,7 +55,7 @@ public class MultiModuleJavaAnalysisCustomTest : UsefulTestCase() {
|
||||
}
|
||||
|
||||
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 modules = setupModules(environment, moduleDirs)
|
||||
val resolverForProject = JvmAnalyzerFacade.setupResolverForProject(
|
||||
@@ -85,7 +85,7 @@ public class MultiModuleJavaAnalysisCustomTest : UsefulTestCase() {
|
||||
val modules = HashMap<String, TestModule>()
|
||||
for (dir in moduleDirs) {
|
||||
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)) {
|
||||
override fun contains(file: VirtualFile): Boolean {
|
||||
if (file !in myBaseScope!!) return false
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ class LazyJavaClassDescriptor(
|
||||
|
||||
override fun getAnnotations() = Annotations.EMPTY
|
||||
|
||||
override fun isFinal(): Boolean = isFinal
|
||||
override fun isFinal(): Boolean = isFinalClass
|
||||
|
||||
override fun isDenotable() = true
|
||||
|
||||
|
||||
@@ -39,12 +39,12 @@ enum class Modality {
|
||||
}
|
||||
|
||||
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
|
||||
get() = isOverridable || DescriptorUtils.isOverride(this)
|
||||
|
||||
val ClassDescriptor.isFinal: Boolean
|
||||
val ClassDescriptor.isFinalClass: Boolean
|
||||
get() = modality == Modality.FINAL && kind != ClassKind.ENUM_CLASS
|
||||
|
||||
val ClassDescriptor.isFinalOrEnum: Boolean
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ public class DeserializedClassDescriptor(
|
||||
|
||||
override fun getSupertypes() = supertypes()
|
||||
|
||||
override fun isFinal(): Boolean = isFinal
|
||||
override fun isFinal(): Boolean = isFinalClass
|
||||
|
||||
override fun isDenotable() = true
|
||||
|
||||
|
||||
@@ -511,6 +511,7 @@ public class KotlinPositionManager(private val myDebugProcess: DebugProcess) : M
|
||||
}
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
result
|
||||
|
||||
@@ -210,7 +210,7 @@ public open class KotlinChangeInfo(
|
||||
|
||||
for (caller in value) {
|
||||
add(caller)
|
||||
OverridingMethodsSearch.search(caller.getRepresentativeLightMethod() ?: continue).forEach { add(it) }
|
||||
OverridingMethodsSearch.search(caller.getRepresentativeLightMethod() ?: continue).forEach { add(it); true }
|
||||
}
|
||||
|
||||
propagationTargetUsageInfos = result.toList()
|
||||
|
||||
@@ -171,6 +171,7 @@ public class RenameKotlinPropertyProcessor : RenamePsiElementProcessor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public abstract class AbstractInspectionTest : KotlinLightCodeInsightFixtureTest
|
||||
with(myFixture) {
|
||||
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 {
|
||||
file ->
|
||||
if (file.isDirectory) {
|
||||
|
||||
@@ -245,8 +245,8 @@ public abstract class AbstractIncrementalJpsTest(
|
||||
return modifications
|
||||
}
|
||||
|
||||
val haveFilesWithoutNumbers = testDataDir.listFiles { 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 haveFilesWithoutNumbers = testDataDir.listFiles { it -> it.getName().matches(".+\\.($COMMANDS_AS_REGEX_PART)$".toRegex()) }?.isNotEmpty() ?: false
|
||||
val haveFilesWithNumbers = testDataDir.listFiles { it -> it.getName().matches(".+\\.($COMMANDS_AS_REGEX_PART)\\.\\d+$".toRegex()) }?.isNotEmpty() ?: false
|
||||
|
||||
if (haveFilesWithoutNumbers && haveFilesWithNumbers) {
|
||||
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> {
|
||||
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 classesDirectory = testDir.createSubDirectory("$prefix.src")
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class AbstractProtoComparisonTest : UsefulTestCase() {
|
||||
}
|
||||
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) {
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class CompilerSmokeTest {
|
||||
|
||||
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)
|
||||
|
||||
@Test
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractCo
|
||||
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 {
|
||||
return when (FilenameUtils.getExtension(getName()).toLowerCase()) {
|
||||
@@ -158,7 +158,7 @@ public open class KotlinCompile() : AbstractKotlinCompile<K2JVMCompilerArguments
|
||||
testsMap.get(this.name)?.let {
|
||||
addFriendPathForTestTask(it)
|
||||
}
|
||||
9
|
||||
|
||||
getLogger().kotlinDebug("args.moduleName = ${args.moduleName}")
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public abstract class AbstractAndroidBoxTest : AbstractBlackBoxCodegenTest() {
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -54,5 +54,5 @@ fun UsefulTestCase.createAndroidTestEnvironment(configuration: CompilerConfigura
|
||||
}
|
||||
|
||||
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