From a045063ceaa4b2cba77a53ae3fc5036f9cb50f58 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 8 Mar 2016 17:32:02 -0800 Subject: [PATCH] Removed redundant type arguments. Change-Id: I96e07fd9e0fdb628db449bbf54385abe68fccced --- .../ExtractFunctionRefactoring.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java index 359fd53dbe7..8c48afa443b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractFunctionRefactoring.java @@ -143,7 +143,7 @@ public class ExtractFunctionRefactoring extends CRefactoring { private FunctionExtractor extractor; private INodeFactory nodeFactory; - private DefaultCodeFormatterOptions formattingOptions; + private final DefaultCodeFormatterOptions formattingOptions; private IIndex index; private IASTTranslationUnit ast; @@ -152,9 +152,9 @@ public class ExtractFunctionRefactoring extends CRefactoring { super(element, selection, project); info = new ExtractFunctionInformation(); name = Messages.ExtractFunctionRefactoring_ExtractFunction; - names = new HashMap(); - namesCounter = new Container(NULL_INTEGER); - trailPos = new Container(NULL_INTEGER); + names = new HashMap<>(); + namesCounter = new Container<>(NULL_INTEGER); + trailPos = new Container<>(NULL_INTEGER); formattingOptions = new DefaultCodeFormatterOptions(project.getOptions(true)); } @@ -436,7 +436,7 @@ public class ExtractFunctionRefactoring extends CRefactoring { } private List getNodesWithoutComments(List nodes) { - final List nodesWithoutComments = new ArrayList(nodes.size()); + final List nodesWithoutComments = new ArrayList<>(nodes.size()); for (IASTNode node : nodes) { if (!(node instanceof IASTComment)) { @@ -447,9 +447,9 @@ public class ExtractFunctionRefactoring extends CRefactoring { } private List getTrail(List stmts) { - final List trail = new ArrayList(); - nameTrail = new HashMap(); - final Container trailCounter = new Container(NULL_INTEGER); + final List trail = new ArrayList<>(); + nameTrail = new HashMap<>(); + final Container trailCounter = new Container<>(NULL_INTEGER); for (IASTNode node : stmts) { node.accept(new CPPASTAllVisitor() { @@ -604,7 +604,7 @@ public class ExtractFunctionRefactoring extends CRefactoring { IASTFunctionDefinition func = new CPPASTFunctionDefinition(); func.setParent(ast); - List pointerOperators = new ArrayList(); + List pointerOperators = new ArrayList<>(); IASTDeclSpecifier returnType = getReturnType(pointerOperators); func.setDeclSpecifier(returnType); @@ -826,7 +826,7 @@ public class ExtractFunctionRefactoring extends CRefactoring { } private IASTSimpleDeclaration getDeclaration(ModificationCollector collector, IASTName name) { - List pointerOperators = new ArrayList(); + List pointerOperators = new ArrayList<>(); IASTDeclSpecifier declSpec = getReturnType(pointerOperators); IASTSimpleDeclaration simpleDecl = nodeFactory.newSimpleDeclaration(declSpec); if (info.isVirtual() && declSpec instanceof ICPPASTDeclSpecifier) {