From fec0fa3fad4c42f6b3bdb75b22dec6f53a6d5b3e Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Fri, 30 Apr 2010 04:51:43 +0000 Subject: [PATCH] compilation warnings --- .../editor/MakefileSourceConfiguration.java | 7 +-- .../internal/ui/part/CheckboxTablePart.java | 5 ++- .../AbstractMakefileEditorPreferencePage.java | 43 ++++++++++--------- .../internal/ui/preferences/ColorEditor.java | 1 + .../make/internal/ui/text/ColorManager.java | 16 +++---- .../makefile/AbstractMakefileCodeScanner.java | 8 ++-- .../AbstractDiscoveryOptionsBlock.java | 40 ++++++++--------- .../ui/dialogs/AbstractDiscoveryPage.java | 9 +--- .../wizards/ConvertToMakeProjectWizard.java | 3 -- 9 files changed, 59 insertions(+), 73 deletions(-) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java index a147c71a24d..241a6584b2c 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java @@ -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 createRules() { setDefaultReturnToken(getToken(fProperties[0])); return null; } @@ -198,7 +199,6 @@ public class MakefileSourceConfiguration extends TextSourceViewerConfiguration { } /** - * @param event * @return true 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); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java index a85a1c918b6..190b27b523b 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java @@ -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) { } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java index 6d1b0a5252c..9c4329280d2 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java @@ -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 fCheckBoxes= new HashMap(); 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 fTextFields= new HashMap(); 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 fNumberFields= new HashMap(); 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 checkBoxes= getCheckBoxes(); + Map textFields= getTextFields(); + Iterator 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 getCheckBoxes() { return fCheckBoxes; } - protected Map getTextFields() { + protected Map getTextFields() { return fTextFields; } - protected Map getNumberFields() { + protected Map 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 keys= getNumberFields().keySet(); + for (Iterator iter = keys.iterator(); iter.hasNext();) { + Text text = iter.next(); + IStatus s= validatePositiveNumber(text.getText(), getNumberFields().get(text)); status= s.getSeverity() > status.getSeverity() ? s : status; } } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/ColorEditor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/ColorEditor.java index d2dc4b66504..8a387a17220 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/ColorEditor.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/ColorEditor.java @@ -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); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java index bbe1b07f68e..d7d09e449ea 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java @@ -47,22 +47,22 @@ public class ColorManager implements ISharedTextColors { return fgColorManager; } - protected Map fColorTable = new HashMap(10); + protected Map fColorTable = new HashMap(10); - /** - * @see IMakefileColorManager#dispose() + /* (non-Javadoc) + * @see org.eclipse.jface.text.source.ISharedTextColors#dispose() */ public void dispose() { - Iterator e = fColorTable.values().iterator(); + Iterator 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); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java index f4b40bbecf0..5e50357c915 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/AbstractMakefileCodeScanner.java @@ -34,7 +34,7 @@ import org.eclipse.swt.graphics.RGB; */ public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner { - private Map fTokenMap= new HashMap(); + private Map fTokenMap= new HashMap(); private String[] fPropertyNamesColor; /** * Preference keys for boolean preferences which are true, @@ -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 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 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) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java index 8038a11c138..f6a018adac6 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java @@ -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 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(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 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 getDiscoveryProfileIdList() { + return new ArrayList(fProfilePageMap.keySet()); } protected abstract String getCurrentProfileId(); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryPage.java index c8f7fc8f787..2846939e8f6 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryPage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryPage.java @@ -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); } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java index d595f53de6d..3330f6b72f1 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java @@ -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);