1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +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; break;
default: default:
if (!Character.isUnicodeIdentifierStart((char) ch) && if (!Character.isUnicodeIdentifierStart(ch) &&
!Character.isUnicodeIdentifierPart((char) ch)) !Character.isUnicodeIdentifierPart(ch))
{ {
// illegal identifier character // illegal identifier character
fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.invalid.identifier"); //$NON-NLS-1$ 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() { CUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
public void run() { public void run() {
IWorkbenchWindow window = CUIPlugin.getDefault().getActiveWorkbenchWindow(); IWorkbenchWindow window = CUIPlugin.getActiveWorkbenchWindow();
if (window != null) { if (window != null) {
IWorkbenchPage page = window.getActivePage(); IWorkbenchPage page = window.getActivePage();
if (page != null) { 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.PluginDropAdapter;
import org.eclipse.ui.part.ResourceTransfer; import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer; import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
;
/** /**
* Implements drop behaviour for drag and drop operations * 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.OpenIncludeAction;
import org.eclipse.cdt.internal.ui.editor.SearchDialogAction; import org.eclipse.cdt.internal.ui.editor.SearchDialogAction;
import org.eclipse.cdt.internal.ui.search.actions.SelectionSearchGroup; 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.CustomFiltersActionGroup;
import org.eclipse.cdt.ui.actions.RefactoringActionGroup; import org.eclipse.cdt.ui.actions.RefactoringActionGroup;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.IToolBarManager;
@ -364,7 +362,6 @@ public class MainActionGroup extends CViewActionGroup {
} }
public void dispose() { public void dispose() {
IWorkspace workspace = CUIPlugin.getWorkspace();
importAction.dispose(); importAction.dispose();
exportAction.dispose(); exportAction.dispose();
refactorGroup.dispose(); refactorGroup.dispose();

View file

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

View file

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

View file

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

View file

@ -77,7 +77,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
if (fOperationCode != -1 && fOperationTarget != null) if (fOperationCode != -1 && fOperationTarget != null)
fOperationTarget.doOperation(fOperationCode); fOperationTarget.doOperation(fOperationCode);
} }
}; }
protected CEditor fCEditor; protected CEditor fCEditor;
protected RetargetTextEditorAction fContentAssist; 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.IMarker;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.ui.texteditor.MarkerAnnotation; import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.ui.texteditor.MarkerUtilities;
import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel; import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
@ -25,7 +24,7 @@ public class CMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
* @see AbstractMarkerAnnotationModel#createMarkerAnnotation(IMarker) * @see AbstractMarkerAnnotationModel#createMarkerAnnotation(IMarker)
*/ */
protected MarkerAnnotation createMarkerAnnotation(IMarker marker) { protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
String markerType = MarkerUtilities.getMarkerType(marker); //String markerType = MarkerUtilities.getMarkerType(marker);
return new CMarkerAnnotation(marker, fDocument); return new CMarkerAnnotation(marker, fDocument);
} }
/** /**

View file

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

View file

@ -90,7 +90,7 @@ public class FileSearchActionInWorkingSet extends Action {
IResource[] result = new IResource[resourceList.size()]; IResource[] result = new IResource[resourceList.size()];
resourceList.toArray(result); 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( TextSearchOperation op= new TextSearchOperation(

View file

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

View file

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

View file

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

View file

@ -411,9 +411,9 @@ public abstract class OptionsConfigurationBlock {
switch(proxy.getType()) { switch(proxy.getType()) {
case IResource.FILE : case IResource.FILE :
IFile file = (IFile)proxy.requestResource(); 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); ITranslationUnit translationUnit = (ITranslationUnit)cModel.create(file);
try { try {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -220,7 +220,7 @@ public class MemberFilterActionGroup extends ActionGroup {
*/ */
public void fillActionBars(IActionBars actionBars) { public void fillActionBars(IActionBars actionBars) {
contributeToToolBar(actionBars.getToolBarManager()); contributeToToolBar(actionBars.getToolBarManager());
}; }
/** /**
* Adds the filter actions to the given tool bar * 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); ArrayList aList = new ArrayList(15);
final IProject[] projects = ((IWorkspace)element).getRoot().getProjects(); final IProject[] projects = ((IWorkspace)element).getRoot().getProjects();
for (int i = 0; i < projects.length; i++) { 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 // Do not show the actual project being look at
if ((getContainer().getProject() != null) && getContainer().getProject().equals(projects[i])) { if ((getContainer().getProject() != null) && getContainer().getProject().equals(projects[i])) {
continue; continue;

View file

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

View file

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