// Path: src/main/java/com/synopsys/arc/jenkinsci/plugins/jobrestrictions/restrictions/JobRestrictionDescriptor.java
// public abstract class JobRestrictionDescriptor extends Descriptor<JobRestriction> {
//     public JobRestrictionDescriptor getDefaultSettingsProvider() {
//         return (JobRestrictionDescriptor)JobRestriction.all().find(AnyJobRestriction.class);
//     } 
// }
// 
// Path: src/main/java/com/synopsys/arc/jenkinsci/plugins/jobrestrictions/util/UserSelector.java
// public class UserSelector implements Describable<UserSelector>, Serializable {
//     
//     /**ID of the user*/
//     @CheckForNull String selectedUserId;
// 
//     @DataBoundConstructor
//     public UserSelector(@CheckForNull String selectedUserId) {
//         this.selectedUserId = hudson.Util.fixEmptyAndTrim(selectedUserId);
//     }
// 
//     @CheckForNull
//     public String getSelectedUserId() {
//         return selectedUserId;
//     }
// 
//     @Override
//     public Descriptor<UserSelector> getDescriptor() {
//         return DESCRIPTOR;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {       
//         if (obj instanceof UserSelector) {
//             UserSelector cmp = (UserSelector)obj;
//             return selectedUserId != null ? selectedUserId.equals(cmp.selectedUserId) : cmp.selectedUserId == null;
//         }           
//         return false;    
//     }
// 
//     @Override
//     public int hashCode() {
//         int hash = 7;
//         hash = 17 * hash + (selectedUserId != null ? selectedUserId.hashCode() : 0);
//         return hash;
//     }
//           
//     @Extension
//     public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl();
//     public static class DescriptorImpl extends Descriptor<UserSelector> {
//         
//         @Override
//         public String getDisplayName() {
//             return "N/A";
//         }
// 
//         @Restricted(NoExternalUse.class) // Stapler only
//         public FormValidation doCheckSelectedUserId(@QueryParameter String selectedUserId) {
//             selectedUserId = Util.fixEmptyAndTrim(selectedUserId);
//             if (selectedUserId == null) {
//                 return FormValidation.error("Field is empty");
//             }
// 
//             User user = User.getById(selectedUserId, false);
//             if (user == null) {
//                 return FormValidation.warning("User " + selectedUserId + " is not registered in Jenkins");
//             }
// 
//             return FormValidation.ok();
//         }
//     }
// }


import java.util.List;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import org.kohsuke.stapler.DataBoundConstructor;
import com.synopsys.arc.jenkinsci.plugins.jobrestrictions.Messages;
import com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestrictionDescriptor;
import com.synopsys.arc.jenkinsci.plugins.jobrestrictions.util.UserSelector;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import java.util.HashSet;
        return usersList;
    }

    public @Deprecated boolean isAcceptAutomaticRuns() {
        return acceptAutomaticRuns;
    }
    
    public boolean isAcceptAnonymousUsers() {
        return acceptAnonymousUsers;
    }
        
    private synchronized @Nonnull Set<String> getAcceptedUsers() {
        if (acceptedUsers == null) {
            final List<UserSelector> selectors = getUsersList();
            acceptedUsers = new HashSet<String>(selectors.size());
            for (UserSelector selector : selectors) {
                acceptedUsers.add(selector.getSelectedUserId()); // merge equal entries
            }
        }
        return acceptedUsers;
    }
    
    @Override
    protected boolean acceptsUser(@CheckForNull String userId) {
        return userId == null
                ? acceptAnonymousUsers
                : getAcceptedUsers().contains(userId);
    }
    
    @Extension
// Path: src/main/java/com/synopsys/arc/jenkinsci/plugins/jobrestrictions/restrictions/JobRestrictionDescriptor.java
// public abstract class JobRestrictionDescriptor extends Descriptor<JobRestriction> {
//     public JobRestrictionDescriptor getDefaultSettingsProvider() {
//         return (JobRestrictionDescriptor)JobRestriction.all().find(AnyJobRestriction.class);
//     } 
// }
// 
// Path: src/main/java/com/synopsys/arc/jenkinsci/plugins/jobrestrictions/util/UserSelector.java
// public class UserSelector implements Describable<UserSelector>, Serializable {
//     
//     /**ID of the user*/
//     @CheckForNull String selectedUserId;
// 
//     @DataBoundConstructor
//     public UserSelector(@CheckForNull String selectedUserId) {
//         this.selectedUserId = hudson.Util.fixEmptyAndTrim(selectedUserId);
//     }
// 
//     @CheckForNull
//     public String getSelectedUserId() {
//         return selectedUserId;
//     }
// 
//     @Override
//     public Descriptor<UserSelector> getDescriptor() {
//         return DESCRIPTOR;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {       
//         if (obj instanceof UserSelector) {
//             UserSelector cmp = (UserSelector)obj;
//             return selectedUserId != null ? selectedUserId.equals(cmp.selectedUserId) : cmp.selectedUserId == null;
//         }           
//         return false;    
//     }
// 
//     @Override
//     public int hashCode() {
//         int hash = 7;
//         hash = 17 * hash + (selectedUserId != null ? selectedUserId.hashCode() : 0);
//         return hash;
//     }
//           
//     @Extension
//     public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl();
//     public static class DescriptorImpl extends Descriptor<UserSelector> {
//         
//         @Override
//         public String getDisplayName() {
//             return "N/A";
//         }
// 
//         @Restricted(NoExternalUse.class) // Stapler only
//         public FormValidation doCheckSelectedUserId(@QueryParameter String selectedUserId) {
//             selectedUserId = Util.fixEmptyAndTrim(selectedUserId);
//             if (selectedUserId == null) {
//                 return FormValidation.error("Field is empty");
//             }
// 
//             User user = User.getById(selectedUserId, false);
//             if (user == null) {
//                 return FormValidation.warning("User " + selectedUserId + " is not registered in Jenkins");
//             }
// 
//             return FormValidation.ok();
//         }
//     }
// }


// Path: src/main/java/com/synopsys/arc/jenkinsci/plugins/jobrestrictions/restrictions/job/StartedByUserRestriction.java
import java.util.List;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import org.kohsuke.stapler.DataBoundConstructor;
import com.synopsys.arc.jenkinsci.plugins.jobrestrictions.Messages;
import com.synopsys.arc.jenkinsci.plugins.jobrestrictions.restrictions.JobRestrictionDescriptor;
import com.synopsys.arc.jenkinsci.plugins.jobrestrictions.util.UserSelector;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import java.util.HashSet;

        return usersList;
    }

    public @Deprecated boolean isAcceptAutomaticRuns() {
        return acceptAutomaticRuns;
    }
    
    public boolean isAcceptAnonymousUsers() {
        return acceptAnonymousUsers;
    }
        
    private synchronized @Nonnull Set<String> getAcceptedUsers() {
        if (acceptedUsers == null) {
            final List<UserSelector> selectors = getUsersList();
            acceptedUsers = new HashSet<String>(selectors.size());
            for (UserSelector selector : selectors) {
                acceptedUsers.add(selector.getSelectedUserId()); // merge equal entries
            }
        }
        return acceptedUsers;
    }
    
    @Override
    protected boolean acceptsUser(@CheckForNull String userId) {
        return userId == null
                ? acceptAnonymousUsers
                : getAcceptedUsers().contains(userId);
    }
    
    @Extension
    public static class DescriptorImpl extends JobRestrictionDescriptor {