m_ResultProducer.setResultListener(this);
  public void doRun(int run) throws Exception {    if (m_Instances == null) {      throw new Exception("No Instances set");    }    // Tell the resultproducer to send results to us    m_ResultProducer.setResultListener(this);    m_ResultProducer.setInstances(m_Instances);        // Clear the collected results    m_Keys.removeAllElements();    m_Results.removeAllElements();        //    System.err.println("Starting run " + run);    // Collect all the results    // Should be smarter -- first doing a run collecting only the keys    // from isResultRequired(), then determining if the average is required,    // then getting the actual results.    m_ResultProducer.doRun(run);    // Average the results collected    //System.err.println("Number of results collected: " + m_Keys.size());    // Check that the keys only differ on the selected key field    checkForMultipleDifferences();    Object [] template = (Object [])((Object [])m_Keys.elementAt(0)).clone();    template[m_KeyIndex] = null;    // Check for duplicate keys    checkForDuplicateKeys(template);    // Calculate the average and submit it if necessary    doAverageResult(template);  }