Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 460652

Summary: Fix trailing whitespaces in org.eclipse.ui.ide
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Lars Vogel <Lars.Vogel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jonah, Lars.Vogel, loskutov
Version: 4.5   
Target Milestone: 4.5 M6   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/42491
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=4093122862f312f2705e216d79a6556782bfc2d0
Whiteboard:

Description Lars Vogel CLA 2015-02-24 00:34:07 EST
Our contributors and committers fighting trailing whitespaces changes in our plug-ins. I suggest to clean that up for once to get rid of the "please remove whitespace" feedback.


I sugggest to start with org.eclipse.ui.ide where we have a lot of these.

Actions run Source clean up for whitespace and activate save action to remove trailing whitespace.

These changes can be ignored in Git via Team-> Git -> Ignore whitespace changes
Comment 1 Eclipse Genie CLA 2015-02-24 00:34:55 EST
New Gerrit change created: https://git.eclipse.org/r/42491

WARNING: this patchset contains 4913 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 2 Eclipse Genie CLA 2015-02-24 00:36:18 EST
WARNING: this patchset contains 4918 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 3 Eclipse Genie CLA 2015-02-24 00:37:50 EST
WARNING: this patchset contains 4918 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 4 Eclipse Genie CLA 2015-02-24 07:49:47 EST
WARNING: this patchset contains 4918 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 5 Eclipse Genie CLA 2015-02-24 07:54:43 EST
Gerrit change https://git.eclipse.org/r/42491 was merged to [master].
Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=4093122862f312f2705e216d79a6556782bfc2d0

WARNING: this patchset contains 4918 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 6 Lars Vogel CLA 2015-02-24 08:01:12 EST
Fixed
Comment 7 Lars Vogel CLA 2015-03-16 13:20:34 EDT
Verified in Git
Comment 8 Jonah Graham CLA 2017-05-11 05:23:01 EDT
:-( This change did more than trailing whitespace, it undid another commit, it reverted Bug 444840.


$ git diff -w 4093122862f312f2705e216d79a6556782bfc2d0^..4093122862f312f2705e216d79a6556782bfc2d0 | cat
diff --git a/bundles/org.eclipse.ui.ide/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.ui.ide/.settings/org.eclipse.jdt.ui.prefs
index 6afdc4e..550a72c 100644
--- a/bundles/org.eclipse.ui.ide/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.ui.ide/.settings/org.eclipse.jdt.ui.prefs
@@ -44,7 +44,7 @@ sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
 sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
 sp_cleanup.remove_private_constructors=true
 sp_cleanup.remove_redundant_type_arguments=true
-sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces=true
 sp_cleanup.remove_trailing_whitespaces_all=true
 sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
 sp_cleanup.remove_unnecessary_casts=true
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/IDE.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/IDE.java
index 89a04f0..2c3cefe 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/IDE.java
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/IDE.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2015 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -721,7 +721,7 @@ public final class IDE {
 	}
 
 	/**
-	 * Returns an editor descriptor appropriate for opening the given file
+	 * Returns an editor id appropriate for opening the given file
 	 * store.
 	 * <p>
 	 * The editor descriptor is determined using a multi-step process. This
@@ -744,12 +744,11 @@ public final class IDE {
 	 *
 	 * @param fileStore
 	 *            the file store
-	 * @return the editor descriptor, appropriate for opening the file
+	 * @return the id of an editor, appropriate for opening the file
 	 * @throws PartInitException
 	 *             if no editor can be found
-	 * @since 3.11
 	 */
-	public static IEditorDescriptor getEditorDescriptorForFileStore(IFileStore fileStore) throws PartInitException {
+	private static String getEditorId(IFileStore fileStore) throws PartInitException {
 		String name = fileStore.fetchInfo().getName();
 		if (name == null) {
 			throw new IllegalArgumentException();
@@ -776,7 +775,7 @@ public final class IDE {
 
 		IEditorDescriptor defaultEditor = editorReg.getDefaultEditor(name, contentType);
 		defaultEditor = overrideDefaultEditorAssociation(new FileStoreEditorInput(fileStore), contentType, defaultEditor);
-		return getEditorDescriptor(name, editorReg, defaultEditor);
+		return getEditorDescriptor(name, editorReg, defaultEditor).getId();
 	}
 
 	/**
@@ -1134,7 +1133,7 @@ public final class IDE {
 		}
 
         IEditorInput input = getEditorInput(fileStore);
-		String editorId = getEditorDescriptorForFileStore(fileStore).getId();
+        String editorId = getEditorId(fileStore);
 
         // open the editor on the file
         return page.openEditor(input, editorId);