Skip to content

Commit

Permalink
[JENKINS-31162] @oleg-nenashev's comments were addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
recena committed Mar 13, 2016
1 parent 25f9c99 commit 4ce1085
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions core/src/main/java/hudson/model/ItemGroupMixIn.java
Expand Up @@ -49,6 +49,7 @@
import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -337,15 +338,15 @@ public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, Str
}

/**
* Populate a {$link Categories} from a specific {$link ItemGroup}.
* Populate a {@link Categories} object from a specific {@link ItemGroup}.
*
* @return
* @return A object that represents a set of {@link Category}
*/
public static Categories getCategories(Authentication a, ItemGroup c) {
Categories categories = new Categories();
for (TopLevelItemDescriptor descriptor : Items.all(a, c)) {
ItemCategory ic = ItemCategoryConfigurator.getCategory(descriptor);
Map<String, Object> metadata = new HashMap<String, Object>();
Map<String, Serializable> metadata = new HashMap<String, Serializable>();

metadata.put("class", descriptor.clazz.getName());
metadata.put("iconClassName", "item-icon-" + descriptor.clazz.getName().substring(descriptor.clazz.getName().lastIndexOf(".") + 1).toLowerCase());
Expand All @@ -356,7 +357,7 @@ public static Categories getCategories(Authentication a, ItemGroup c) {
if (category != null) {
category.getItems().add(metadata);
} else {
List<Map<String, Object>> temp = new ArrayList<Map<String, Object>>();
List<Map<String, Serializable>> temp = new ArrayList<Map<String, Serializable>>();
temp.add(metadata);
category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getIconClassName(),
ic.getWeight(), ic.getMinToShow(), temp);
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/jenkins/model/item_category/Category.java
Expand Up @@ -26,10 +26,10 @@ public class Category implements Serializable {

private int minToShow;

private List<Map<String, Object>> items;
private List<Map<String, Serializable>> items;

public Category(String id, String name, String description, String iconClassName, int weight, int minToShow,
List<Map<String, Object>> items) {
List<Map<String, Serializable>> items) {
this.id= id;
this.name = name;
this.description = description;
Expand Down Expand Up @@ -70,7 +70,7 @@ public int getMinToShow() {
}

@Exported
public List<Map<String, Object>> getItems() {
public List<Map<String, Serializable>> getItems() {
return items;
}

Expand Down

0 comments on commit 4ce1085

Please sign in to comment.