1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Fixed compiler warnings.

This commit is contained in:
Sergey Prigogin 2011-02-12 00:04:10 +00:00
parent 07ba8ca44b
commit 50a328f123
6 changed files with 19 additions and 53 deletions

View file

@ -23,14 +23,6 @@ import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
public class BracesTabPage extends FormatterTabPage { public class BracesTabPage extends FormatterTabPage {
/**
* Constant array for boolean selection
*/
private static String[] FALSE_TRUE = {
DefaultCodeFormatterConstants.FALSE,
DefaultCodeFormatterConstants.TRUE
};
/** /**
* Some C++ source code used for preview. * Some C++ source code used for preview.
*/ */

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others. * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -20,29 +20,10 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants; import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
public class ControlStatementsTabPage extends FormatterTabPage { public class ControlStatementsTabPage extends FormatterTabPage {
/**
* Constant array for boolean selection
*/
private static String[] FALSE_TRUE = {
DefaultCodeFormatterConstants.FALSE,
DefaultCodeFormatterConstants.TRUE
};
/**
* Constant array for insert / not_insert.
*/
private static String[] DO_NOT_INSERT_INSERT = {
CCorePlugin.DO_NOT_INSERT,
CCorePlugin.INSERT
};
private final String PREVIEW= private final String PREVIEW=
createPreviewHeader(FormatterMessages.ControlStatementsTabPage_preview_header) + createPreviewHeader(FormatterMessages.ControlStatementsTabPage_preview_header) +
"class Example {" + //$NON-NLS-1$ "class Example {" + //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2009 IBM Corporation and others. * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -29,7 +29,6 @@ import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.internal.ui.preferences.PreferencesAccess; import org.eclipse.cdt.internal.ui.preferences.PreferencesAccess;
public class FormatterProfileManager extends ProfileManager { public class FormatterProfileManager extends ProfileManager {
private static final List<String> EMPTY_LIST = Collections.emptyList(); private static final List<String> EMPTY_LIST = Collections.emptyList();
public final static String KANDR_PROFILE= "org.eclipse.cdt.ui.default.kandr_profile"; //$NON-NLS-1$ public final static String KANDR_PROFILE= "org.eclipse.cdt.ui.default.kandr_profile"; //$NON-NLS-1$
@ -63,7 +62,7 @@ public class FormatterProfileManager extends ProfileManager {
// Add the Profiles which are at default scope and hence are contributed by a product. // Add the Profiles which are at default scope and hence are contributed by a product.
try { try {
List<Profile> defaultProfiles= new FormatterProfileStore(profileVersioner).readProfiles(new DefaultScope()); List<Profile> defaultProfiles= new FormatterProfileStore(profileVersioner).readProfiles(DefaultScope.INSTANCE);
if (defaultProfiles != null) { if (defaultProfiles != null) {
Map<String, Profile> profMap= new LinkedHashMap<String, Profile>(); Map<String, Profile> profMap= new LinkedHashMap<String, Profile>();
// Add the already loaded / created profiles to a map // Add the already loaded / created profiles to a map
@ -125,7 +124,7 @@ public class FormatterProfileManager extends ProfileManager {
String profileId= instanceScope.getNode(CUIPlugin.PLUGIN_ID).get(PROFILE_KEY, null); String profileId= instanceScope.getNode(CUIPlugin.PLUGIN_ID).get(PROFILE_KEY, null);
if (profileId == null) { if (profileId == null) {
// request from bug 129427 // request from bug 129427
profileId= new DefaultScope().getNode(CUIPlugin.PLUGIN_ID).get(PROFILE_KEY, null); profileId= DefaultScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID).get(PROFILE_KEY, null);
// fix for bug 89739 // fix for bug 89739
// if (DEFAULT_PROFILE.equals(profileId)) { // default default: // if (DEFAULT_PROFILE.equals(profileId)) { // default default:
// IEclipsePreferences node= instanceScope.getNode(CCorePlugin.PLUGIN_ID); // IEclipsePreferences node= instanceScope.getNode(CCorePlugin.PLUGIN_ID);
@ -150,5 +149,4 @@ public class FormatterProfileManager extends ProfileManager {
return p; return p;
return getProfile(DEFAULT_PROFILE); return getProfile(DEFAULT_PROFILE);
} }
} }

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Anton Leherbauer (Wind River Systems) * Anton Leherbauer (Wind River Systems)
* Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.preferences.formatter; package org.eclipse.cdt.internal.ui.preferences.formatter;
@ -35,6 +36,13 @@ public abstract class FormatterTabPage extends ModifyDialogTabPage {
*/ */
protected static String[] TRUE_FALSE= { DefaultCodeFormatterConstants.TRUE, DefaultCodeFormatterConstants.FALSE }; protected static String[] TRUE_FALSE= { DefaultCodeFormatterConstants.TRUE, DefaultCodeFormatterConstants.FALSE };
/**
* Constant array for boolean true/false selection.
*
* @since 5.3
*/
protected static String[] FALSE_TRUE= { DefaultCodeFormatterConstants.FALSE, DefaultCodeFormatterConstants.TRUE };
/** /**
* Constant array for insert / not_insert. * Constant array for insert / not_insert.
*/ */
@ -44,9 +52,9 @@ public abstract class FormatterTabPage extends ModifyDialogTabPage {
private final IDialogSettings fDialogSettings; private final IDialogSettings fDialogSettings;
private Button fShowInvisibleButton; private Button fShowInvisibleButton;
public FormatterTabPage(IModifyDialogTabPage.IModificationListener modifyListener, Map<String, String> workingValues) { public FormatterTabPage(IModifyDialogTabPage.IModificationListener modifyListener,
Map<String, String> workingValues) {
super(modifyListener, workingValues); super(modifyListener, workingValues);
fDialogSettings= CUIPlugin.getDefault().getDialogSettings(); fDialogSettings= CUIPlugin.getDefault().getDialogSettings();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others. * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,7 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* istvan@benedek-home.de - 103706 [formatter] indent empty lines * istvan@benedek-home.de - 103706 [formatter] indent empty lines
* Sergey Prigogin, Google * Sergey Prigogin (Google)
* Anton Leherbauer (Wind River Systems) * Anton Leherbauer (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.preferences.formatter; package org.eclipse.cdt.internal.ui.preferences.formatter;
@ -24,17 +24,8 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants; import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
public class IndentationTabPage extends FormatterTabPage { public class IndentationTabPage extends FormatterTabPage {
/**
* Constant array for boolean selection
*/
private static String[] FALSE_TRUE = {
DefaultCodeFormatterConstants.FALSE,
DefaultCodeFormatterConstants.TRUE
};
/** /**
* Some C++ source code used for preview. * Some C++ source code used for preview.
*/ */

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2009 IBM Corporation and others. * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,7 +7,7 @@
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Sergey Prigogin, Google * Sergey Prigogin (Google)
* Anton Leherbauer (Wind River Systems) * Anton Leherbauer (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.preferences.formatter; package org.eclipse.cdt.internal.ui.preferences.formatter;
@ -35,7 +35,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.preferences.PreferencesAccess; import org.eclipse.cdt.internal.ui.preferences.PreferencesAccess;
import org.eclipse.cdt.internal.ui.util.Messages; import org.eclipse.cdt.internal.ui.util.Messages;
/** /**
* The model for the set of profiles which are available in the workbench. * The model for the set of profiles which are available in the workbench.
*/ */
@ -450,7 +449,7 @@ public abstract class ProfileManager extends Observable {
String profileId= instanceScope.getNode(CUIPlugin.PLUGIN_ID).get(fProfileKey, null); String profileId= instanceScope.getNode(CUIPlugin.PLUGIN_ID).get(fProfileKey, null);
if (profileId == null) { if (profileId == null) {
// request from bug 129427 // request from bug 129427
profileId= new DefaultScope().getNode(CUIPlugin.PLUGIN_ID).get(fProfileKey, null); profileId= DefaultScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID).get(fProfileKey, null);
} }
return profileId; return profileId;
} }
@ -545,7 +544,6 @@ public abstract class ProfileManager extends Observable {
} catch (BackingStoreException e) { } catch (BackingStoreException e) {
// ignore // ignore
} }
} }
private boolean updatePreferences(IEclipsePreferences prefs, List<String> keys, Map<String,String> profileOptions) { private boolean updatePreferences(IEclipsePreferences prefs, List<String> keys, Map<String,String> profileOptions) {
@ -567,7 +565,6 @@ public abstract class ProfileManager extends Observable {
return hasChanges; return hasChanges;
} }
/** /**
* Update all formatter settings with the settings of the specified profile. * Update all formatter settings with the settings of the specified profile.
* @param profile The profile to write to the preference store * @param profile The profile to write to the preference store
@ -771,7 +768,6 @@ public abstract class ProfileManager extends Observable {
notifyObservers(SETTINGS_CHANGED_EVENT); notifyObservers(SETTINGS_CHANGED_EVENT);
} }
private void updateProfilesWithName(String oldName, Profile newProfile, boolean applySettings) { private void updateProfilesWithName(String oldName, Profile newProfile, boolean applySettings) {
IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects(); IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project : projects) { for (IProject project : projects) {