m_editorModel.saveBufferAs(buffer, file);  return;
buffer.save(file);
    void saveBufferAs(Buffer buffer) throws ConsoleException {      final File currentFile = buffer.getFile();      final Directory distributionDirectory =        m_model.getProperties().getDistributionDirectory();      if (currentFile != null) {        m_fileChooser.setSelectedFile(currentFile);      }      else {        m_fileChooser.setCurrentDirectory(distributionDirectory.getFile());      }      if (m_fileChooser.showSaveDialog(m_frame) !=          JFileChooser.APPROVE_OPTION) {        return;      }      final File file = m_fileChooser.getSelectedFile();      if (!distributionDirectory.isParentOf(file) &&        JOptionPane.showConfirmDialog(          m_frame,          m_model.getResources().getString(            "saveOutsideOfDistributionConfirmation.text"),          (String) getValue(NAME),          JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {        return;      }      if (!file.equals(currentFile)) {        final Buffer oldBuffer = m_editorModel.getBufferForFile(file);        if (oldBuffer != null) {          final Resources resources = m_model.getResources();          final ArrayList messages = new ArrayList();          messages.add(            resources.getString("ignoreExistingBufferConfirmation.text"));          if (oldBuffer.isDirty()) {            messages.add(              resources.getString("existingBufferHasUnsavedChanges.text"));          }          if (!oldBuffer.isUpToDate()) {            messages.add(              resources.getString("existingBufferOutOfDate.text"));          }          messages.add(            resources.getString("ignoreExistingBufferConfirmation2.text"));          if (JOptionPane.showConfirmDialog(                m_frame, messages.toArray(), file.toString(),                JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {            return;          }          m_editorModel.closeBuffer(oldBuffer);        }        else {          // TODO Handle file not up to date.          if (file.exists() &&              JOptionPane.showConfirmDialog(                m_frame,                m_model.getResources().getString("overwriteConfirmation.text"),                file.toString(),                JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {            return;          }        }        m_editorModel.saveBufferAs(buffer, file);        return;      }      else {        // Saving as the same name.        buffer.save();      }    }