Skip to content

Commit 3123abf

Browse files
authored
Merge pull request github#6711 from bananabr/AndroidLoggingFix
Fix Android logging signature
2 parents 14a31a2 + 24e3ad4 commit 3123abf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

java/ql/src/experimental/semmle/code/java/Logging.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class LoggingCall extends MethodAccess {
1818
t.hasQualifiedName("org.scijava.log", "Logger") or
1919
t.hasQualifiedName("com.google.common.flogger", "LoggingApi") or
2020
t.hasQualifiedName("java.lang", "System$Logger") or
21-
t.hasQualifiedName("java.util.logging", "Logger") or
22-
t.hasQualifiedName("android.util", "Log")
21+
t.hasQualifiedName("java.util.logging", "Logger")
2322
|
2423
(
2524
m.getDeclaringType().getASourceSupertype*() = t or
@@ -28,6 +27,12 @@ class LoggingCall extends MethodAccess {
2827
m.getReturnType() instanceof VoidType and
2928
this = m.getAReference()
3029
)
30+
or
31+
exists(RefType t, Method m | t.hasQualifiedName("android.util", "Log") |
32+
m.hasName(["d", "e", "i", "v", "w", "wtf"]) and
33+
m.getDeclaringType() = t and
34+
this = m.getAReference()
35+
)
3136
}
3237

3338
/** Returns an argument which would be logged by this call. */

0 commit comments

Comments
 (0)