@@ -25,20 +25,20 @@ private import AutomodelJavaUtil
2525bindingset [ limit]
2626private Endpoint getSampleForSignature (
2727 int limit , string package , string type , string subtypes , string name , string signature ,
28- string input , string output , string isVarargs , string extensibleType
28+ string input , string output , string isVarargs , string extensibleType , string alreadyAiModeled
2929) {
3030 exists ( int n , int num_endpoints , ApplicationModeMetadataExtractor meta |
3131 num_endpoints =
3232 count ( Endpoint e |
33- e . getExtensibleType ( ) = extensibleType and
34- meta . hasMetadata ( e , package , type , subtypes , name , signature , input , output , isVarargs )
33+ meta . hasMetadata ( e , package , type , subtypes , name , signature , input , output , isVarargs ,
34+ alreadyAiModeled , extensibleType )
3535 )
3636 |
3737 result =
3838 rank [ n ] ( Endpoint e , Location loc |
3939 loc = e .asTop ( ) .getLocation ( ) and
40- e . getExtensibleType ( ) = extensibleType and
41- meta . hasMetadata ( e , package , type , subtypes , name , signature , input , output , isVarargs )
40+ meta . hasMetadata ( e , package , type , subtypes , name , signature , input , output , isVarargs ,
41+ alreadyAiModeled , extensibleType )
4242 |
4343 e
4444 order by
@@ -66,19 +66,15 @@ where
6666 CharacteristicsImpl:: isCandidate ( endpoint , _) and
6767 endpoint =
6868 getSampleForSignature ( 9 , package , type , subtypes , name , signature , input , output ,
69- isVarargsArray , extensibleType ) and
69+ isVarargsArray , extensibleType , alreadyAiModeled ) and
70+ meta .hasMetadata ( endpoint , package , type , subtypes , name , signature , input , output ,
71+ isVarargsArray , alreadyAiModeled , extensibleType ) and
7072 // If a node is already modeled in MaD, we don't include it as a candidate. Otherwise, we might include it as a
7173 // candidate for query A, but the model will label it as a sink for one of the sink types of query B, for which it's
7274 // already a known sink. This would result in overlap between our detected sinks and the pre-existing modeling. We
7375 // assume that, if a sink has already been modeled in a MaD model, then it doesn't belong to any additional sink
7476 // types, and we don't need to reexamine it.
75- (
76- not CharacteristicsImpl:: isModeled ( endpoint , _, _, _) and alreadyAiModeled = ""
77- or
78- alreadyAiModeled .matches ( "%ai-%" ) and
79- CharacteristicsImpl:: isModeled ( endpoint , _, _, alreadyAiModeled )
80- ) and
81- meta .hasMetadata ( endpoint , package , type , subtypes , name , signature , input , output , isVarargsArray ) and
77+ alreadyAiModeled .matches ( [ "" , "%ai-%" ] ) and
8278 includeAutomodelCandidate ( package , type , name , signature )
8379select endpoint .asNode ( ) ,
8480 "Related locations: $@, $@, $@." + "\nmetadata: $@, $@, $@, $@, $@, $@, $@, $@, $@, $@." , //
0 commit comments