Bug 73656 Encoding: refactoring should flush the undo stack on encoding changes
Refactoring should flush the undo stack on encoding changes. It is questionable what to do if the encoding changes since the encoding has an impact on the number of characters. Alternativly the UndoTectFileChange could remember the encoding and could compare it in isValid(...).
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/BufferValidationState.java
}
	
	
	protected BufferValidationState(IFile file) {
		fFile= file;
		fExisted= file.exists();
	}
	
	protected IDocument getDocument() {
		ITextFileBuffer buffer= getBuffer(fFile);
		if (buffer == null)
			return null;
		return buffer.getDocument();
		
	}
	
	protected static boolean isDirty(IFile file) {
		ITextFileBuffer buffer= getBuffer(file);
		if (buffer == null)
			return false;
		return buffer.isDirty();
	}
	
	protected static ITextFileBuffer getBuffer(IFile file) {
		ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
		IPath path= file.getFullPath();
		ITextFileBuffer buffer= manager.getTextFileBuffer(path);
		return buffer;
	}