Skip to content

Commit af8b2b6

Browse files
author
Daniel Santos
committed
Fix Android logging signature in java/ql/src/experimental/semmle/code/java/Logging.qll
1 parent a67db45 commit af8b2b6

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

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

Lines changed: 18 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,23 @@ 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+
(
33+
m.hasName("d") or
34+
m.hasName("e") or
35+
m.hasName("i") or
36+
m.hasName("v") or
37+
m.hasName("w") or
38+
m.hasName("wtf")
39+
) and
40+
(
41+
m.getDeclaringType().getASourceSupertype*() = t or
42+
m.getDeclaringType().extendsOrImplements*(t)
43+
) and
44+
m.getReturnType() instanceof IntegralType and
45+
this = m.getAReference()
46+
)
3147
}
3248

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

0 commit comments

Comments
 (0)