Java: add message column to qltest

This commit is contained in:
Jami Cogswell
2022-12-16 08:51:18 -05:00
parent bf6148c477
commit 640b450c47
2 changed files with 9 additions and 7 deletions

View File

@@ -1,3 +1,3 @@
| java.lang.String#valueOf(Object) | | java.lang.String#valueOf(Object) | no manual model |
| java.lang.Throwable#printStackTrace() | | java.lang.Throwable#printStackTrace() | no manual model |
| java.util.stream.Stream#collect(Collector) | | java.util.stream.Stream#collect(Collector) | no manual model |

View File

@@ -2,11 +2,12 @@ import java
import semmle.code.java.dataflow.ExternalFlow import semmle.code.java.dataflow.ExternalFlow
import TopJdkApis import TopJdkApis
from string apiName from string apiName, string message
where where
// top jdk api names for which there is no callable // top jdk api names for which there is no callable
topJdkApiName(apiName) and topJdkApiName(apiName) and
not hasCallable(apiName) not hasCallable(apiName) and
message = "no callable"
or or
// top jdk api names for which there isn't a manual model // top jdk api names for which there isn't a manual model
exists(TopJdkApi topApi | exists(TopJdkApi topApi |
@@ -14,6 +15,7 @@ where
apiName = apiName =
topApi.asCallable().getDeclaringType().getPackage() + "." + topApi.asCallable().getDeclaringType().getPackage() + "." +
topApi.asCallable().getDeclaringType().getSourceDeclaration() + "#" + topApi.asCallable().getDeclaringType().getSourceDeclaration() + "#" +
topApi.asCallable().getName() + paramsString(topApi.asCallable()) topApi.asCallable().getName() + paramsString(topApi.asCallable()) and
message = "no manual model"
) )
select apiName order by apiName select apiName, message order by apiName