@@ -413,25 +413,28 @@ private string paramsStringQualified(Callable c) {
413413}
414414
415415private Element interpretElement0 (
416- string package , string type , boolean subtypes , string name , string signature
416+ string package , string type , boolean subtypes , string name , string signature , boolean isExact
417417) {
418418 elementSpec ( package , type , subtypes , name , signature , _) and
419419 (
420- exists ( Member m |
420+ exists ( Member m , boolean isExact0 |
421421 (
422- result = m
422+ result = m and isExact0 = true
423423 or
424- subtypes = true and result .( SrcMethod ) .overridesOrInstantiates + ( m )
424+ subtypes = true and result .( SrcMethod ) .overridesOrInstantiates + ( m ) and isExact0 = false
425425 ) and
426426 m .hasQualifiedName ( package , type , name )
427427 |
428- signature = "" or
429- paramsStringQualified ( m ) = signature or
430- paramsString ( m ) = signature
428+ signature = "" and isExact = false
429+ or
430+ paramsStringQualified ( m ) = signature and isExact = isExact0
431+ or
432+ paramsString ( m ) = signature and isExact = isExact0
431433 )
432434 or
433435 exists ( RefType t |
434436 t .hasQualifiedName ( package , type ) and
437+ isExact = false and
435438 ( if subtypes = true then result .( SrcRefType ) .getASourceSupertype * ( ) = t else result = t ) and
436439 name = "" and
437440 signature = ""
@@ -442,13 +445,16 @@ private Element interpretElement0(
442445/** Gets the source/sink/summary/neutral element corresponding to the supplied parameters. */
443446cached
444447Element interpretElement (
445- string package , string type , boolean subtypes , string name , string signature , string ext
448+ string package , string type , boolean subtypes , string name , string signature , string ext ,
449+ boolean isExact
446450) {
447451 elementSpec ( package , type , subtypes , name , signature , ext ) and
448- exists ( Element e | e = interpretElement0 ( package , type , subtypes , name , signature ) |
449- ext = "" and result = e
452+ exists ( Element e , boolean isExact0 |
453+ e = interpretElement0 ( package , type , subtypes , name , signature , isExact0 )
454+ |
455+ ext = "" and result = e and isExact = isExact0
450456 or
451- ext = "Annotated" and result .( Annotatable ) .getAnAnnotation ( ) .getType ( ) = e
457+ ext = "Annotated" and result .( Annotatable ) .getAnAnnotation ( ) .getType ( ) = e and isExact = false
452458 )
453459}
454460
@@ -538,13 +544,13 @@ predicate sinkNode(Node node, string kind) { sinkNode(node, kind, _) }
538544
539545// adapter class for converting Mad summaries to `SummarizedCallable`s
540546private class SummarizedCallableAdapter extends SummarizedCallable {
541- SummarizedCallableAdapter ( ) { summaryElement ( this , _, _, _, _, _) }
547+ SummarizedCallableAdapter ( ) { summaryElement ( this , _, _, _, _, _, _ ) }
542548
543549 private predicate relevantSummaryElementManual (
544550 string input , string output , string kind , string model
545551 ) {
546552 exists ( Provenance provenance |
547- summaryElement ( this , input , output , kind , provenance , model ) and
553+ summaryElement ( this , input , output , kind , provenance , model , _ ) and
548554 provenance .isManual ( )
549555 )
550556 }
@@ -553,11 +559,11 @@ private class SummarizedCallableAdapter extends SummarizedCallable {
553559 string input , string output , string kind , string model
554560 ) {
555561 exists ( Provenance provenance |
556- summaryElement ( this , input , output , kind , provenance , model ) and
562+ summaryElement ( this , input , output , kind , provenance , model , _ ) and
557563 provenance .isGenerated ( )
558564 ) and
559565 not exists ( Provenance provenance |
560- neutralElement ( this , "summary" , provenance ) and
566+ neutralElement ( this , "summary" , provenance , _ ) and
561567 provenance .isManual ( )
562568 )
563569 }
@@ -576,18 +582,23 @@ private class SummarizedCallableAdapter extends SummarizedCallable {
576582 }
577583
578584 override predicate hasProvenance ( Provenance provenance ) {
579- summaryElement ( this , _, _, _, provenance , _)
585+ summaryElement ( this , _, _, _, provenance , _, _ )
580586 }
587+
588+ override predicate hasExactModel ( ) { summaryElement ( this , _, _, _, _, _, true ) }
581589}
582590
583591// adapter class for converting Mad neutrals to `NeutralCallable`s
584592private class NeutralCallableAdapter extends NeutralCallable {
585593 string kind ;
586594 string provenance_ ;
595+ boolean exact ;
587596
588- NeutralCallableAdapter ( ) { neutralElement ( this , kind , provenance_ ) }
597+ NeutralCallableAdapter ( ) { neutralElement ( this , kind , provenance_ , exact ) }
589598
590599 override string getKind ( ) { result = kind }
591600
592601 override predicate hasProvenance ( Provenance provenance ) { provenance = provenance_ }
602+
603+ override predicate hasExactModel ( ) { exact = true }
593604}
0 commit comments