Skip to content

Commit

Permalink
Reduce code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Dec 3, 2024
1 parent ce78158 commit 6664e4b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ class ArgumentMatcher(
// as it seems to be the best option to get a type's simple name
typeName?.let { it == kotlinType?.nameIfStandardType?.asString() } ?: true
}

val ANY = ArgumentMatcher()
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import org.jetbrains.kotlin.psi.KtCallExpression
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.resolve.BindingContext
import org.sonar.check.Rule
import org.sonarsource.kotlin.api.checks.ANY
import org.sonarsource.kotlin.api.checks.AbstractCheck
import org.sonarsource.kotlin.api.checks.ArgumentMatcher
import org.sonarsource.kotlin.api.checks.ConstructorMatcher
Expand Down Expand Up @@ -88,7 +87,7 @@ private val WEAK_METHOD_MATCHERS = listOf(
) + CRYPTO_APIS.map {
FunMatcher(qualifier = it, name = GET_INSTANCE) {
withArguments(STRING_TYPE)
withArguments(ArgumentMatcher(typeName = STRING_TYPE), ANY)
withArguments(ArgumentMatcher(typeName = STRING_TYPE), ArgumentMatcher.ANY)
}
}

Expand Down

0 comments on commit 6664e4b

Please sign in to comment.