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

compilation warnings

This commit is contained in:
Andrew Gvozdev 2010-04-30 05:40:47 +00:00
parent 5546676b90
commit 517fc29c67
5 changed files with 46 additions and 26 deletions

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.make.internal.ui;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -49,10 +48,10 @@ public class MultipleInputDialog extends Dialog {
protected Composite panel; protected Composite panel;
protected List fieldList = new ArrayList(); protected List<FieldSummary> fieldList = new ArrayList<FieldSummary>();
protected List controlList = new ArrayList(); protected List<Text> controlList = new ArrayList<Text>();
protected List validators = new ArrayList(); protected List<Validator> validators = new ArrayList<Validator>();
protected Map valueMap = new HashMap(); protected Map<Object, String> valueMap = new HashMap<Object, String>();
private String title; private String title;
@ -67,6 +66,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/ */
@Override
protected void configureShell(Shell shell) { protected void configureShell(Shell shell) {
super.configureShell(shell); super.configureShell(shell);
if (title != null) { if (title != null) {
@ -78,6 +78,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite) * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
*/ */
@Override
protected Control createButtonBar(Composite parent) { protected Control createButtonBar(Composite parent) {
Control bar = super.createButtonBar(parent); Control bar = super.createButtonBar(parent);
validateFields(); validateFields();
@ -87,6 +88,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/ */
@Override
protected Control createDialogArea(Composite parent) { protected Control createDialogArea(Composite parent) {
Composite container = (Composite)super.createDialogArea(parent); Composite container = (Composite)super.createDialogArea(parent);
container.setLayout(new GridLayout(2, false)); container.setLayout(new GridLayout(2, false));
@ -97,8 +99,7 @@ public class MultipleInputDialog extends Dialog {
panel.setLayout(layout); panel.setLayout(layout);
panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
for (Iterator i = fieldList.iterator(); i.hasNext();) { for (FieldSummary field : fieldList) {
FieldSummary field = (FieldSummary)i.next();
switch(field.type) { switch(field.type) {
case TEXT: case TEXT:
createTextField(field.name, field.initialValue, field.allowsEmpty); createTextField(field.name, field.initialValue, field.allowsEmpty);
@ -145,6 +146,7 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) { if (!allowEmpty) {
validators.add(new Validator() { validators.add(new Validator() {
@Override
public boolean validate() { public boolean validate() {
return !text.getText().equals(""); //$NON-NLS-1$ return !text.getText().equals(""); //$NON-NLS-1$
} }
@ -186,6 +188,7 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) { if (!allowEmpty) {
validators.add(new Validator() { validators.add(new Validator() {
@Override
public boolean validate() { public boolean validate() {
return !text.getText().equals(""); //$NON-NLS-1$ return !text.getText().equals(""); //$NON-NLS-1$
} }
@ -200,6 +203,7 @@ public class MultipleInputDialog extends Dialog {
Button button = createButton(comp, IDialogConstants.IGNORE_ID, MakeUIPlugin.getResourceString("MultipleInputDialog.0"), false); //$NON-NLS-1$ Button button = createButton(comp, IDialogConstants.IGNORE_ID, MakeUIPlugin.getResourceString("MultipleInputDialog.0"), false); //$NON-NLS-1$
button.addSelectionListener(new SelectionAdapter() { button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(getShell()); DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage(MakeUIPlugin.getResourceString("MultipleInputDialog.1")); //$NON-NLS-1$ dialog.setMessage(MakeUIPlugin.getResourceString("MultipleInputDialog.1")); //$NON-NLS-1$
@ -250,6 +254,7 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) { if (!allowEmpty) {
validators.add(new Validator() { validators.add(new Validator() {
@Override
public boolean validate() { public boolean validate() {
return !text.getText().equals(""); //$NON-NLS-1$ return !text.getText().equals(""); //$NON-NLS-1$
} }
@ -264,6 +269,7 @@ public class MultipleInputDialog extends Dialog {
Button button = createButton(comp, IDialogConstants.IGNORE_ID, MakeUIPlugin.getResourceString("MultipleInputDialog.2"), false); //$NON-NLS-1$ Button button = createButton(comp, IDialogConstants.IGNORE_ID, MakeUIPlugin.getResourceString("MultipleInputDialog.2"), false); //$NON-NLS-1$
button.addSelectionListener(new SelectionAdapter() { button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell()); StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
int code = dialog.open(); int code = dialog.open();
@ -283,12 +289,10 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed() * @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/ */
@Override
protected void okPressed() { protected void okPressed() {
for (Iterator i = controlList.iterator(); i.hasNext(); ) { for (Text control : controlList) {
Control control = (Control)i.next(); valueMap.put(control.getData(FIELD_NAME), control.getText());
if (control instanceof Text) {
valueMap.put(control.getData(FIELD_NAME), ((Text)control).getText());
}
} }
controlList = null; controlList = null;
super.okPressed(); super.okPressed();
@ -298,6 +302,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.window.Window#open() * @see org.eclipse.jface.window.Window#open()
*/ */
@Override
public int open() { public int open() {
applyDialogFont(panel); applyDialogFont(panel);
return super.open(); return super.open();
@ -312,8 +317,7 @@ public class MultipleInputDialog extends Dialog {
} }
public void validateFields() { public void validateFields() {
for(Iterator i = validators.iterator(); i.hasNext(); ) { for (Validator validator : validators) {
Validator validator = (Validator) i.next();
if (!validator.validate()) { if (!validator.validate()) {
getButton(IDialogConstants.OK_ID).setEnabled(false); getButton(IDialogConstants.OK_ID).setEnabled(false);
return; return;
@ -325,6 +329,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.window.Window#getInitialLocation(org.eclipse.swt.graphics.Point) * @see org.eclipse.jface.window.Window#getInitialLocation(org.eclipse.swt.graphics.Point)
*/ */
@Override
protected Point getInitialLocation(Point initialSize) { protected Point getInitialLocation(Point initialSize) {
Point initialLocation= DialogSettingsHelper.getInitialLocation(getDialogSettingsSectionName()); Point initialLocation= DialogSettingsHelper.getInitialLocation(getDialogSettingsSectionName());
if (initialLocation != null) { if (initialLocation != null) {
@ -341,6 +346,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.window.Window#getInitialSize() * @see org.eclipse.jface.window.Window#getInitialSize()
*/ */
@Override
protected Point getInitialSize() { protected Point getInitialSize() {
Point size = super.getInitialSize(); Point size = super.getInitialSize();
return DialogSettingsHelper.getInitialSize(getDialogSettingsSectionName(), size); return DialogSettingsHelper.getInitialSize(getDialogSettingsSectionName(), size);
@ -349,6 +355,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.window.Window#close() * @see org.eclipse.jface.window.Window#close()
*/ */
@Override
public boolean close() { public boolean close() {
DialogSettingsHelper.persistShellGeometry(getShell(), getDialogSettingsSectionName()); DialogSettingsHelper.persistShellGeometry(getShell(), getDialogSettingsSectionName());
return super.close(); return super.close();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2009 QNX Software Systems and others. * Copyright (c) 2000, 2010 QNX Software Systems 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
@ -93,6 +93,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor() * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor()
*/ */
@Override
protected void initializeEditor() { protected void initializeEditor() {
setRangeIndicator(new DefaultRangeIndicator()); setRangeIndicator(new DefaultRangeIndicator());
setEditorContextMenuId("#MakefileEditorContext"); //$NON-NLS-1$ setEditorContextMenuId("#MakefileEditorContext"); //$NON-NLS-1$
@ -106,6 +107,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose() * @see org.eclipse.ui.IWorkbenchPart#dispose()
*/ */
@Override
public void dispose() { public void dispose() {
if (fProjectionMakefileUpdater != null) { if (fProjectionMakefileUpdater != null) {
fProjectionMakefileUpdater.uninstall(); fProjectionMakefileUpdater.uninstall();
@ -121,6 +123,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/ */
@Override
public void createPartControl(Composite parent) { public void createPartControl(Composite parent) {
super.createPartControl(parent); super.createPartControl(parent);
ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
@ -142,6 +145,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
} }
} }
@Override
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles); ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
@ -154,6 +158,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* Method declared on IAdaptable * Method declared on IAdaptable
*/ */
@Override
public Object getAdapter(Class key) { public Object getAdapter(Class key) {
if (ProjectionAnnotationModel.class.equals(key)) { if (ProjectionAnnotationModel.class.equals(key)) {
if (projectionSupport != null) { if (projectionSupport != null) {
@ -171,6 +176,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/ */
@Override
public void doSave(IProgressMonitor monitor) { public void doSave(IProgressMonitor monitor) {
super.doSave(monitor); super.doSave(monitor);
if (page != null) { if (page != null) {
@ -181,6 +187,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions() * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
*/ */
@Override
protected void createActions() { protected void createActions() {
super.createActions(); super.createActions();
@ -297,6 +304,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager) * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
*/ */
@Override
protected void editorContextMenuAboutToShow(IMenuManager menu) { protected void editorContextMenuAboutToShow(IMenuManager menu) {
super.editorContextMenuAboutToShow(menu); super.editorContextMenuAboutToShow(menu);
addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); //$NON-NLS-1$ addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); //$NON-NLS-1$
@ -343,6 +351,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* /*
* @see org.eclipse.ui.texteditor.AbstractTextEditor#performRevert() * @see org.eclipse.ui.texteditor.AbstractTextEditor#performRevert()
*/ */
@Override
protected void performRevert() { protected void performRevert() {
ProjectionViewer projectionViewer= (ProjectionViewer) getSourceViewer(); ProjectionViewer projectionViewer= (ProjectionViewer) getSourceViewer();
projectionViewer.setRedraw(false); projectionViewer.setRedraw(false);
@ -372,6 +381,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent) * @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
*/ */
@Override
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
ISourceViewer sourceViewer= getSourceViewer(); ISourceViewer sourceViewer= getSourceViewer();
if (sourceViewer == null) if (sourceViewer == null)
@ -407,6 +417,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* /*
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages() * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages()
*/ */
@Override
protected String[] collectContextMenuPreferencePages() { protected String[] collectContextMenuPreferencePages() {
// Add Makefile Editor relevant pages // Add Makefile Editor relevant pages
String[] parentPrefPageIds = super.collectContextMenuPreferencePages(); String[] parentPrefPageIds = super.collectContextMenuPreferencePages();
@ -421,6 +432,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* /*
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#isTabsToSpacesConversionEnabled() * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#isTabsToSpacesConversionEnabled()
*/ */
@Override
protected boolean isTabsToSpacesConversionEnabled() { protected boolean isTabsToSpacesConversionEnabled() {
// always false for Makefiles // always false for Makefiles
// see http://bugs.eclipse.org/186106 // see http://bugs.eclipse.org/186106
@ -431,6 +443,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
* @see org.eclipse.ui.editors.text.TextEditor#initializeKeyBindingScopes() * @see org.eclipse.ui.editors.text.TextEditor#initializeKeyBindingScopes()
* @see http://bugs.eclipse.org/172331 * @see http://bugs.eclipse.org/172331
*/ */
@Override
protected void initializeKeyBindingScopes() { protected void initializeKeyBindingScopes() {
setKeyBindingScopes(new String [] { "org.eclipse.cdt.make.ui.makefileEditorScope" } ); //$NON-NLS-1$ setKeyBindingScopes(new String [] { "org.eclipse.cdt.make.ui.makefileEditorScope" } ); //$NON-NLS-1$
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2006 QNX Software Systems and others. * Copyright (c) 2002, 2010 QNX Software Systems 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
@ -12,7 +12,6 @@
package org.eclipse.cdt.make.internal.ui.editor; package org.eclipse.cdt.make.internal.ui.editor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.jface.text.reconciler.DirtyRegion; import org.eclipse.jface.text.reconciler.DirtyRegion;
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
@ -23,12 +22,10 @@ import org.eclipse.jface.text.reconciler.MonoReconciler;
*/ */
public class NotifyingReconciler extends MonoReconciler { public class NotifyingReconciler extends MonoReconciler {
private ArrayList fReconcilingParticipants= new ArrayList(); private ArrayList<IReconcilingParticipant> fReconcilingParticipants= new ArrayList<IReconcilingParticipant>();
/** /**
* Constructor for NotifyingReconciler. * Constructor for NotifyingReconciler.
* @param strategy
* @param isIncremental
*/ */
public NotifyingReconciler(IReconcilingStrategy strategy, boolean isIncremental) { public NotifyingReconciler(IReconcilingStrategy strategy, boolean isIncremental) {
super(strategy, isIncremental); super(strategy, isIncremental);
@ -37,6 +34,7 @@ public class NotifyingReconciler extends MonoReconciler {
/* /*
* @see org.eclipse.jface.text.reconciler.AbstractReconciler#process(org.eclipse.jface.text.reconciler.DirtyRegion) * @see org.eclipse.jface.text.reconciler.AbstractReconciler#process(org.eclipse.jface.text.reconciler.DirtyRegion)
*/ */
@Override
protected void process(DirtyRegion dirtyRegion) { protected void process(DirtyRegion dirtyRegion) {
super.process(dirtyRegion); super.process(dirtyRegion);
notifyReconcilingParticipants(); notifyReconcilingParticipants();
@ -51,14 +49,14 @@ public class NotifyingReconciler extends MonoReconciler {
} }
protected void notifyReconcilingParticipants() { protected void notifyReconcilingParticipants() {
Iterator i= new ArrayList(fReconcilingParticipants).iterator(); for (IReconcilingParticipant participant : fReconcilingParticipants) {
while (i.hasNext()) { participant.reconciled();
((IReconcilingParticipant) i.next()).reconciled();
} }
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.text.reconciler.AbstractReconciler#initialProcess() * @see org.eclipse.jface.text.reconciler.AbstractReconciler#initialProcess()
*/ */
@Override
protected void initialProcess() { protected void initialProcess() {
super.initialProcess(); super.initialProcess();
notifyReconcilingParticipants(); notifyReconcilingParticipants();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2006 QNX Software Systems and others. * Copyright (c) 2000, 2010 QNX Software Systems 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
@ -32,11 +32,13 @@ public class MacroReferenceRule extends PatternRule {
} }
} }
@Override
protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) { protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) {
nOfBrackets = 1; nOfBrackets = 1;
return super.doEvaluate(scanner, resume); return super.doEvaluate(scanner, resume);
} }
@Override
protected boolean endSequenceDetected(ICharacterScanner scanner) { protected boolean endSequenceDetected(ICharacterScanner scanner) {
int c; int c;
char[][] delimiters = scanner.getLegalLineDelimiters(); char[][] delimiters = scanner.getLegalLineDelimiters();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2006 QNX Software Systems and others. * Copyright (c) 2000, 2010 QNX Software Systems 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
@ -19,7 +19,7 @@ public class MakefileWordDetector implements IWordDetector {
private static final String correctSpecChars = "@$/\\_"; //$NON-NLS-1$ private static final String correctSpecChars = "@$/\\_"; //$NON-NLS-1$
/** /**
* @see IWordDetector#isWordPart(character) * @see IWordDetector#isWordPart(char)
*/ */
public boolean isWordPart(char character) { public boolean isWordPart(char character) {
return Character.isLetterOrDigit(character) || (correctSpecChars.indexOf(character) >= 0); return Character.isLetterOrDigit(character) || (correctSpecChars.indexOf(character) >= 0);