mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Replace usage of deprecated code.
This commit is contained in:
parent
c08fa974d4
commit
bead75a3d1
6 changed files with 19 additions and 30 deletions
|
@ -831,7 +831,7 @@ public class IBViewPart extends ViewPart
|
|||
public String[] getShowInTargetIds() {
|
||||
return new String[] {
|
||||
ProjectExplorer.VIEW_ID,
|
||||
IPageLayout.ID_RES_NAV
|
||||
IPageLayout.ID_PROJECT_EXPLORER
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.internal.ui.preferences;
|
|||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.jface.preference.PreferencePage;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -88,7 +87,8 @@ public class IndexerPreferencePage extends PreferencePage implements
|
|||
return null;
|
||||
}
|
||||
|
||||
public Preferences getPreferences() {
|
||||
@SuppressWarnings("deprecation")
|
||||
public org.eclipse.core.runtime.Preferences getPreferences() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,6 @@ public class WorkInProgressPreferencePage extends PreferencePage implements IWor
|
|||
String key= (String) text.getData();
|
||||
store.setValue(key, text.getText());
|
||||
}
|
||||
CUIPlugin.getDefault().savePluginPreferences();
|
||||
return super.performOk();
|
||||
}
|
||||
|
||||
|
|
|
@ -44,12 +44,12 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTEqualsInitializer;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
|
@ -86,7 +86,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarationStatement;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTEqualsInitializer;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionList;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition;
|
||||
|
@ -732,7 +731,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
IASTFunctionCallExpression callExpression = new CPPASTFunctionCallExpression();
|
||||
IASTIdExpression idExpression = new CPPASTIdExpression();
|
||||
idExpression.setName(astMethodName);
|
||||
IASTExpressionList paramList = new CPPASTExpressionList();
|
||||
List<IASTInitializerClause> args = new ArrayList<IASTInitializerClause>();
|
||||
|
||||
Vector<IASTName> declarations = new Vector<IASTName>();
|
||||
IASTName retName = null;
|
||||
|
@ -758,7 +757,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
.getNames()) {
|
||||
if (orgName.equals(simNameInfo.getDeclaration()
|
||||
.getRawSignature())) {
|
||||
addAParameterIfPossible(paramList, declarations,
|
||||
addAParameterIfPossible(args, declarations,
|
||||
simNameInfo);
|
||||
found = true;
|
||||
|
||||
|
@ -776,7 +775,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
IASTIdExpression expression = new CPPASTIdExpression();
|
||||
CPPASTName fieldName = new CPPASTName(orgName.toCharArray());
|
||||
expression.setName(fieldName);
|
||||
paramList.addExpression(expression);
|
||||
args.add(expression);
|
||||
|
||||
if (theRetName) {
|
||||
theRetName = false;
|
||||
|
@ -786,7 +785,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
}
|
||||
}
|
||||
|
||||
callExpression.setParameterExpression(paramList);
|
||||
callExpression.setArguments(args.toArray(new IASTInitializerClause[args.size()]));
|
||||
callExpression.setFunctionNameExpression(idExpression);
|
||||
|
||||
if (info.getReturnVariable() == null) {
|
||||
|
@ -801,8 +800,8 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
IASTFunctionCallExpression callExpression = new CPPASTFunctionCallExpression();
|
||||
IASTIdExpression idExpression = new CPPASTIdExpression();
|
||||
idExpression.setName(new CPPASTName(astMethodName.toCharArray()));
|
||||
IASTExpressionList paramList = getCallParameters();
|
||||
callExpression.setParameterExpression(paramList);
|
||||
List<IASTInitializerClause> args = getCallParameters();
|
||||
callExpression.setArguments(args.toArray(new IASTInitializerClause[args.size()]));
|
||||
callExpression.setFunctionNameExpression(idExpression);
|
||||
|
||||
if (info.getReturnVariable() == null) {
|
||||
|
@ -913,16 +912,16 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
return container;
|
||||
}
|
||||
|
||||
public IASTExpressionList getCallParameters() {
|
||||
IASTExpressionList paramList = new CPPASTExpressionList();
|
||||
public List<IASTInitializerClause> getCallParameters() {
|
||||
List<IASTInitializerClause> args = new ArrayList<IASTInitializerClause>();
|
||||
Vector<IASTName> declarations = new Vector<IASTName>();
|
||||
for (NameInformation nameInf : container.getNames()) {
|
||||
addAParameterIfPossible(paramList, declarations, nameInf);
|
||||
addAParameterIfPossible(args, declarations, nameInf);
|
||||
}
|
||||
return paramList;
|
||||
return args;
|
||||
}
|
||||
|
||||
private void addAParameterIfPossible(IASTExpressionList paramList,
|
||||
private void addAParameterIfPossible(List<IASTInitializerClause> args,
|
||||
Vector<IASTName> declarations, NameInformation nameInf) {
|
||||
if (!nameInf.isDeclarationInScope()) {
|
||||
IASTName declaration = nameInf.getDeclaration();
|
||||
|
@ -930,7 +929,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
|||
declarations.add(declaration);
|
||||
IASTIdExpression expression = new CPPASTIdExpression();
|
||||
expression.setName(newName(declaration));
|
||||
paramList.addExpression(expression);
|
||||
args.add(expression);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeConstructorExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypenameExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||
|
@ -331,12 +330,7 @@ public class TrailNodeEqualityChecker implements EqualityChecker<IASTNode> {
|
|||
ICPPASTSimpleTypeConstructorExpression trailConsExpr = (ICPPASTSimpleTypeConstructorExpression) trailNode;
|
||||
ICPPASTSimpleTypeConstructorExpression consExpr = (ICPPASTSimpleTypeConstructorExpression) node;
|
||||
|
||||
return trailConsExpr.getSimpleType() == consExpr.getSimpleType();
|
||||
} else if (trailNode instanceof ICPPASTTypenameExpression) {
|
||||
ICPPASTTypenameExpression trailTypenameExpr = (ICPPASTTypenameExpression) trailNode;
|
||||
ICPPASTTypenameExpression typenameExpr = (ICPPASTTypenameExpression) node;
|
||||
|
||||
return trailTypenameExpr.isTemplate() == typenameExpr.isTemplate();
|
||||
return isDeclSpecifierEquals(trailConsExpr.getDeclSpecifier(), consExpr.getDeclSpecifier());
|
||||
} else {
|
||||
// same type
|
||||
return true;
|
||||
|
|
|
@ -100,7 +100,6 @@ import org.eclipse.cdt.core.model.ICElement;
|
|||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.core.dom.SavedCodeReaderFactory;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitMethod;
|
||||
|
@ -827,8 +826,6 @@ public class ASTManager {
|
|||
if( fArgument.getSourceFile() == null )
|
||||
return;
|
||||
|
||||
SavedCodeReaderFactory.getInstance().getCodeReaderCache().flush();
|
||||
|
||||
pm.beginTask(Messages.getString("ASTManager.task.analyze"), 2); //$NON-NLS-1$
|
||||
IASTTranslationUnit tu= getTranslationUnit(index, fArgument.getSourceFile(), true, status);
|
||||
pm.worked(1);
|
||||
|
@ -1338,10 +1335,10 @@ public class ASTManager {
|
|||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Collection<?> coll= cflc[i];
|
||||
for (Iterator<?> iter = coll.iterator(); iter.hasNext();) {
|
||||
for (Object name : coll) {
|
||||
boolean warn= false;
|
||||
String msg= errs[i];
|
||||
IBinding conflict = (IBinding) iter.next();
|
||||
IBinding conflict = (IBinding) name;
|
||||
String what= null;
|
||||
if (conflict instanceof IEnumerator) {
|
||||
if (isVarParEnumerator || isFunction || isMacro) {
|
||||
|
|
Loading…
Add table
Reference in a new issue