// Path: src/main/java/org/jenkinsci/plugins/github/extension/status/GitHubStatusContextSource.java
// public abstract class GitHubStatusContextSource extends AbstractDescribableImpl<GitHubStatusContextSource>
//         implements ExtensionPoint {
// 
//     /**
//      * @param run      actual run
//      * @param listener build listener
//      *
//      * @return simple short string to represent context of this state
//      */
//     public abstract String context(@NonNull Run<?, ?> run, @NonNull TaskListener listener);
// }
// 
// Path: src/main/java/com/coravy/hudson/plugins/github/GithubProjectProperty.java
// public static String displayNameFor(@NonNull Job<?, ?> job) {
//     GithubProjectProperty ghProp = job.getProperty(GithubProjectProperty.class);
//     if (ghProp != null && isNotBlank(ghProp.getDisplayName())) {
//         return ghProp.getDisplayName();
//     }
// 
//     return job.getFullName();
// }


import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Run;
import hudson.model.TaskListener;
import org.jenkinsci.plugins.github.extension.status.GitHubStatusContextSource;
import org.kohsuke.stapler.DataBoundConstructor;
import edu.umd.cs.findbugs.annotations.NonNull;
import static com.coravy.hudson.plugins.github.GithubProjectProperty.displayNameFor;
package org.jenkinsci.plugins.github.status.sources;




/**
 * Uses job name or defined in prop context name
 *
 * @author lanwen (Merkushev Kirill)
 * @since 1.19.0
 */
public class DefaultCommitContextSource extends GitHubStatusContextSource {

    @DataBoundConstructor
    public DefaultCommitContextSource() {
    }

    /**
     * @return context name
     * @see com.coravy.hudson.plugins.github.GithubProjectProperty#displayNameFor(hudson.model.Job)
     */
    @Override
    public String context(@NonNull Run<?, ?> run, @NonNull TaskListener listener) {
        return displayNameFor(run.getParent());
    }

    @Extension
// Path: src/main/java/org/jenkinsci/plugins/github/extension/status/GitHubStatusContextSource.java
// public abstract class GitHubStatusContextSource extends AbstractDescribableImpl<GitHubStatusContextSource>
//         implements ExtensionPoint {
// 
//     /**
//      * @param run      actual run
//      * @param listener build listener
//      *
//      * @return simple short string to represent context of this state
//      */
//     public abstract String context(@NonNull Run<?, ?> run, @NonNull TaskListener listener);
// }
// 
// Path: src/main/java/com/coravy/hudson/plugins/github/GithubProjectProperty.java
// public static String displayNameFor(@NonNull Job<?, ?> job) {
//     GithubProjectProperty ghProp = job.getProperty(GithubProjectProperty.class);
//     if (ghProp != null && isNotBlank(ghProp.getDisplayName())) {
//         return ghProp.getDisplayName();
//     }
// 
//     return job.getFullName();
// }


// Path: src/main/java/org/jenkinsci/plugins/github/status/sources/DefaultCommitContextSource.java
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Run;
import hudson.model.TaskListener;
import org.jenkinsci.plugins.github.extension.status.GitHubStatusContextSource;
import org.kohsuke.stapler.DataBoundConstructor;
import edu.umd.cs.findbugs.annotations.NonNull;
import static com.coravy.hudson.plugins.github.GithubProjectProperty.displayNameFor;

package org.jenkinsci.plugins.github.status.sources;




/**
 * Uses job name or defined in prop context name
 *
 * @author lanwen (Merkushev Kirill)
 * @since 1.19.0
 */
public class DefaultCommitContextSource extends GitHubStatusContextSource {

    @DataBoundConstructor
    public DefaultCommitContextSource() {
    }

    /**
     * @return context name
     * @see com.coravy.hudson.plugins.github.GithubProjectProperty#displayNameFor(hudson.model.Job)
     */
    @Override
    public String context(@NonNull Run<?, ?> run, @NonNull TaskListener listener) {
        return displayNameFor(run.getParent());
    }

    @Extension
    public static class DefaultContextSourceDescriptor extends Descriptor<GitHubStatusContextSource> {