diff options
author | Lars Vogel | 2020-09-08 06:22:58 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-09-10 19:22:29 +0000 |
commit | d55fd34fd1ad0408220b676d824382a0f66861cc (patch) | |
tree | 0a52b73f921cc79f81bf5621bb341848cb9539a8 | |
parent | c3420f463013f55bc84747414420cd81b9887940 (diff) | |
download | eclipse.platform.text-d55fd34fd1ad0408220b676d824382a0f66861cc.tar.gz eclipse.platform.text-d55fd34fd1ad0408220b676d824382a0f66861cc.tar.xz eclipse.platform.text-d55fd34fd1ad0408220b676d824382a0f66861cc.zip |
Bug 566757 - Remove encoding migration in
FileDocumentProvider#getPersistedEncoding from 2004 (Bug 54058)
Change-Id: Ia38c21a513b19b981dfc867a80cb0ec6ffe55971
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
3 files changed, 2 insertions, 38 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java index be9d6f94a79..1d54e66c3cd 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java @@ -90,13 +90,6 @@ import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel; public class FileDocumentProvider extends StorageDocumentProvider { /** - * Qualified name for the encoding key. - * - * @since 2.1 - */ - private static final QualifiedName ENCODING_KEY = new QualifiedName(EditorsUI.PLUGIN_ID, "encoding"); //$NON-NLS-1$ - - /** * The runnable context for that provider. * @since 3.0 */ @@ -1016,38 +1009,11 @@ public class FileDocumentProvider extends StorageDocumentProvider { */ @Override protected String getPersistedEncoding(Object element) { - if (element instanceof IFileEditorInput) { - IFileEditorInput editorInput= (IFileEditorInput)element; - IFile file= editorInput.getFile(); - if (file != null) { - String encoding= null; - try { - encoding= file.getPersistentProperty(ENCODING_KEY); - } catch (CoreException x) { - // we ignore exceptions here because we support the ENCODING_KEY property only for compatibility reasons - } - if (encoding != null) { - // if we found an old encoding property, we try to migrate it to the new core.resources encoding support - try { - file.setCharset(encoding, getProgressMonitor()); - // if successful delete old property - file.setPersistentProperty(ENCODING_KEY, null); - } catch (CoreException ex) { - handleCoreException(ex, TextEditorMessages.FileDocumentProvider_getPersistedEncoding); - } - } else { - try { - encoding= file.getCharset(); - } catch (CoreException e) { - return null; - } - } - return encoding; - } - } return super.getPersistedEncoding(element); } + + /** * Persists the given encoding for the given element. * diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java index f4c363792e0..963001486f7 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java @@ -48,7 +48,6 @@ final class TextEditorMessages extends NLS { public static String FileDocumentProvider_error_out_of_sync; public static String FileDocumentProvider_task_saving; public static String FileDocumentProvider_resetDocument; - public static String FileDocumentProvider_getPersistedEncoding; public static String FileDocumentProvider_warning_fileIsDerived; public static String FileDocumentProvider_stateValidationFailed; public static String DocumentProvider_error_charset_mapping_failed_message_arg; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties index 6b315d26dda..2c6ec5f855b 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties @@ -19,7 +19,6 @@ FileDocumentProvider_createElementInfo=FileDocumentProvider.createElementInfo FileDocumentProvider_error_out_of_sync=Has been changed on the file system FileDocumentProvider_task_saving=Saving FileDocumentProvider_resetDocument=FileDocumentProvider.resetDocument -FileDocumentProvider_getPersistedEncoding=Cannot migrate encoding property FileDocumentProvider_warning_fileIsDerived= This file is derived and does not allow to be modified. FileDocumentProvider_stateValidationFailed= State validation failed. |