@@ -37,9 +37,9 @@ newtype TApplicationModeEndpoint =
3737 )
3838 } or
3939 TMethodCall ( Call call ) { not call instanceof ConstructorCall } or
40- TOverriddenParameter ( Parameter p ) {
40+ TOverriddenParameter ( Parameter p , Method overriddenMethod ) {
4141 not p .getCallable ( ) .callsConstructor ( _) and
42- p .getCallable ( ) .( Method ) .overrides ( _ )
42+ p .getCallable ( ) .( Method ) .overrides ( overriddenMethod )
4343 }
4444
4545/**
@@ -174,18 +174,16 @@ class MethodCall extends ApplicationModeEndpoint, TMethodCall {
174174
175175class OverriddenParameter extends ApplicationModeEndpoint , TOverriddenParameter {
176176 Parameter p ;
177+ Method overriddenMethod ;
177178
178- OverriddenParameter ( ) { this = TOverriddenParameter ( p ) }
179+ OverriddenParameter ( ) { this = TOverriddenParameter ( p , overriddenMethod ) }
179180
180181 override Callable getCallable ( ) {
181- // XXX: we're returning the overriding callable here. This means that the
182- // candidate model will be about the overriding method, not the overridden
183- // method (which is more general).
184- // Doing it this way:
185- // - (+) makes the decision easier for the user
186- // - (+) is simplest, implementation-wise
187- // - (-) produces a less general model
188- result = p .getCallable ( )
182+ // NB: we're returning the overridden callable here. This means that the
183+ // candidate model will be about the overridden method, not the overriding
184+ // method. This is a more general model, that also applies to other
185+ // subclasses of the overridden class.
186+ result = overriddenMethod
189187 }
190188
191189 override Call getCall ( ) { none ( ) }
@@ -269,8 +267,8 @@ module ApplicationCandidatesImpl implements SharedCharacteristics::CandidateSig
269267 additional predicate sinkSpec (
270268 Endpoint e , string package , string type , string name , string signature , string ext , string input
271269 ) {
272- ApplicationModeGetCallable :: getCallable ( e ) .hasQualifiedName ( package , type , name ) and
273- signature = ExternalFlow:: paramsString ( ApplicationModeGetCallable :: getCallable ( e ) ) and
270+ e . getCallable ( ) .hasQualifiedName ( package , type , name ) and
271+ signature = ExternalFlow:: paramsString ( e . getCallable ( ) ) and
274272 ext = "" and
275273 input = e .getMaDInput ( )
276274 }
@@ -279,8 +277,8 @@ module ApplicationCandidatesImpl implements SharedCharacteristics::CandidateSig
279277 Endpoint e , string package , string type , string name , string signature , string ext ,
280278 string output
281279 ) {
282- ApplicationModeGetCallable :: getCallable ( e ) .hasQualifiedName ( package , type , name ) and
283- signature = ExternalFlow:: paramsString ( ApplicationModeGetCallable :: getCallable ( e ) ) and
280+ e . getCallable ( ) .hasQualifiedName ( package , type , name ) and
281+ signature = ExternalFlow:: paramsString ( e . getCallable ( ) ) and
284282 ext = "" and
285283 output = e .getMaDOutput ( )
286284 }
0 commit comments