From 5be65ffeadae8deb391aaade820ab1060b8685e2 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 2 Oct 2024 16:29:41 +0100 Subject: [PATCH] KE2: Only call analyze once, on the sourceModule --- .../src/main/kotlin/KotlinExtractor.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt b/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt index c87f5d4d9c3..ee14e253a20 100644 --- a/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt +++ b/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt @@ -214,12 +214,12 @@ fun doAnalysis( val checkTrapIdentical = false // TODO - val psiFiles = session.modulesWithFiles.getValue(sourceModule) - var fileNumber = 0 - val dump_psi = System.getenv("CODEQL_EXTRACTOR_JAVA_KOTLIN_DUMP") == "true" - for (psiFile in psiFiles) { - if (psiFile is KtFile) { - analyze(psiFile) { + analyze(sourceModule) { + val psiFiles = session.modulesWithFiles.getValue(sourceModule) + var fileNumber = 0 + val dump_psi = System.getenv("CODEQL_EXTRACTOR_JAVA_KOTLIN_DUMP") == "true" + for (psiFile in psiFiles) { + if (psiFile is KtFile) { if (dump_psi) { val showWhitespaces = false val showRanges = true @@ -269,11 +269,11 @@ fun doAnalysis( fileExtractionProblems.setNonRecoverableProblem() */ } + } else { + System.out.println("Warning: Not a KtFile") } - fileNumber += 1 - } else { - System.out.println("Warning: Not a KtFile") } + fileNumber += 1 } }