code:     public void addRecipients(final ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) {
          final class Debug implements RecipientProviderUtilities.IDebug {
              private final ExtendedEmailPublisherDescriptor descriptor
                      = Jenkins.getActiveInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class);
  
              private final PrintStream logger = context.getListener().getLogger();
  
              public void send(final String format, final Object... args) {
                  descriptor.debug(logger, format, args);
              }
          }
          final Debug debug = new Debug();
          // looking for Upstream build.
          Run<?, ?> cur = context.getRun();
          Cause.UpstreamCause upc = cur.getCause(Cause.UpstreamCause.class);
          while (upc != null) {
              // UpstreamCause.getUpStreamProject() returns the full name, so use getItemByFullName
              Job<?, ?> p = (Job<?, ?>) Jenkins.getActiveInstance().getItemByFullName(upc.getUpstreamProject());
              if (p == null) {
                  context.getListener().getLogger().print("There is a break in the project linkage, could not retrieve upstream project information");
                  break;
              }
              cur = p.getBuildByNumber(upc.getUpstreamBuild());
              upc = cur.getCause(Cause.UpstreamCause.class);
          }
          addUserTriggeringTheBuild(cur, to, cc, bcc, env, context.getListener(), debug);
      }
  
  