public Object clone() throws CloneNotSupportedException {
  DefaultTreeSelectionModel clone=(DefaultTreeSelectionModel)super.clone();
  clone.changeSupport=null;
  if (selection != null) {
    int selLength=selection.length;
    clone.selection=new TreePath[selLength];
    System.arraycopy(selection,0,clone.selection,0,selLength);
  }
  clone.listenerList=new EventListenerList();
  clone.listSelectionModel=(DefaultListSelectionModel)listSelectionModel.clone();
  clone.uniquePaths=new Hashtable<TreePath,Boolean>();
  clone.lastPaths=new Hashtable<TreePath,Boolean>();
  clone.tempPaths=new TreePath[1];
  return clone;
}

public Object clone ( ) throws CloneNotSupportedException { DefaultTreeSelectionModel clone = ( DefaultTreeSelectionModel ) super . clone ( ) ; clone . changeSupport = null ; if ( selection != null ) { int selLength = selection . length ; clone . selection = new TreePath [ selLength ] ; System . arraycopy ( selection , 0 , clone . selection , 0 , selLength ) ; } clone . listenerList = new EventListenerList ( ) ; clone . listSelectionModel = ( DefaultListSelectionModel ) listSelectionModel . clone ( ) ; clone . uniquePaths = new Hashtable < TreePath , Boolean > ( ) ; clone . lastPaths = new Hashtable < TreePath , Boolean > ( ) ; clone . tempPaths = new TreePath [ 1 ] ; return clone ; }
returns a clone of this object with the same selection . this method does not duplicate selection listeners and property listeners .
