View | Details | Raw Unified | Return to bug 49540
Collapse All | Expand All

(-)src/core/org/apache/jmeter/gui/util/MenuFactory.java (+22 lines)
Lines 22-27 Link Here
22
import java.io.IOException;
22
import java.io.IOException;
23
import java.util.Collection;
23
import java.util.Collection;
24
import java.util.Collections;
24
import java.util.Collections;
25
import java.util.Comparator;
25
import java.util.HashMap;
26
import java.util.HashMap;
26
import java.util.HashSet;
27
import java.util.HashSet;
27
import java.util.Iterator;
28
import java.util.Iterator;
Lines 151-156 Link Here
151
            }
152
            }
152
153
153
            initializeMenus();
154
            initializeMenus();
155
            sortPluginMenus();
154
        } catch (Throwable e) {
156
        } catch (Throwable e) {
155
            log.error("", e);
157
            log.error("", e);
156
            if (e instanceof Error){
158
            if (e instanceof Error){
Lines 639-642 Link Here
639
    static int elementsToSkip_size() {
641
    static int elementsToSkip_size() {
640
        return elementsToSkip.size();
642
        return elementsToSkip.size();
641
    }
643
    }
644
645
    /**
646
     * Menu sort helper class
647
     */
648
    private static class MenuInfoComparator implements Comparator<MenuInfo> {
649
       public int compare(MenuInfo o1, MenuInfo o2) {
650
          return o1.getLabel().compareTo(o2.getLabel());
642
}
651
}
652
    }
653
654
    /**
655
     * Sort loaded menus
656
     */
657
    private static void sortPluginMenus() {
658
       Iterator<List<MenuInfo>> it = menuMap.values().iterator();
659
       while (it.hasNext()) {
660
          List<MenuInfo> menuToSort = it.next();
661
          Collections.sort(menuToSort, new MenuInfoComparator());
662
       }
663
    }
664
}

Return to bug 49540