1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Removed redundant type arguments.

Change-Id: I96e07fd9e0fdb628db449bbf54385abe68fccced
This commit is contained in:
Sergey Prigogin 2016-03-08 17:32:02 -08:00 committed by Gerrit Code Review @ Eclipse.org
parent ff7f25b94d
commit a045063cea

View file

@ -143,7 +143,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
private FunctionExtractor extractor; private FunctionExtractor extractor;
private INodeFactory nodeFactory; private INodeFactory nodeFactory;
private DefaultCodeFormatterOptions formattingOptions; private final DefaultCodeFormatterOptions formattingOptions;
private IIndex index; private IIndex index;
private IASTTranslationUnit ast; private IASTTranslationUnit ast;
@ -152,9 +152,9 @@ public class ExtractFunctionRefactoring extends CRefactoring {
super(element, selection, project); super(element, selection, project);
info = new ExtractFunctionInformation(); info = new ExtractFunctionInformation();
name = Messages.ExtractFunctionRefactoring_ExtractFunction; name = Messages.ExtractFunctionRefactoring_ExtractFunction;
names = new HashMap<String, Integer>(); names = new HashMap<>();
namesCounter = new Container<Integer>(NULL_INTEGER); namesCounter = new Container<>(NULL_INTEGER);
trailPos = new Container<Integer>(NULL_INTEGER); trailPos = new Container<>(NULL_INTEGER);
formattingOptions = new DefaultCodeFormatterOptions(project.getOptions(true)); formattingOptions = new DefaultCodeFormatterOptions(project.getOptions(true));
} }
@ -436,7 +436,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
} }
private List<IASTNode> getNodesWithoutComments(List<IASTNode> nodes) { private List<IASTNode> getNodesWithoutComments(List<IASTNode> nodes) {
final List<IASTNode> nodesWithoutComments = new ArrayList<IASTNode>(nodes.size()); final List<IASTNode> nodesWithoutComments = new ArrayList<>(nodes.size());
for (IASTNode node : nodes) { for (IASTNode node : nodes) {
if (!(node instanceof IASTComment)) { if (!(node instanceof IASTComment)) {
@ -447,9 +447,9 @@ public class ExtractFunctionRefactoring extends CRefactoring {
} }
private List<IASTNode> getTrail(List<IASTNode> stmts) { private List<IASTNode> getTrail(List<IASTNode> stmts) {
final List<IASTNode> trail = new ArrayList<IASTNode>(); final List<IASTNode> trail = new ArrayList<>();
nameTrail = new HashMap<String, Integer>(); nameTrail = new HashMap<>();
final Container<Integer> trailCounter = new Container<Integer>(NULL_INTEGER); final Container<Integer> trailCounter = new Container<>(NULL_INTEGER);
for (IASTNode node : stmts) { for (IASTNode node : stmts) {
node.accept(new CPPASTAllVisitor() { node.accept(new CPPASTAllVisitor() {
@ -604,7 +604,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
IASTFunctionDefinition func = new CPPASTFunctionDefinition(); IASTFunctionDefinition func = new CPPASTFunctionDefinition();
func.setParent(ast); func.setParent(ast);
List<IASTPointerOperator> pointerOperators = new ArrayList<IASTPointerOperator>(); List<IASTPointerOperator> pointerOperators = new ArrayList<>();
IASTDeclSpecifier returnType = getReturnType(pointerOperators); IASTDeclSpecifier returnType = getReturnType(pointerOperators);
func.setDeclSpecifier(returnType); func.setDeclSpecifier(returnType);
@ -826,7 +826,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
} }
private IASTSimpleDeclaration getDeclaration(ModificationCollector collector, IASTName name) { private IASTSimpleDeclaration getDeclaration(ModificationCollector collector, IASTName name) {
List<IASTPointerOperator> pointerOperators = new ArrayList<IASTPointerOperator>(); List<IASTPointerOperator> pointerOperators = new ArrayList<>();
IASTDeclSpecifier declSpec = getReturnType(pointerOperators); IASTDeclSpecifier declSpec = getReturnType(pointerOperators);
IASTSimpleDeclaration simpleDecl = nodeFactory.newSimpleDeclaration(declSpec); IASTSimpleDeclaration simpleDecl = nodeFactory.newSimpleDeclaration(declSpec);
if (info.isVirtual() && declSpec instanceof ICPPASTDeclSpecifier) { if (info.isVirtual() && declSpec instanceof ICPPASTDeclSpecifier) {