Skip to content

Commit a8ee633

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: apply review suggestions
1 parent f37f0a0 commit a8ee633

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

java/ql/test/ext/TopJdkApis/TopJdkApis.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,10 @@ class TopJdkApi extends SummarizedCallableBase {
7878
}
7979

8080
/** Holds if this API has a manual summary model. */
81-
private predicate hasManualSummary() {
82-
this instanceof SummarizedCallable and
83-
this.(SummarizedCallable).hasProvenance(false)
84-
}
81+
private predicate hasManualSummary() { this.(SummarizedCallable).hasProvenance(false) }
8582

8683
/** Holds if this API has a manual neutral model. */
8784
private predicate hasManualNeutral() {
88-
this instanceof FlowSummaryImpl::Public::NeutralCallable and
8985
this.(FlowSummaryImpl::Public::NeutralCallable).hasProvenance(false)
9086
}
9187

@@ -94,7 +90,7 @@ class TopJdkApi extends SummarizedCallableBase {
9490
/*
9591
* Note: the following top-100 APIs are not modeled with MaD:
9692
* java.util.stream.Stream#collect(Collector) : handled separately on a case-by-case basis as it is too complex for MaD
97-
* java.lang.String#valueOf(Object) : a complex case that we haven't fully decided how to deal with
93+
* java.lang.String#valueOf(Object) : also a complex case; an alias for `Object.toString`, except the dispatch is hidden
9894
* java.lang.Throwable#printStackTrace() : should probably not be a general step, but there might be specialised queries that care
9995
*/
10096

java/ql/test/ext/TopJdkApis/TopJdkApisTest.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from string apiName, string message
55
where
66
// top jdk api names for which there is no callable
77
topJdkApiName(apiName) and
8-
not exists(Callable c | hasApiName(c, apiName)) and
8+
not hasApiName(_, apiName) and
99
message = "no callable"
1010
or
1111
// top jdk api names for which there isn't a manual model

0 commit comments

Comments
 (0)