diff --git a/src/org/salesforce/apexdoc/FileManager.java b/src/org/salesforce/apexdoc/FileManager.java index 07022f2..376cc9f 100644 --- a/src/org/salesforce/apexdoc/FileManager.java +++ b/src/org/salesforce/apexdoc/FileManager.java @@ -326,11 +326,15 @@ private void createClassGroupContent(TreeMap mapFNameToContent, * @return String of HTML */ private String getPageLinks(TreeMap mapGroupNameToClassGroup, ArrayList cModels) { + boolean createMiscellaneousGroup = false; // this is the only place we need the list of class models sorted by name. TreeMap tm = new TreeMap(); - for (ClassModel cm : cModels) + for (ClassModel cm : cModels) { tm.put(cm.getClassName().toLowerCase(), cm); + if (!createMiscellaneousGroup && cm.getClassGroup() == null) + createMiscellaneousGroup = true; + } cModels = new ArrayList(tm.values()); String links = ""; @@ -338,7 +342,8 @@ private String getPageLinks(TreeMap mapGroupNameToClassGroup links += "
  • Home
  • "; // add a bucket ClassGroup for all Classes without a ClassGroup specified - mapGroupNameToClassGroup.put("Miscellaneous", new ClassGroup("Miscellaneous", null)); + if (createMiscellaneousGroup) + mapGroupNameToClassGroup.put("Miscellaneous", new ClassGroup("Miscellaneous", null)); // create a sorted list of ClassGroups