File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
java/ql/test/ext/TopJdkApis Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -61,24 +61,18 @@ predicate topJdkApiName(string apiName) {
61
61
]
62
62
}
63
63
64
- /**
65
- * Gets information about the given API in the form expected by the
66
- * MaD modeling framework.
67
- */
68
- string getApiName ( Callable api ) {
69
- result =
70
- api .getDeclaringType ( ) .getPackage ( ) + "." + api .getDeclaringType ( ) .getSourceDeclaration ( ) + "#" +
71
- api .getName ( ) + paramsString ( api )
64
+ /** Holds if `c` has the MaD-formatted name `apiName`. */
65
+ predicate hasApiName ( Callable c , string apiName ) {
66
+ apiName =
67
+ c .getDeclaringType ( ) .getPackage ( ) + "." + c .getDeclaringType ( ) .getSourceDeclaration ( ) + "#" +
68
+ c .getName ( ) + paramsString ( c )
72
69
}
73
70
74
- /** Holds if the given API has a `Callable`. */
75
- predicate hasCallable ( string apiName ) { exists ( Callable callable | apiName = getApiName ( callable ) ) }
76
-
77
71
/** A top JDK API. */
78
72
class TopJdkApi extends SummarizedCallableBase {
79
73
TopJdkApi ( ) {
80
74
exists ( string apiName |
81
- apiName = getApiName ( this .asCallable ( ) ) and
75
+ hasApiName ( this .asCallable ( ) , apiName ) and
82
76
topJdkApiName ( apiName )
83
77
)
84
78
}
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ from string apiName, string message
5
5
where
6
6
// top jdk api names for which there is no callable
7
7
topJdkApiName ( apiName ) and
8
- not hasCallable ( apiName ) and
8
+ not exists ( Callable c | hasApiName ( c , apiName ) ) and
9
9
message = "no callable"
10
10
or
11
11
// top jdk api names for which there isn't a manual model
12
12
exists ( TopJdkApi topApi |
13
13
not topApi .hasManualMadModel ( ) and
14
- apiName = getApiName ( topApi .asCallable ( ) ) and
14
+ hasApiName ( topApi .asCallable ( ) , apiName ) and
15
15
message = "no manual model"
16
16
)
17
17
select apiName , message order by apiName
You can’t perform that action at this time.
0 commit comments