diff --git a/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java b/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java index 5f24893c540..55c0c388fc9 100644 --- a/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java +++ b/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java @@ -57,10 +57,7 @@ import org.glassfish.admingui.common.util.GuiUtil; import org.glassfish.admingui.common.util.RestUtil; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.logging.Level; /** @@ -83,14 +80,16 @@ public LoggingHandlers() { public static void getLoggerLevels(HandlerContext handlerCtx) { Map loggerLevels = (Map) handlerCtx.getInputValue("loggerLevels"); - List result = new ArrayList(); + List> result = new ArrayList<>(); if (loggerLevels != null) { - for(Map.Entry e : loggerLevels.entrySet()){ - Map oneRow = new HashMap(); - oneRow.put("loggerName", e.getKey()); - oneRow.put("level", e.getValue()); - oneRow.put("selected", false); - result.add(oneRow); + List keys = new ArrayList<>(loggerLevels.keySet()); + Collections.sort(keys); + for (String key : keys) { + Map oneRow = new HashMap<>(); + oneRow.put("loggerName", key); + oneRow.put("level", loggerLevels.get(key)); + oneRow.put("selected", false); + result.add(oneRow); } } handlerCtx.setOutputValue("loggerList", result);