From d7e43b1a2ca5e6ee96b5c3fb7df5954b321a4d34 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 24 Apr 2013 12:43:10 -0700 Subject: [PATCH] Cosmetics. --- .../core/parser/tests/ast2/AST2TemplateTests.java | 14 +++++++------- .../cdt/core/parser/tests/ast2/AST2TestBase.java | 4 ++-- .../dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java | 13 ++++++------- .../core/dom/ast/cpp/ICPPASTVisibilityLabel.java | 3 +-- .../internal/core/dom/parser/cpp/CPPMethod.java | 4 +--- .../ui/refactoring/utils/VisibilityEnum.java | 3 +-- 6 files changed, 18 insertions(+), 23 deletions(-) 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 54fd097093f..d03a5f20b41 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 @@ -3753,13 +3753,13 @@ public class AST2TemplateTests extends AST2TestBase { // } public void testTypedefPreservation_380498_1() throws Exception { BindingAssertionHelper ba= getAssertionHelper(); - ICPPVariable s1 = ba.assertNonProblem("s1", ICPPVariable.class); + ICPPVariable s1 = ba.assertNonProblem("s1"); assertTrue(s1.getType() instanceof ITypedef); assertEquals("string", ((ITypedef) s1.getType()).getName()); - ICPPVariable s2 = ba.assertNonProblem("s2", ICPPVariable.class); + ICPPVariable s2 = ba.assertNonProblem("s2"); assertTrue(s2.getType() instanceof ITypedef); assertEquals("string", ((ITypedef) s2.getType()).getName()); - ICPPVariable s3 = ba.assertNonProblem("s3", ICPPVariable.class); + ICPPVariable s3 = ba.assertNonProblem("s3"); assertTrue(s3.getType() instanceof ITypedef); assertEquals("string", ((ITypedef) s3.getType()).getName()); } @@ -6267,7 +6267,7 @@ public class AST2TemplateTests extends AST2TestBase { ICPPTemplateParameter aliasParameterT= templateParameterAlias.getTemplateParameters()[0]; assertEquals(1, aliasParameterT.getTemplateNestingLevel()); - ICPPAliasTemplateInstance aliasIntInstance = bh.assertNonProblem("Alias", ICPPAliasTemplateInstance.class); + ICPPAliasTemplateInstance aliasIntInstance = bh.assertNonProblem("Alias"); IType typeOfAliasIntInstance = aliasIntInstance.getType(); assertTrue(typeOfAliasIntInstance instanceof ICPPBasicType); assertEquals(((ICPPBasicType)typeOfAliasIntInstance).getKind(), IBasicType.Kind.eInt); @@ -7019,7 +7019,7 @@ public class AST2TemplateTests extends AST2TestBase { // const bool B = has_type::value; public void testSFINAEInNestedTypeInTemplateArgument_402257() throws Exception { BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); - ICPPVariable B = helper.assertNonProblem("B", ICPPVariable.class); + ICPPVariable B = helper.assertNonProblem("B"); Long val = B.getInitialValue().numericalValue(); assertNotNull(val); assertEquals(0 /* false */, val.longValue()); @@ -7461,7 +7461,7 @@ public class AST2TemplateTests extends AST2TestBase { // constexpr int bar = foo::i; public void testSizeofParameterPackOnTypeid_401973() throws Exception { BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); - ICPPVariable bar = helper.assertNonProblem("bar", ICPPVariable.class); + ICPPVariable bar = helper.assertNonProblem("bar"); Long barValue = bar.getInitialValue().numericalValue(); assertNotNull(barValue); assertEquals(2, barValue.longValue()); @@ -7571,7 +7571,7 @@ public class AST2TemplateTests extends AST2TestBase { // } public void testUnqualifiedFunctionCallInTemplate_402498c() throws Exception { BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); - ICPPVariable x = helper.assertNonProblem("x", ICPPVariable.class); + ICPPVariable x = helper.assertNonProblem("x"); // We really should assert that x's type is a ProblemType, but the semantic // analyzer is too lenient and makes it a TypeOfDependentExpression if it // can't instantiate the return type of foo() properly. diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java index fa6c2a07227..a2f8eb63fd4 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java @@ -103,7 +103,7 @@ public class AST2TestBase extends BaseTestCase { public final static String TEST_CODE = ""; protected static final IParserLogService NULL_LOG = new NullLogService(); protected static boolean sValidateCopy; - + protected static class CommonTypes { public static IType int_ = new CPPBasicType(Kind.eInt, 0); public static IType pointerToInt = new CPPPointerType(int_); @@ -748,7 +748,7 @@ public class AST2TestBase extends BaseTestCase { assertTrue("ProblemBinding for name: " + name, !(binding instanceof IProblemBinding)); return assertType(binding, cs); } - + public void assertVariableType(String variableName, IType expectedType) { IVariable var = assertNonProblem(variableName, IVariable.class); assertSameType(expectedType, var.getType()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java index 7bf24534b46..b3a91f4d6c0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCompositeTypeSpecifier.java @@ -60,9 +60,9 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie public static final ASTNodeProperty NAME = new ASTNodeProperty( "ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$ - public static final int v_public = 1; - public static final int v_protected = 2; - public static final int v_private = 3; + public static final int v_public = ICPPASTVisibilityLabel.v_public; + public static final int v_protected = ICPPASTVisibilityLabel.v_protected; + public static final int v_private = ICPPASTVisibilityLabel.v_private; /** * Returns whether this specifies a virtual base. @@ -108,17 +108,16 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie } /** - * Get the base specifiers. + * Returns the base specifiers. * * @return ICPPASTBaseSpecifier [] */ public ICPPASTBaseSpecifier[] getBaseSpecifiers(); /** - * Add a base specifier. + * Adds a base specifier. * - * @param baseSpec - * ICPPASTBaseSpecifier + * @param baseSpec ICPPASTBaseSpecifier */ public void addBaseSpecifier(ICPPASTBaseSpecifier baseSpec); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTVisibilityLabel.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTVisibilityLabel.java index 23ba2025a7c..c8931fbbba0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTVisibilityLabel.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTVisibilityLabel.java @@ -13,8 +13,7 @@ package org.eclipse.cdt.core.dom.ast.cpp; import org.eclipse.cdt.core.dom.ast.IASTDeclaration; /** - * C++ allows for visibility labels to be mixed interdeclaration in class - * specifiers. + * C++ allows for visibility labels to be mixed with declarations in class specifiers. * * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java index 39ecade0e23..0a673b62c1a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java @@ -87,9 +87,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod { } return null; } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMember#getVisibility() - */ + @Override public int getVisibility() { IASTDeclaration decl = getPrimaryDeclaration(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/VisibilityEnum.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/VisibilityEnum.java index aa653695be7..aad471a5508 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/VisibilityEnum.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/VisibilityEnum.java @@ -16,8 +16,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBas import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel; /** - * Enum that represents C++ visibilities, with methods to convert to - * and from ICPPASTVisiblityLabel. + * Enum that represents C++ visibilities, with methods to convert to and from ICPPASTVisiblityLabel. */ public enum VisibilityEnum { // The values are ordered by increasing visibility.