String pathname = outputFile.getPath(); String extension = ""; int i = pathname.lastIndexOf('.'); if(i > 0 && i < pathname.length()-1) { extension = pathname.substring(i+1).toLowerCase(); }  if(extension.length() == 0 || !extension.equals("mtr")) { pathname = pathname + ".mtr"; outputFile = new File(pathname); }  try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(outputFile)); oos.writeObject(chartDataTableModel); oos.writeObject(namearray); oos.flush(); oos.close(); } catch(Exception e) { if(log.isErrorEnabled()) { log.error("Exception: ", e); } }  inputFile = outputFile;
  public void saveMetrics() {    if(inputFile != null) {      saveMetrics(inputFile);    } else {      saveAsMetrics();    }  }