Skip to content

Commit

Permalink
[JENKINS-31162] Constants as identifiers of the categories
Browse files Browse the repository at this point in the history
  • Loading branch information
recena committed Mar 21, 2016
1 parent 60803d4 commit ad2ae9d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/model/FreeStyleProject.java
Expand Up @@ -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;

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

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

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

/**
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down

0 comments on commit ad2ae9d

Please sign in to comment.