1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 11:25:35 +02:00

compilation warnings

This commit is contained in:
Andrew Gvozdev 2010-04-30 04:51:43 +00:00
parent c129e2c2b1
commit fec0fa3fad
9 changed files with 59 additions and 73 deletions

View file

@ -32,6 +32,7 @@ import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.reconciler.IReconciler;
import org.eclipse.jface.text.reconciler.MonoReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.ITokenScanner;
import org.eclipse.jface.text.source.IAnnotationHover;
import org.eclipse.jface.text.source.ISourceViewer;
@ -62,7 +63,7 @@ public class MakefileSourceConfiguration extends TextSourceViewerConfiguration {
* @see org.eclipse.cdt.make.internal.ui.text.makefile.AbstractMakefileCodeScanner#createRules()
*/
@Override
protected List createRules() {
protected List<IRule> createRules() {
setDefaultReturnToken(getToken(fProperties[0]));
return null;
}
@ -198,7 +199,6 @@ public class MakefileSourceConfiguration extends TextSourceViewerConfiguration {
}
/**
* @param event
* @return <code>true</code> if the given property change event affects the code coloring
*/
public boolean affectsBehavior(PropertyChangeEvent event) {
@ -211,9 +211,6 @@ public class MakefileSourceConfiguration extends TextSourceViewerConfiguration {
return false;
}
/**
* @param event
*/
public void adaptToPreferenceChange(PropertyChangeEvent event) {
if (fCodeScanner != null) {
fCodeScanner.adaptToPreferenceChange(event);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others.
* Copyright (c) 2000, 2010 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
@ -23,7 +23,6 @@ import org.eclipse.swt.widgets.Composite;
/**
* @version 1.0
* @author
*/
public class CheckboxTablePart extends StructuredViewerPart {
public CheckboxTablePart(String[] buttonLabels) {
@ -33,6 +32,7 @@ public class CheckboxTablePart extends StructuredViewerPart {
/*
* @see StructuredViewerPart#createStructuredViewer(Composite, FormWidgetFactory)
*/
@Override
protected StructuredViewer createStructuredViewer(Composite parent, int style) {
style |= SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, style);
@ -56,6 +56,7 @@ public class CheckboxTablePart extends StructuredViewerPart {
/*
* @see SharedPartWithButtons#buttonSelected(int)
*/
@Override
protected void buttonSelected(Button button, int index) {
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2008 QNX Software Systems and others.
* Copyright (c) 2002, 2010 QNX Software Systems 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
@ -46,25 +46,25 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
public abstract class AbstractMakefileEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
OverlayPreferenceStore fOverlayStore;
Map fCheckBoxes= new HashMap();
Map<Control, String> fCheckBoxes= new HashMap<Control, String>();
private SelectionListener fCheckBoxListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
Button button= (Button) e.widget;
fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
fOverlayStore.setValue(fCheckBoxes.get(button), button.getSelection());
}
};
Map fTextFields= new HashMap();
Map<Control, String> fTextFields= new HashMap<Control, String>();
private ModifyListener fTextFieldListener= new ModifyListener() {
public void modifyText(ModifyEvent e) {
Text text= (Text) e.widget;
fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
fOverlayStore.setValue(fTextFields.get(text), text.getText());
}
};
private Map fNumberFields= new HashMap();
private Map<Text, String[]> fNumberFields= new HashMap<Text, String[]>();
private ModifyListener fNumberFieldListener= new ModifyListener() {
public void modifyText(ModifyEvent e) {
numberFieldChanged((Text) e.widget);
@ -86,19 +86,19 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
}
protected void initializeFields() {
Map checkBoxes= getCheckBoxes();
Map textFields= getTextFields();
Iterator e= checkBoxes.keySet().iterator();
Map<Control, String> checkBoxes= getCheckBoxes();
Map<Control, String> textFields= getTextFields();
Iterator<Control> e= checkBoxes.keySet().iterator();
while (e.hasNext()) {
Button b= (Button) e.next();
String key= (String) checkBoxes.get(b);
String key= checkBoxes.get(b);
b.setSelection(getOverlayStore().getBoolean(key));
}
e= textFields.keySet().iterator();
while (e.hasNext()) {
Text t= (Text) e.next();
String key= (String) textFields.get(t);
String key= textFields.get(t);
t.setText(getOverlayStore().getString(key));
}
}
@ -106,6 +106,7 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
@Override
public boolean performOk() {
getOverlayStore().propagate();
MakeUIPlugin.getDefault().savePluginPreferences();
@ -120,21 +121,22 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
return fOverlayStore;
}
protected Map getCheckBoxes() {
protected Map<Control, String> getCheckBoxes() {
return fCheckBoxes;
}
protected Map getTextFields() {
protected Map<Control, String> getTextFields() {
return fTextFields;
}
protected Map getNumberFields() {
protected Map<Text, String[]> getNumberFields() {
return fNumberFields;
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
@Override
protected void performDefaults() {
getOverlayStore().loadDefaults();
initializeFields();
@ -147,6 +149,7 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#dispose()
*/
@Override
public void dispose() {
if (getOverlayStore() != null) {
getOverlayStore().stop();
@ -200,9 +203,9 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
void numberFieldChanged(Text textControl) {
String number= textControl.getText();
IStatus status= validatePositiveNumber(number, (String[])getNumberFields().get(textControl));
IStatus status= validatePositiveNumber(number, getNumberFields().get(textControl));
if (!status.matches(IStatus.ERROR)) {
getOverlayStore().setValue((String) getTextFields().get(textControl), number);
getOverlayStore().setValue(getTextFields().get(textControl), number);
}
updateStatus(status);
}
@ -225,10 +228,10 @@ public abstract class AbstractMakefileEditorPreferencePage extends PreferencePag
private void updateStatus(IStatus status) {
if (!status.matches(IStatus.ERROR)) {
Set keys= getNumberFields().keySet();
for (Iterator iter = keys.iterator(); iter.hasNext();) {
Text text = (Text) iter.next();
IStatus s= validatePositiveNumber(text.getText(), (String[])getNumberFields().get(text));
Set<Text> keys= getNumberFields().keySet();
for (Iterator<Text> iter = keys.iterator(); iter.hasNext();) {
Text text = iter.next();
IStatus s= validatePositiveNumber(text.getText(), getNumberFields().get(text));
status= s.getSeverity() > status.getSeverity() ? s : status;
}
}

View file

@ -53,6 +53,7 @@ public class ColorEditor {
fButton.setImage(fImage);
fButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
ColorDialog colorDialog= new ColorDialog(fButton.getShell());
colorDialog.setRGB(fColorValue);

View file

@ -47,22 +47,22 @@ public class ColorManager implements ISharedTextColors {
return fgColorManager;
}
protected Map fColorTable = new HashMap(10);
protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10);
/**
* @see IMakefileColorManager#dispose()
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.ISharedTextColors#dispose()
*/
public void dispose() {
Iterator e = fColorTable.values().iterator();
Iterator<Color> e = fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
(e.next()).dispose();
}
/**
* @see IMakefileColorManager#getColor(RGB)
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.ISharedTextColors#getColor(org.eclipse.swt.graphics.RGB)
*/
public Color getColor(RGB rgb) {
Color color = (Color) fColorTable.get(rgb);
Color color = fColorTable.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
fColorTable.put(rgb, color);

View file

@ -34,7 +34,7 @@ import org.eclipse.swt.graphics.RGB;
*/
public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner {
private Map fTokenMap= new HashMap();
private Map<String, Token> fTokenMap= new HashMap<String, Token>();
private String[] fPropertyNamesColor;
/**
* Preference keys for boolean preferences which are <code>true</code>,
@ -57,7 +57,7 @@ public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner {
/**
* Creates the list of rules controlling this scanner.
*/
abstract protected List createRules();
abstract protected List<IRule> createRules();
/**
* Must be called after the constructor has been called.
@ -79,7 +79,7 @@ public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner {
}
private void initializeRules() {
List rules= createRules();
List<IRule> rules= createRules();
if (rules != null) {
IRule[] result= new IRule[rules.size()];
rules.toArray(result);
@ -88,7 +88,7 @@ public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner {
}
protected Token getToken(String key) {
return (Token) fTokenMap.get(key);
return fTokenMap.get(key);
}
private void addToken(String colorKey, String boldKey, String italicKey) {

View file

@ -13,9 +13,9 @@ package org.eclipse.cdt.make.ui.dialogs;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.cdt.internal.ui.util.ExceptionHandler;
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
@ -63,7 +63,7 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
private boolean fInitialized = false;
private String fPersistedProfileId = null;
private Map fProfilePageMap = null;
private Map<String, DiscoveryProfilePageConfiguration> fProfilePageMap = null;
// Composite parent provided by the block.
private Composite fCompositeParent;
@ -159,18 +159,11 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
}
}
/**
* @param title
*/
public AbstractDiscoveryOptionsBlock(String title) {
super(title);
initializeProfilePageMap();
}
/**
* @param title
* @param image
*/
public AbstractDiscoveryOptionsBlock(String title, ImageDescriptor image) {
super(title, image);
initializeProfilePageMap();
@ -180,7 +173,7 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
*
*/
private void initializeProfilePageMap() {
fProfilePageMap = new HashMap(5);
fProfilePageMap = new HashMap<String, DiscoveryProfilePageConfiguration>(5);
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(MakeUIPlugin.getPluginId(), "DiscoveryProfilePage"); //$NON-NLS-1$
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
@ -195,7 +188,8 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#setContainer(org.eclipse.cdt.ui.dialogs.ICOptionContainer)
*/
public void setContainer(ICOptionContainer container) {
@Override
public void setContainer(ICOptionContainer container) {
super.setContainer(container);
fPrefs = getContainer().getPreferences();
@ -222,9 +216,6 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
getContainer().updateContainer();
}
/**
* @param project
*/
protected void createBuildInfo() {
if (getProject() != null) {
try {
@ -267,7 +258,8 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
*/
public void setVisible(boolean visible) {
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
handleDiscoveryProfileChanged();
@ -309,20 +301,22 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.dialogs.AbstractDiscoveryPage#isValid()
*/
public boolean isValid() {
@Override
public boolean isValid() {
return (getCurrentPage() == null) ? true : getCurrentPage().isValid();
}
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage()
*/
public String getErrorMessage() {
@Override
public String getErrorMessage() {
return getCurrentPage().getErrorMessage();
}
protected AbstractDiscoveryPage getDiscoveryProfilePage(String profileId) {
DiscoveryProfilePageConfiguration configElement =
(DiscoveryProfilePageConfiguration) fProfilePageMap.get(profileId);
fProfilePageMap.get(profileId);
if (configElement != null) {
try {
return configElement.getPage();
@ -334,7 +328,7 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
protected String getDiscoveryProfileName(String profileId) {
DiscoveryProfilePageConfiguration configElement =
(DiscoveryProfilePageConfiguration) fProfilePageMap.get(profileId);
fProfilePageMap.get(profileId);
if (configElement != null) {
return configElement.getName();
}
@ -342,8 +336,8 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
}
protected String getDiscoveryProfileId(String profileName) {
for (Iterator I = fProfilePageMap.keySet().iterator(); I.hasNext();) {
String profileId = (String) I.next();
Set<String> profileIds = fProfilePageMap.keySet();
for (String profileId : profileIds) {
String confProfileName = getDiscoveryProfileName(profileId);
if (profileName.equals(confProfileName)) {
return profileId;
@ -352,8 +346,8 @@ public abstract class AbstractDiscoveryOptionsBlock extends AbstractCOptionPage
return null;
}
protected List getDiscoveryProfileIdList() {
return new ArrayList(fProfilePageMap.keySet());
protected List<String> getDiscoveryProfileIdList() {
return new ArrayList<String>(fProfilePageMap.keySet());
}
protected abstract String getCurrentProfileId();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2007 IBM Corporation and others.
* Copyright (c) 2004, 2010 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
@ -73,17 +73,10 @@ public abstract class AbstractDiscoveryPage extends DialogPage {
super();
}
/**
* @param title
*/
public AbstractDiscoveryPage(String title) {
super(title);
}
/**
* @param title
* @param image
*/
public AbstractDiscoveryPage(String title, ImageDescriptor image) {
super(title, image);
}

View file

@ -48,9 +48,6 @@ public class ConvertToMakeProjectWizard extends ConversionWizard {
}
/**
* ConvertToStdMakeConversionWizard Wizard constructor
*
* @param title
* @param desc
*/
public ConvertToMakeProjectWizard(String title, String desc) {
super(title, desc);