diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index d2ead7296a2..bc1087473f9 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -7486,7 +7486,7 @@ public class AST2CPPTests extends AST2TestBase { // void f(int const volatile * const *) {} // void test() { // int ** x; - // f(x); // problem binding here + // f(x); // } public void testRankingOfQualificationConversion_269321() throws Exception { final String code = getAboveComment(); @@ -7601,8 +7601,8 @@ public class AST2CPPTests extends AST2TestBase { // void xx() { // D d1; // const D d2= D(); - // test(d1); // problem binding here although test(C c) has to be selected - // test(d2); // problem binding here although test(C c) has to be selected + // test(d1); // test(C c) has to be selected + // test(d2); // test(C c) has to be selected // } public void testDerivedToBaseConversion_269318() throws Exception { final String code = getAboveComment(); @@ -7626,7 +7626,7 @@ public class AST2CPPTests extends AST2TestBase { // operator fp() { return foo; } // } a; // - // int i = bar(a(1)); // problem on bar + // int i = bar(a(1)); public void testCallToObjectOfClassType_267389() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index 08244119ffa..738fa80d4ea 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -3625,7 +3625,7 @@ public class AST2TemplateTests extends AST2TestBase { // template<> class A { // template void f(T); // }; - // template void A::f(T){} //problem on f + // template void A::f(T){} public void testClassTemplateMemberFunctionTemplate_104262() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -7594,7 +7594,7 @@ public class AST2TemplateTests extends AST2TestBase { // template void waldo(function f); // // void test() { - // waldo(""); // problem on waldo + // waldo(""); // } public void testSfinaeInIdExpression_459940() throws Exception { parseAndCheckBindings(); @@ -7951,7 +7951,7 @@ public class AST2TemplateTests extends AST2TestBase { // template void waldo(function generator); // // void test() { - // waldo(""); // problem on waldo + // waldo(""); // } public void testPackExpansionInNestedTemplate_459844() throws Exception { parseAndCheckBindings(); @@ -8295,7 +8295,7 @@ public class AST2TemplateTests extends AST2TestBase { // // void test() { // A a; - // waldo(a, C<>()); // problem on waldo + // waldo(a, C<>()); // } public void testDecltypeInPackExpansion_486425a() throws Exception { parseAndCheckBindings(); @@ -8317,7 +8317,7 @@ public class AST2TemplateTests extends AST2TestBase { // // void test() { // A a; - // waldo(a, C<>()); // problem on waldo + // waldo(a, C<>()); // } public void testDecltypeInPackExpansion_486425b() throws Exception { parseAndCheckBindings(); @@ -8768,13 +8768,13 @@ public class AST2TemplateTests extends AST2TestBase { // } // // template - // typename enable_if(), void>::type waldo(T p); // problem on the return type + // typename enable_if(), void>::type waldo(T p); // // struct A {}; // // void test() { // A a; - // waldo(a); // problem on waldo + // waldo(a); // } public void testDependentFunctionSet_485985() throws Exception { parseAndCheckBindings(); @@ -8835,7 +8835,7 @@ public class AST2TemplateTests extends AST2TestBase { // A::B d; // // void test() { - // waldo(foo(c, d)); // problem on waldo + // waldo(foo(c, d)); // } public void testInstantiationOfFriendOfNestedClassInsideTemplate_484162() throws Exception { parseAndCheckBindings(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterPackType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterPackType.java index da945010ad6..582a1107e71 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterPackType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterPackType.java @@ -22,7 +22,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding; import org.eclipse.core.runtime.CoreException; public class CPPParameterPackType implements ICPPParameterPackType, ITypeContainer, ISerializableType { - private IType fType = null; + private IType fType; public CPPParameterPackType(IType type) { setType(type); @@ -44,7 +44,7 @@ public class CPPParameterPackType implements ICPPParameterPackType, ITypeContain if (obj == this) return true; if (obj instanceof ITypedef) - return ((ITypedef)obj).isSameType(this); + return ((ITypedef) obj).isSameType(this); if (obj instanceof ICPPParameterPackType) { final ICPPParameterPackType rhs = (ICPPParameterPackType) obj; @@ -60,7 +60,7 @@ public class CPPParameterPackType implements ICPPParameterPackType, ITypeContain try { return super.clone(); } catch (CloneNotSupportedException e) { - // not going to happen + // Not going to happen. return null; } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java index a4f1f5c1bb5..6d434044bcd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java @@ -1121,7 +1121,7 @@ public class CPPTemplates { return determinePackSize((ICPPTemplateParameter) type, tpMap); } - if (type instanceof TypeOfDependentExpression){ + if (type instanceof TypeOfDependentExpression) { return ((TypeOfDependentExpression) type).getEvaluation().determinePackSize(tpMap); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalParameterPack.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalParameterPack.java index 52f229eecfa..e65543f2a9f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalParameterPack.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalParameterPack.java @@ -29,7 +29,6 @@ import org.eclipse.core.runtime.CoreException; * Evaluation for a pack expansion expression. */ public class EvalParameterPack extends CPPDependentEvaluation { - private ICPPEvaluation fExpansionPattern; private IType fType; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TemplateArgumentDeduction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TemplateArgumentDeduction.java index 36a7b23f41f..7bb067f2281 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TemplateArgumentDeduction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TemplateArgumentDeduction.java @@ -165,7 +165,7 @@ public class TemplateArgumentDeduction { // Do trial deduction CPPTemplateParameterMap success= null; - Set handled= new HashSet(); + Set handled= new HashSet<>(); for (ICPPFunction f : fs) { arg= f.getType(); if (f instanceof ICPPMethod && !f.isStatic()) { @@ -331,7 +331,8 @@ public class TemplateArgumentDeduction { boolean isDependentPar= CPPTemplates.isDependentType(par); if (isDependentPar) { - TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0); + TemplateArgumentDeduction deduct= + new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0); par= SemanticUtil.getNestedType(par, SemanticUtil.TDEF); if (arg != null && !deduct.fromType(par, arg, false, point)) return null; @@ -401,7 +402,8 @@ public class TemplateArgumentDeduction { if (!SemanticUtil.isValidType(p)) return null; - TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0); + TemplateArgumentDeduction deduct= + new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0); if (!deduct.fromType(p, a, false, point)) { return null; } @@ -428,9 +430,10 @@ public class TemplateArgumentDeduction { final int fnParCount = fnPars.length; final int fnArgCount = fnArgs.length; int result= 0; - TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplPars, new CPPTemplateParameterMap(0), new CPPTemplateParameterMap(fnParCount), 0); + TemplateArgumentDeduction deduct= + new TemplateArgumentDeduction(tmplPars, new CPPTemplateParameterMap(0), new CPPTemplateParameterMap(fnParCount), 0); IType fnParPack= null; - Set usedTemplateParIds= new HashSet(); + Set usedTemplateParIds= new HashSet<>(); for (int j= 0; j < fnArgCount; j++) { IType par; if (fnParPack != null) { @@ -598,7 +601,7 @@ public class TemplateArgumentDeduction { private static ICPPTemplateArgument[] createArguments(CPPTemplateParameterMap map, final ICPPTemplateParameter[] tmplParams) { - List result= new ArrayList(tmplParams.length); + List result= new ArrayList<>(tmplParams.length); for (ICPPTemplateParameter tpar : tmplParams) { if (tpar.isParameterPack()) { ICPPTemplateArgument[] deducedArgs= map.getPackExpansion(tpar); @@ -622,7 +625,7 @@ public class TemplateArgumentDeduction { * the deduced A. */ private static ICPPClassType findBaseInstance(ICPPClassType a, ICPPClassTemplate pTemplate, IASTNode point) throws DOMException { - return findBaseInstance(a, pTemplate, CPPSemantics.MAX_INHERITANCE_DEPTH, new HashSet(), point); + return findBaseInstance(a, pTemplate, CPPSemantics.MAX_INHERITANCE_DEPTH, new HashSet<>(), point); } private static ICPPClassType findBaseInstance(ICPPClassType a, ICPPClassTemplate pTemplate, int maxdepth, HashSet handled, IASTNode point) throws DOMException { @@ -769,7 +772,7 @@ public class TemplateArgumentDeduction { for (ICPPTemplateParameter tpar : tpars) { if (tpar.isParameterPack()) { if (fTemplateParameterPacks == null) { - fTemplateParameterPacks= new HashSet(); + fTemplateParameterPacks= new HashSet<>(); } fTemplateParameterPacks.add(tpar.getParameterID()); } @@ -999,7 +1002,7 @@ public class TemplateArgumentDeduction { p= pArgs[i]; if (p.isPackExpansion()) { p= expansionPattern= p.getExpansionPattern(); - deduct= new TemplateArgumentDeduction(this, aArgs.length-i); + deduct= new TemplateArgumentDeduction(this, aArgs.length - i); p= CPPTemplates.instantiateArgument(p, fExplicitArgs, deduct.fPackOffset, null, point); if (!CPPTemplates.isValidArgument(p)) return false;