try {
IBuffer workingCopyBuffer = workingCopy.getBuffer();
if (workingCopyBuffer == null) return;
primaryBuffer.setContents(workingCopyBuffer.getCharacters());
primaryBuffer.save(this.progressMonitor, this.force);
primary.makeConsistent(this);
hasSaved = true;
} finally {
if (!hasSaved){
// restore original buffer contents since something went wrong
primaryBuffer.setContents(primaryContents);