Skip to content
Permalink
Browse files
[JENKINS-31162] Constants as identifiers of the categories
  • Loading branch information
recena committed Mar 21, 2016
1 parent 60803d4 commit ad2ae9de3e8f6d8e81c0d69af1be7144eae2e5bd
Showing 4 changed files with 9 additions and 4 deletions.
@@ -25,6 +25,7 @@

import hudson.Extension;
import jenkins.model.Jenkins;
import jenkins.model.item_category.StandaloneProjectsCategory;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

@@ -81,7 +82,7 @@ public String getDescription() {

@Override
public String getCategoryId() {
return "standaloneprojects";
return StandaloneProjectsCategory.ID;
}

@Override
@@ -174,7 +174,7 @@ public String getDescription() {
*/
@Nonnull
public String getCategoryId() {
return new ItemCategory.UncategorizedCategory().getId();
return ItemCategory.UncategorizedCategory.ID;
}

/**
@@ -82,9 +82,11 @@ public static ItemCategory getCategory(TopLevelItemDescriptor descriptor) {
@Extension(ordinal = Integer.MIN_VALUE)
public static final class UncategorizedCategory extends ItemCategory {

public static final String ID = "uncategorized";

@Override
public String getId() {
return "uncategorized";
return ID;
}

@Override
@@ -9,9 +9,11 @@
@Extension(ordinal = Integer.MIN_VALUE + 1)
public class StandaloneProjectsCategory extends ItemCategory {

public static final String ID = "standaloneprojects";

@Override
public String getId() {
return "standaloneprojects";
return ID;
}

@Override

0 comments on commit ad2ae9d

Please sign in to comment.