From fdbfec3f2bb2334d5818cc7bc3bed2cc75c151a8 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 9 May 2012 15:35:18 -0700 Subject: [PATCH] Cosmetics. --- .../cdt/internal/core/index/IndexFileLocation.java | 2 +- .../cdt/internal/core/pdom/IndexUpdatePolicy.java | 5 ++--- .../core/pdom/indexer/IndexerPreferences.java | 6 ++---- .../internal/core/CCorePreferenceInitializer.java | 8 ++++---- .../ui/actions/AbstractUpdateIndexAction.java | 12 ++++-------- .../cdt/internal/ui/actions/RebuildIndexAction.java | 4 +--- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileLocation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileLocation.java index b7a2207d829..2efc770cab4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileLocation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileLocation.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Andrew Ferguson (Symbian) - initial API and implementation + * Andrew Ferguson (Symbian) - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.index; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java index 9e9d8b81717..e8068b75d23 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexUpdatePolicy.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom; @@ -142,8 +142,7 @@ public class IndexUpdatePolicy { task= new PDOMUpdateTask(fIndexer, IIndexManager.UPDATE_CHECK_TIMESTAMPS | IIndexManager.UPDATE_CHECK_CONTENTS_HASH); clearTUs(); - } - else if (fKind == POST_CHANGE) { + } else if (fKind == POST_CHANGE) { task= createTask(); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java index 7af2137518f..684d0b07696 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java @@ -188,9 +188,7 @@ public class IndexerPreferences { } public static int getDefaultUpdatePolicy() { - Preferences[] prefs = new Preferences[] { - getDefaultPreferences() - }; + Preferences[] prefs = new Preferences[] { getDefaultPreferences() }; return getUpdatePolicy(prefs); } @@ -203,7 +201,7 @@ public class IndexerPreferences { } private static void setProperties(Preferences prefs, Properties props) { - for (Map.Entry entry : props.entrySet()) { + for (Map.Entry entry : props.entrySet()) { String key = (String) entry.getKey(); String val = (String) entry.getValue(); prefs.put(key, val); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java index b9c3c2b1cd9..3eb7839aa2d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java @@ -14,6 +14,9 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core; +import java.util.HashSet; +import java.util.Map; + import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePreferenceConstants; import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants; @@ -24,9 +27,6 @@ import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import java.util.HashSet; -import java.util.Map; - public class CCorePreferenceInitializer extends AbstractPreferenceInitializer { /* (non-Javadoc) @@ -51,7 +51,7 @@ public class CCorePreferenceInitializer extends AbstractPreferenceInitializer { // Store default values to default preferences IEclipsePreferences defaultPreferences = DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID); - for (Map.Entry entry : defaultOptionsMap.entrySet()) { + for (Map.Entry entry : defaultOptionsMap.entrySet()) { String optionName = entry.getKey(); defaultPreferences.put(optionName, entry.getValue()); optionNames.add(optionName); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java index fa5a437b9c7..a679a82fabf 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AbstractUpdateIndexAction.java @@ -6,10 +6,9 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Anton Leherbauer (Wind River Systems) + * Markus Schorn - initial API and implementation + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ - package org.eclipse.cdt.internal.ui.actions; import java.util.ArrayList; @@ -32,7 +31,6 @@ import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.ui.CUIPlugin; public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate { - private ISelection fSelection; @Override @@ -45,9 +43,8 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate return; IStructuredSelection cElements= SelectionConverter.convertSelectionToCElements(fSelection); - Iterator i= cElements.iterator(); ArrayList tuSelection= new ArrayList(); - while (i.hasNext()) { + for (Iterator i= cElements.iterator(); i.hasNext();) { Object o= i.next(); if (o instanceof ICProject || o instanceof ICContainer || o instanceof ITranslationUnit) { tuSelection.add((ICElement) o); @@ -57,8 +54,7 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate try { CCorePlugin.getIndexManager().update(tuArray, getUpdateOptions()); - } - catch (CoreException e) { + } catch (CoreException e) { CUIPlugin.log(e); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RebuildIndexAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RebuildIndexAction.java index 232c32e1ecc..07814660f0d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RebuildIndexAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RebuildIndexAction.java @@ -6,9 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.ui.actions; import java.util.Iterator; @@ -24,7 +23,6 @@ import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.ICProject; public class RebuildIndexAction implements IObjectActionDelegate { - private ISelection fSelection; @Override