Skip to content
Permalink
Browse files
[JENKINS-31162] @oleg-nenashev's comments were addressed
  • Loading branch information
recena committed Mar 13, 2016
1 parent 25f9c99 commit 4ce10855c760d4435c31537ebb31fd92e5ad6175
Showing 2 changed files with 8 additions and 7 deletions.
@@ -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;
@@ -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());
@@ -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);
@@ -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;
@@ -70,7 +70,7 @@ public int getMinToShow() {
}

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

0 comments on commit 4ce1085

Please sign in to comment.