Skip to content

Commit feeb6a9

Browse files
authored
Address warning in FirebaseAppGetDetector (#6542)
The override for `visitMethodCall` was using a different name for the `UCallExpression` which could cause an issue if called by name
1 parent bae6706 commit feeb6a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/lint/src/main/kotlin/FirebaseAppGetDetector.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ import org.jetbrains.uast.getParentOfType
3535
class FirebaseAppGetDetector : Detector(), SourceCodeScanner {
3636
override fun getApplicableMethodNames(): List<String> = listOf("get")
3737

38-
override fun visitMethodCall(context: JavaContext, call: UCallExpression, method: PsiMethod) {
38+
override fun visitMethodCall(context: JavaContext, node: UCallExpression, method: PsiMethod) {
3939
if (!isFirebaseAppGet(method)) {
4040
return
4141
}
4242

43-
if (withinGetInstance(call)) {
43+
if (withinGetInstance(node)) {
4444
return
4545
}
46-
call.getParentOfType<UMethod>() ?: return
46+
node.getParentOfType<UMethod>() ?: return
4747
context.report(
4848
ISSUE,
49-
call,
50-
context.getCallLocation(call, includeReceiver = false, includeArguments = true),
49+
node,
50+
context.getCallLocation(node, includeReceiver = false, includeArguments = true),
5151
"Use of FirebaseApp#get(Class) is discouraged, and is only acceptable" +
5252
" in SDK#getInstance(...) methods. Instead declare dependencies explicitly in" +
5353
" your ComponentRegistrar and inject."

0 commit comments

Comments
 (0)