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) {
6161 ]
6262}
6363
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 )
7269}
7370
74- /** Holds if the given API has a `Callable`. */
75- predicate hasCallable ( string apiName ) { exists ( Callable callable | apiName = getApiName ( callable ) ) }
76-
7771/** A top JDK API. */
7872class TopJdkApi extends SummarizedCallableBase {
7973 TopJdkApi ( ) {
8074 exists ( string apiName |
81- apiName = getApiName ( this .asCallable ( ) ) and
75+ hasApiName ( this .asCallable ( ) , apiName ) and
8276 topJdkApiName ( apiName )
8377 )
8478 }
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ from string apiName, string message
55where
66 // top jdk api names for which there is no callable
77 topJdkApiName ( apiName ) and
8- not hasCallable ( apiName ) and
8+ not exists ( Callable c | hasApiName ( c , apiName ) ) and
99 message = "no callable"
1010 or
1111 // top jdk api names for which there isn't a manual model
1212 exists ( TopJdkApi topApi |
1313 not topApi .hasManualMadModel ( ) and
14- apiName = getApiName ( topApi .asCallable ( ) ) and
14+ hasApiName ( topApi .asCallable ( ) , apiName ) and
1515 message = "no manual model"
1616 )
1717select apiName , message order by apiName
You can’t perform that action at this time.
0 commit comments