boolean modelChanged = false;  if (analysisRun != currentAnalysisRun) { modelChanged = true;   if (analysisRun.getTreeModel() == null) { DefaultMutableTreeNode bugRootNode = new DefaultMutableTreeNode(); DefaultTreeModel bugTreeModel = new DefaultTreeModel(bugRootNode); analysisRun.setTreeModel(bugTreeModel); }  }    String currentSortOrder = GROUP_BY_CLASS; if (!analysisRun.getSortOrder().equals(currentSortOrder)) { populateAnalysisRunTreeModel(analysisRun, currentSortOrder); }  if (modelChanged) { bugTree.setModel(analysisRun.getTreeModel()); currentAnalysisRun = analysisRun; }
for (int i = 0; i < GROUP_BY_ORDER_LIST.length; ++i) { DefaultMutableTreeNode bugRootNode = new DefaultMutableTreeNode(); DefaultTreeModel bugTreeModel = new DefaultTreeModel(bugRootNode);  String groupByOrder = GROUP_BY_ORDER_LIST[i]; analysisRun.setTreeModel(groupByOrder, bugTreeModel); populateAnalysisRunTreeModel(analysisRun, groupByOrder); if (i < bugTreeList.length) bugTreeList[i].setModel(bugTreeModel); }
    private void synchAnalysisRun(AnalysisRun analysisRun) {	boolean modelChanged = false;		if (analysisRun != currentAnalysisRun) {	    modelChanged = true;	    // If this is the first time the analysis run is being shown in	    // the bug tree, it won't have a tree model yet.	    if (analysisRun.getTreeModel() == null) {		DefaultMutableTreeNode bugRootNode = new DefaultMutableTreeNode();		DefaultTreeModel bugTreeModel = new DefaultTreeModel(bugRootNode);		analysisRun.setTreeModel(bugTreeModel);	    }	    	}		// Make sure that the sort order is correct.	//String currentSortOrder = groupByChooser.getSelectedItem().toString();        String currentSortOrder = GROUP_BY_CLASS;	if (!analysisRun.getSortOrder().equals(currentSortOrder)) {	    populateAnalysisRunTreeModel(analysisRun, currentSortOrder);	}		if (modelChanged) {	    bugTree.setModel(analysisRun.getTreeModel());	    currentAnalysisRun = analysisRun;	}		// TODO: restore state of tree! I.e., which nodes expanded, and selection    }