1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 04:15:35 +02:00

Remove annoying warning from eclipse compiler

about never use export or local variables.
This commit is contained in:
Alain Magloire 2004-05-02 03:33:21 +00:00
parent 59a22fcbb8
commit 442e48039e
30 changed files with 45 additions and 53 deletions

View file

@ -194,8 +194,8 @@ public class TemplateTranslator {
break;
default:
if (!Character.isUnicodeIdentifierStart((char) ch) &&
!Character.isUnicodeIdentifierPart((char) ch))
if (!Character.isUnicodeIdentifierStart(ch) &&
!Character.isUnicodeIdentifierPart(ch))
{
// illegal identifier character
fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.invalid.identifier"); //$NON-NLS-1$

View file

@ -76,7 +76,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
CUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchWindow window = CUIPlugin.getDefault().getActiveWorkbenchWindow();
IWorkbenchWindow window = CUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
if (page != null) {

View file

@ -36,7 +36,6 @@ import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.part.PluginDropAdapter;
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
;
/**
* Implements drop behaviour for drag and drop operations

View file

@ -18,12 +18,10 @@ import org.eclipse.cdt.internal.ui.editor.FileSearchActionInWorkingSet;
import org.eclipse.cdt.internal.ui.editor.OpenIncludeAction;
import org.eclipse.cdt.internal.ui.editor.SearchDialogAction;
import org.eclipse.cdt.internal.ui.search.actions.SelectionSearchGroup;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.actions.CustomFiltersActionGroup;
import org.eclipse.cdt.ui.actions.RefactoringActionGroup;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
@ -364,7 +362,6 @@ public class MainActionGroup extends CViewActionGroup {
}
public void dispose() {
IWorkspace workspace = CUIPlugin.getWorkspace();
importAction.dispose();
exportAction.dispose();
refactorGroup.dispose();

View file

@ -102,7 +102,7 @@ public class RefactorActionGroup extends CViewActionGroup {
}
protected void makeActions() {
TreeViewer treeViewer = (TreeViewer) getCView().getViewer();
TreeViewer treeViewer = getCView().getViewer();
Shell shell = getCView().getSite().getShell();
clipboard = new Clipboard(shell.getDisplay());

View file

@ -41,7 +41,7 @@ public class SelectionConverter {
for (int i = 0; i < elements.length; i++) {
Object e = elements[i];
if (e instanceof ICElement) {
converted.add((ICElement)e);
converted.add(e);
} else if (e instanceof IAdaptable) {
ICElement c = (ICElement) ((IAdaptable) e).getAdapter(ICElement.class);
if (c != null) {
@ -60,7 +60,7 @@ public class SelectionConverter {
for (int i = 0; i < elements.length; i++) {
Object e = elements[i];
if (e instanceof IResource) {
converted.add((IResource)e);
converted.add(e);
} else if (e instanceof IAdaptable) {
IResource r = (IResource) ((IAdaptable) e).getAdapter(IResource.class);
if (r != null) {

View file

@ -62,7 +62,7 @@ public class AddIncludeOnSelectionAction extends Action implements IUpdate {
private ITranslationUnit getTranslationUnit () {
ITranslationUnit unit = null;
if(fEditor != null) {
IEditorInput editorInput= (IEditorInput)fEditor.getEditorInput();
IEditorInput editorInput= fEditor.getEditorInput();
unit = CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editorInput);
}
return unit;

View file

@ -77,7 +77,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
if (fOperationCode != -1 && fOperationTarget != null)
fOperationTarget.doOperation(fOperationCode);
}
};
}
protected CEditor fCEditor;
protected RetargetTextEditorAction fContentAssist;

View file

@ -8,7 +8,6 @@ package org.eclipse.cdt.internal.ui.editor;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.ui.texteditor.MarkerUtilities;
import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
@ -25,7 +24,7 @@ public class CMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
* @see AbstractMarkerAnnotationModel#createMarkerAnnotation(IMarker)
*/
protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
String markerType = MarkerUtilities.getMarkerType(marker);
//String markerType = MarkerUtilities.getMarkerType(marker);
return new CMarkerAnnotation(marker, fDocument);
}
/**

View file

@ -37,7 +37,7 @@ public class CustomBufferFactory implements IBufferFactory {
if (owner instanceof IWorkingCopy) {
IWorkingCopy unit= (IWorkingCopy) owner;
ITranslationUnit original= (ITranslationUnit) unit.getOriginalElement();
ITranslationUnit original= unit.getOriginalElement();
IResource resource= original.getResource();
if (resource instanceof IFile) {
IFile fFile = (IFile)resource;

View file

@ -90,7 +90,7 @@ public class FileSearchActionInWorkingSet extends Action {
IResource[] result = new IResource[resourceList.size()];
resourceList.toArray(result);
SearchScope scope= new SearchScope("File Search",(IResource []) result); //$NON-NLS-1$
SearchScope scope= new SearchScope("File Search", result); //$NON-NLS-1$
TextSearchOperation op= new TextSearchOperation(

View file

@ -77,6 +77,6 @@ public class LexicalSortingAction extends Action {
}
return 0;
}
};
}
};
}

View file

@ -56,7 +56,7 @@ public class AsmPartitionScanner extends RuleBasedPartitionScanner {
public boolean isWordPart(char c) {
return (c == '*' || c == '/');
}
};
}
/**
* Word rule for empty comments.
@ -87,8 +87,7 @@ public class AsmPartitionScanner extends RuleBasedPartitionScanner {
public IToken getSuccessToken() {
return fSuccessToken;
}
};
}
/**
* Creates the partitioner and sets up the appropriate rules.

View file

@ -33,7 +33,7 @@ public class AsmTextTools {
public void propertyChange(Preferences.PropertyChangeEvent event) {
adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue()));
}
};
}
/** The color manager -- use the same as for C code */
private CColorManager fColorManager;

View file

@ -411,9 +411,9 @@ public abstract class OptionsConfigurationBlock {
switch(proxy.getType()) {
case IResource.FILE :
IFile file = (IFile)proxy.requestResource();
CoreModel cModel = CCorePlugin.getDefault().getCoreModel();
if (cModel.isTranslationUnit(file)) {
if (CoreModel.isTranslationUnit(file)) {
CoreModel cModel = CoreModel.getDefault();
ITranslationUnit translationUnit = (ITranslationUnit)cModel.create(file);
try {

View file

@ -19,7 +19,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
public static final class TypeDescriptor {
protected TypeDescriptor() {
}
};
}
public static final TypeDescriptor BOOLEAN= new TypeDescriptor();
public static final TypeDescriptor DOUBLE= new TypeDescriptor();
@ -37,7 +37,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
fDescriptor= descriptor;
fKey= key;
}
};
}
private class PropertyListener implements IPropertyChangeListener {
@ -49,7 +49,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
if (key != null)
propagateProperty(fParent, key, fStore);
}
};
}
protected IPreferenceStore fParent;

View file

@ -43,7 +43,7 @@ public class CCommentScanner extends AbstractCScanner
public boolean isWordPart(char c) {
return Character.isLetter(c);
}
};
}
private class TaskTagRule extends WordRule {

View file

@ -52,7 +52,7 @@ public class CPartitionScanner extends RuleBasedPartitionScanner {
public boolean isWordPart(char c) {
return (c == '*' || c == '/');
}
};
}
/**
* Word rule for empty comments.
@ -83,7 +83,7 @@ public class CPartitionScanner extends RuleBasedPartitionScanner {
public IToken getSuccessToken() {
return fSuccessToken;
}
};
}
/**
* Creates the partitioner and sets up the appropriate rules.

View file

@ -34,7 +34,7 @@ public class CTextTools {
public void propertyChange(Preferences.PropertyChangeEvent event) {
adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue()));
}
};
}
/** The color manager */
private CColorManager fColorManager;

View file

@ -161,7 +161,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
} else {
//Defer to the nature of the project
IFile file = fEditor.getInputFile();
if (file != null && CoreModel.getDefault().hasCCNature(file.getProject())) {
if (file != null && CoreModel.hasCCNature(file.getProject())) {
return true;
} else {
return false;
@ -583,7 +583,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
default:
visibility = ASTAccessVisibility.PRIVATE;
break;
};
}
resultCollector.acceptField(
match.getName(),
match.getReturnType(),
@ -614,7 +614,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
default:
visibility = ASTAccessVisibility.PRIVATE;
break;
};
}
resultCollector.acceptMethod(
match.getName(),
null,

View file

@ -35,7 +35,7 @@ public class DeleteTaskAction extends ActionDelegate implements IObjectActionDel
return;
}
try {
List list = ((IStructuredSelection) selection).toList();
List list = selection.toList();
List listMarkers = new ArrayList();
Iterator iterator = list.iterator();
while (iterator.hasNext()) {

View file

@ -26,7 +26,7 @@ public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowA
wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection());
wizard.setNeedsProgressMonitor(true);
WizardDialog dialog=
new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard);
new WizardDialog(CUIPlugin.getActiveWorkbenchShell(), wizard);
dialog.create();
dialog.getShell().setText(
CUIPlugin.getResourceString("OpenNewFileWizardAction.title")); //$NON-NLS-1$
@ -35,7 +35,7 @@ public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowA
protected IStructuredSelection getCurrentSelection() {
IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
ISelection selection= window.getSelectionService().getSelection();
if (selection instanceof IStructuredSelection) {

View file

@ -24,7 +24,7 @@ public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindo
wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection());
wizard.setNeedsProgressMonitor(true);
WizardDialog dialog=
new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard);
new WizardDialog(CUIPlugin.getActiveWorkbenchShell(), wizard);
dialog.create();
dialog.getShell().setText(
CUIPlugin.getResourceString("OpenNewFolderWizardAction.title")); //$NON-NLS-1$
@ -32,7 +32,7 @@ public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindo
}
protected IStructuredSelection getCurrentSelection() {
IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
ISelection selection= window.getSelectionService().getSelection();
if (selection instanceof IStructuredSelection) {

View file

@ -103,7 +103,7 @@ public class ComboDialogField extends DialogField {
doSelectionChanged(e);
}
public void widgetDefaultSelected(SelectionEvent e) { };
public void widgetDefaultSelected(SelectionEvent e) { }
};
fComboControl= new Combo(parent, fFlags);

View file

@ -29,7 +29,7 @@ class CElementWorkingSetPageContentProvider extends WorkbenchContentProvider {
IProject[] projects = root.getProjects();
List list = new ArrayList(projects.length);
for (int i = 0; i < projects.length; i++) {
if (CoreModel.getDefault().hasCNature(projects[i])) {
if (CoreModel.hasCNature(projects[i])) {
list.add(projects[i]);
}
}

View file

@ -116,7 +116,7 @@ public abstract class AbstractOpenWizardAction extends Action implements IWorkbe
protected IStructuredSelection getCurrentSelection() {
IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
ISelection selection= window.getSelectionService().getSelection();
if (selection instanceof IStructuredSelection) {
@ -137,7 +137,7 @@ public abstract class AbstractOpenWizardAction extends Action implements IWorkbe
if (!checkWorkspaceNotEmpty()) {
return;
}
*/ Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell();
*/ Shell shell= CUIPlugin.getActiveWorkbenchShell();
try {
Wizard wizard= createWizard();
if (wizard instanceof IWorkbenchWizard) {
@ -145,7 +145,7 @@ public abstract class AbstractOpenWizardAction extends Action implements IWorkbe
}
WizardDialog dialog= new WizardDialog(shell, wizard);
PixelConverter converter= new PixelConverter(CUIPlugin.getDefault().getActiveWorkbenchShell());
PixelConverter converter= new PixelConverter(CUIPlugin.getActiveWorkbenchShell());
dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20));
dialog.create();
@ -197,11 +197,11 @@ public abstract class AbstractOpenWizardAction extends Action implements IWorkbe
protected boolean checkWorkspaceNotEmpty() {
IWorkspace workspace= ResourcesPlugin.getWorkspace();
if (workspace.getRoot().getProjects().length == 0) {
Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell();
Shell shell= CUIPlugin.getActiveWorkbenchShell();
String title= NewWizardMessages.getString("AbstractOpenWizardAction.noproject.title"); //$NON-NLS-1$
String message= NewWizardMessages.getString("AbstractOpenWizardAction.noproject.message"); //$NON-NLS-1$
if (MessageDialog.openQuestion(shell, title, message)) {
IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow();
IWorkbenchWindow window= CUIPlugin.getActiveWorkbenchWindow();
(new NewProjectAction(window)).run();
return workspace.getRoot().getProjects().length != 0;
}
@ -209,7 +209,5 @@ public abstract class AbstractOpenWizardAction extends Action implements IWorkbe
}
return true;
}
}
}

View file

@ -220,7 +220,7 @@ public class MemberFilterActionGroup extends ActionGroup {
*/
public void fillActionBars(IActionBars actionBars) {
contributeToToolBar(actionBars.getToolBarManager());
};
}
/**
* Adds the filter actions to the given tool bar

View file

@ -71,7 +71,7 @@ public class ReferenceBlock extends AbstractCOptionPage {
ArrayList aList = new ArrayList(15);
final IProject[] projects = ((IWorkspace)element).getRoot().getProjects();
for (int i = 0; i < projects.length; i++) {
if (CoreModel.getDefault().hasCNature(projects[i])) {
if (CoreModel.hasCNature(projects[i])) {
// Do not show the actual project being look at
if ((getContainer().getProject() != null) && getContainer().getProject().equals(projects[i])) {
continue;

View file

@ -387,7 +387,7 @@ public class NewClassWizardPage extends WizardPage implements Listener {
private boolean isSelectionCPP(IStructuredSelection sel){
IProject project = getSelectionProject(sel);
if (project != null)
return CoreModel.getDefault().hasCCNature(project);
return CoreModel.hasCCNature(project);
else
return false;
}

View file

@ -387,7 +387,7 @@ public abstract class ConvertProjectWizardPage
// ensure we only present open, valid candidates to the user
for (int i = 0; i < projects.length; i++) {
next = (IProject)projects[i];
next = projects[i];
if ((next != null)
&& next.isOpen()