@@ -369,7 +369,29 @@ class LogArgumentToListener extends DataFlow::SharedFlowStep {
369369
370370class PublishedEventToEventSubscribedEventData extends DataFlow:: SharedFlowStep {
371371 override predicate step ( DataFlow:: Node start , DataFlow:: Node end ) {
372- start = ModelOutput:: getATypeNode ( "UI5PublishedEventData" ) .getInducingNode ( ) and
373- end = ModelOutput:: getATypeNode ( "UI5EventSubscriptionHandlerDataParameter" ) .getInducingNode ( )
372+ exists (
373+ API:: Node publishMethod , API:: Node publishedData , API:: Node subscribeMethod ,
374+ API:: Node subscribeMethodCallbackDataParameter
375+ |
376+ publishMethod = ModelOutput:: getATypeNode ( "UI5EventBusPublish" ) and
377+ publishedData = ModelOutput:: getATypeNode ( "UI5EventBusPublishedEventData" ) and
378+ subscribeMethod = ModelOutput:: getATypeNode ( "UI5EventBusSubscribe" ) and
379+ subscribeMethodCallbackDataParameter =
380+ ModelOutput:: getATypeNode ( "UI5EventSubscriptionHandlerDataParameter" )
381+ |
382+ /* Ensure that `publishedData` belongs to `publishMethod`. */
383+ publishMethod .getASuccessor * ( ) = publishedData and
384+ /* Ensure that `subscribeMethodCallbackDataParameter` belongs to `subscribeMethod`. */
385+ subscribeMethod .getASuccessor * ( ) = subscribeMethodCallbackDataParameter and
386+ /* Ensure that the published and subscribed channels are the same. */
387+ publishMethod .getACall ( ) .getArgument ( 0 ) .getALocalSource ( ) .getStringValue ( ) =
388+ subscribeMethod .getACall ( ) .getArgument ( 0 ) .getALocalSource ( ) .getStringValue ( ) and
389+ /* Ensure that the published and subscribed message types are the same. */
390+ publishMethod .getACall ( ) .getArgument ( 1 ) .getALocalSource ( ) .getStringValue ( ) =
391+ subscribeMethod .getACall ( ) .getArgument ( 1 ) .getALocalSource ( ) .getStringValue ( ) and
392+ /* Wire into the start and end of this step. */
393+ start = publishedData .getInducingNode ( ) and
394+ end = subscribeMethodCallbackDataParameter .getInducingNode ( )
395+ )
374396 }
375397}
0 commit comments