else if (groupBy == GROUP_BY_BUG_TYPE) {
if (groupName.equals("")) groupName = "Unnamed package"; } else if (groupBy == GROUP_BY_BUG_TYPE) {
    private void populateAnalysisRunTreeModel(AnalysisRun analysisRun, final String groupBy) {	// Set busy cursor - this is potentially a time-consuming operation	Cursor orig = this.getCursor();	this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));		final DefaultTreeModel bugTreeModel = analysisRun.getTreeModel();	final DefaultMutableTreeNode bugRootNode = (DefaultMutableTreeNode) bugTreeModel.getRoot();		// Delete all children from root node	bugRootNode.removeAllChildren();		// Sort the instances	TreeSet sortedCollection = new TreeSet(getBugInstanceComparator(groupBy));	sortedCollection.addAll(analysisRun.getBugInstances());		// The grouper callback is what actually adds the group and bug	// nodes to the tree.	Grouper.Callback callback = new Grouper.Callback() {	    private BugInstanceGroup currentGroup;	    private DefaultMutableTreeNode currentGroupNode;	    	    public void startGroup(Object member_) {		BugInstance member = (BugInstance) member_;		String groupName;		if (groupBy == GROUP_BY_CLASS)		    groupName = member.getPrimaryClass().getClassName();		else if (groupBy == GROUP_BY_PACKAGE)		    groupName = member.getPrimaryClass().getPackageName();		else if (groupBy == GROUP_BY_BUG_TYPE) {		    String desc = member.toString();		    groupName = desc.substring(0, desc.indexOf(':'));		} else		    throw new IllegalStateException("Unknown sort order: " + groupBy);		currentGroup = new BugInstanceGroup(groupBy, groupName);		currentGroupNode = new DefaultMutableTreeNode(currentGroup);		bugTreeModel.insertNodeInto(currentGroupNode, bugRootNode, bugRootNode.getChildCount());				insertIntoGroup(member);	    }	    	    public void addToGroup(Object member_) {		BugInstance member = (BugInstance) member_;		insertIntoGroup(member);	    }	    	    private void insertIntoGroup(BugInstance member) {		currentGroup.incrementMemberCount();		DefaultMutableTreeNode bugNode = new DefaultMutableTreeNode(member);		bugTreeModel.insertNodeInto(bugNode, currentGroupNode, currentGroupNode.getChildCount());		// Insert annotations		Iterator j = member.annotationIterator();		while (j.hasNext()) {		    BugAnnotation annotation = (BugAnnotation) j.next();		    DefaultMutableTreeNode annotationNode = new DefaultMutableTreeNode(annotation);		    bugTreeModel.insertNodeInto(annotationNode, bugNode,  bugNode.getChildCount());		}			    }	};		// Create the grouper, and execute it to populate the bug tree	Grouper grouper = new Grouper(callback);	Comparator groupComparator = getGroupComparator(groupBy);	grouper.group(sortedCollection, groupComparator);		// Sort order is up to date now	analysisRun.setSortOrder(groupBy);		// Let the tree know it needs to update itself	bugTreeModel.nodeStructureChanged(bugRootNode);		// Now we're done	this.setCursor(orig);    }