public void startGroup(Object member_) { BugInstance member = (BugInstance) member_;
public void startGroup(BugInstance member) {
    private void populateAnalysisRunTreeModel(AnalysisRun analysisRun, final String groupBy) {        //System.out.println("Populating bug tree for order " + 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(groupBy);        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();                    if (groupName.equals(""))                        groupName = "Unnamed package";                } else if (groupBy == GROUP_BY_BUG_TYPE) {                    String desc = member.toString();                    String shortBugType = desc.substring(0, desc.indexOf(':'));                    String bugTypeDescription = I18N.instance().getBugTypeDescription(shortBugType);                    groupName = shortBugType + ": " + bugTypeDescription;                } 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 BugTreeNode(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);                // Let the tree know it needs to update itself        bugTreeModel.nodeStructureChanged(bugRootNode);                // Now we're done        this.setCursor(orig);    }