Skip to content

Commit b86cfd6

Browse files
committed
SONARKT-400 Migrate UnencryptedFilesInMobileApplicationsCheck to kotlin-analysis-api
1 parent 077edbd commit b86cfd6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sonar-kotlin-checks/src/main/java/org/sonarsource/kotlin/checks/UnencryptedFilesInMobileApplicationsCheck.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
*/
1717
package org.sonarsource.kotlin.checks
1818

19+
import org.jetbrains.kotlin.analysis.api.resolution.KaFunctionCall
1920
import org.jetbrains.kotlin.psi.KtCallExpression
20-
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
2121
import org.sonar.check.Rule
2222
import org.sonarsource.kotlin.api.checks.CallAbstractCheck
2323
import org.sonarsource.kotlin.api.checks.ConstructorMatcher
@@ -26,7 +26,6 @@ import org.sonarsource.kotlin.api.frontend.KotlinFileContext
2626

2727
private const val MESSAGE = "Make sure using unencrypted files is safe here."
2828

29-
@org.sonarsource.kotlin.api.frontend.K1only
3029
@Rule(key = "S6300")
3130
class UnencryptedFilesInMobileApplicationsCheck : CallAbstractCheck() {
3231
override val functionsToVisit = setOf(
@@ -36,7 +35,7 @@ class UnencryptedFilesInMobileApplicationsCheck : CallAbstractCheck() {
3635
FunMatcher(qualifier = "java.nio.file.Files", name = "write"),
3736
)
3837

39-
override fun visitFunctionCall(callExpression: KtCallExpression, resolvedCall: ResolvedCall<*>, kotlinFileContext: KotlinFileContext) {
38+
override fun visitFunctionCall(callExpression: KtCallExpression, resolvedCall: KaFunctionCall<*>, kotlinFileContext: KotlinFileContext) {
4039
if (kotlinFileContext.isInAndroid()) {
4140
kotlinFileContext.reportIssue(callExpression.calleeExpression!!, MESSAGE)
4241
}

0 commit comments

Comments
 (0)