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

Removed use of a deprecated class.

This commit is contained in:
Sergey Prigogin 2010-08-30 03:39:19 +00:00
parent fa9a41f13a
commit 34dd5e451f
2 changed files with 27 additions and 42 deletions

View file

@ -41,7 +41,6 @@ import org.eclipse.cdt.core.dom.ast.IASTProblemTypeId;
import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.CModelException;
@ -61,7 +60,6 @@ import org.eclipse.cdt.internal.ui.refactoring.utils.SelectionHelper;
*
*/
public abstract class CRefactoring extends Refactoring {
private static final int AST_STYLE = ITranslationUnit.AST_CONFIGURE_USING_SOURCE_CONTEXT | ITranslationUnit.AST_SKIP_INDEXED_HEADERS;
protected String name = Messages.Refactoring_name;
@ -88,8 +86,7 @@ public abstract class CRefactoring extends Refactoring {
} catch (CModelException e) {
CUIPlugin.log(e);
}
}
else {
} else {
this.file = file;
this.region = SelectionHelper.getRegion(selection);
}
@ -101,7 +98,6 @@ public abstract class CRefactoring extends Refactoring {
}
private class ProblemFinder extends ASTVisitor {
private boolean problemFound = false;
private final RefactoringStatus status;
@ -165,7 +161,6 @@ public abstract class CRefactoring extends Refactoring {
problemFound = true;
}
}
}
@Override
@ -301,8 +296,6 @@ public abstract class CRefactoring extends Refactoring {
return fIndex;
}
public IASTTranslationUnit getUnit() {
return unit;
}
@ -310,8 +303,7 @@ public abstract class CRefactoring extends Refactoring {
protected ArrayList<IASTName> findAllMarkedNames() {
final ArrayList<IASTName> namesVector = new ArrayList<IASTName>();
unit.accept(new CPPASTVisitor() {
unit.accept(new ASTVisitor() {
{
shouldVisitNames = true;
}

View file

@ -18,6 +18,7 @@ import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
@ -35,7 +36,6 @@ import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTReferenceOperator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
@ -47,15 +47,12 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ASTWriter;
public class NodeContainer {
public final NameInformation NULL_NAME_INFORMATION = new NameInformation(
new CPPASTName());
public final NameInformation NULL_NAME_INFORMATION = new NameInformation(new CPPASTName());
private final ArrayList<IASTNode> vec;
private final ArrayList<NameInformation> names;
public class NameInformation {
private IASTName name;
private IASTName declaration;
private final ArrayList<IASTName> references;
@ -212,8 +209,7 @@ public class NodeContainer {
@Override
public String toString() {
return Messages.NodeContainer_Name + name + ' '
+ isDeclarationInScope();
return Messages.NodeContainer_Name + name + ' ' + isDeclarationInScope();
}
public boolean isReference() {
@ -290,7 +286,7 @@ public class NodeContainer {
public void findAllNames() {
for (IASTNode node : vec) {
node.accept(new CPPASTVisitor() {
node.accept(new ASTVisitor() {
{
shouldVisitNames = true;
}
@ -304,11 +300,9 @@ public class NodeContainer {
ICPPBinding cppBind = (ICPPBinding) bind;
try {
if (!cppBind.isGloballyQualified()) {
NameInformation nameInformation = new NameInformation(
name);
NameInformation nameInformation = new NameInformation(name);
IASTName[] refs = name.getTranslationUnit()
.getReferences(bind);
IASTName[] refs = name.getTranslationUnit().getReferences(bind);
for (IASTName ref : refs) {
nameInformation.addReference(ref);
}
@ -325,8 +319,7 @@ public class NodeContainer {
NameInformation nameInformation = new NameInformation(
name);
IASTName[] refs = name.getTranslationUnit()
.getReferences(bind);
IASTName[] refs = name.getTranslationUnit().getReferences(bind);
for (IASTName ref : refs) {
nameInformation.addReference(ref);
}