private void addUpstreamCommittersTriggeringBuild ( Run < ? , ? > build , Set < InternetAddress > to , Set < InternetAddress > cc , Set < InternetAddress > bcc , EnvVars env , final ExtendedEmailPublisherContext context , RecipientProviderUtilities . IDebug debug ) { debug . send ( "Adding upstream committer from job %s with build number %s" , build . getParent ( ) . getDisplayName ( ) , build . getNumber ( ) ) ; List < ChangeLogSet < ? > > changeSets = new ArrayList <> ( ) ; if ( build instanceof AbstractBuild < ? , ? > ) { AbstractBuild < ? , ? > b = ( AbstractBuild < ? , ? > ) build ; changeSets . add ( b . getChangeSet ( ) ) ; } else { try { // check for getChangeSets which WorkflowRun has Method m = build . getClass ( ) . getMethod ( "getChangeSets" ) ; changeSets = ( List < ChangeLogSet < ? extends ChangeLogSet . Entry > > ) m . invoke ( build ) ; } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException e ) { context . getListener ( ) . getLogger ( ) . print ( "Could not add upstream committers, build type does not provide change set" ) ; } } if ( ! changeSets . isEmpty ( ) ) { for ( ChangeLogSet < ? extends ChangeLogSet . Entry > changeSet : changeSets ) { for ( ChangeLogSet . Entry change : changeSet ) { addUserFromChangeSet ( change , to , cc , bcc , env , context , debug ) ; } } } }
Adds for the given upstream build the committers to the recipient list for each commit in the upstream build .