Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 27/Aug/14 9:21 PM
Description:

Almost every other extension point will call "isApplicable" on the item if it is a TopLevelItemDescriptor. For example, here's the SCM code.

public static List<SCMDescriptor<?>> _for(@Nonnull final Job project) {
    if(project==null)   return all();

    final Descriptor pd = Jenkins.getInstance().getDescriptor((Class) project.getClass());
    List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>();
    for (SCMDescriptor<?> scmDescriptor : all()) {
        if(!scmDescriptor.isApplicable(project))    continue;
 
        if (pd instanceof TopLevelItemDescriptor) {
            TopLevelItemDescriptor apd = (TopLevelItemDescriptor) pd;
            if(!apd.isApplicable(scmDescriptor))    continue;
        }

        r.add(scmDescriptor);
    }

    return r;
}

This doesn't seem to be present in the equivalent function for JobProperty, which seems to be getPropertyDescriptors.

This should be fixed so a custom TopLevelItem can veto specific job properties when they don't apply.

Project: Jenkins
Priority: Major Major
Reporter: Jonathan Sternberg
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to