Navigation Menu

Skip to content

Commit

Permalink
[JENKINS-40981] Request the instance from ExtensionList. Also set an …
Browse files Browse the repository at this point in the history
…ordinal for a proper extension order.
  • Loading branch information
Evaristo Gutiérrez committed Jan 12, 2017
1 parent 376d47b commit 408bca7
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -17,7 +17,7 @@
*
* Created by domi on 17/09/16.
*/
@Extension
@Extension(ordinal = 5)
public class GlobalConfigFiles extends Descriptor<GlobalConfigFiles> implements ConfigFileStore, ExtensionPoint, Describable<GlobalConfigFiles> {

private Collection<Config> configs = new ArrayList<Config>();
Expand All @@ -27,7 +27,7 @@ public final Descriptor<GlobalConfigFiles> getDescriptor() {
}

public static GlobalConfigFiles get() {
GlobalConfigFiles instance = Jenkins.getActiveInstance().getDescriptorList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
GlobalConfigFiles instance = Jenkins.getActiveInstance().getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
if (instance == null) { // TODO would be useful to have an ExtensionList.getOrFail
throw new IllegalStateException();
}
Expand Down

0 comments on commit 408bca7

Please sign in to comment.