1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 09:45:39 +02:00

Cosmetics

Change-Id: I25ee17f987444b59fab219ca05d46a6fa0bf0ed3
This commit is contained in:
Sergey Prigogin 2016-11-28 16:32:06 -08:00
parent e5c63c7cd8
commit 64cf0c8c51
6 changed files with 58 additions and 56 deletions

View file

@ -18,51 +18,54 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier, IASTNameOwner, IASTDeclarationListOwner {
/**
* <code>TYPE_NAME</code> represents the relationship between an
* <code>IASTCompositeTypeSpecifier</code> and its <code>IASTName</code>.
* {@code k_struct} represents 'struct' in C and C++.
*/
public static final int k_struct = 1;
/**
* {@code k_union} represents 'union' in C and C++.
*/
public static final int k_union = 2;
/**
* {@code k_last} allows for subinterfaces to continue enumerating keys.
*/
public static final int k_last = k_union;
/**
* {@code TYPE_NAME} represents the relationship between an
* {@code IASTCompositeTypeSpecifier} and its {@code IASTName}.
*/
public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty(
"IASTCompositeTypeSpecifier.TYPE_NAME - IASTName for IASTCompositeTypeSpecifier"); //$NON-NLS-1$
/**
* <code>MEMBER_DECLARATION</code> represents the relationship between an
* <code>IASTCompositeTypeSpecifier</code> and its nested<code>IASTDeclaration</code>s.
* {@code MEMBER_DECLARATION} represents the relationship between an
* {@code IASTCompositeTypeSpecifier} and its nested{@code IASTDeclaration}s.
*/
public static final ASTNodeProperty MEMBER_DECLARATION = new ASTNodeProperty(
"IASTCompositeTypeSpecifier.MEMBER_DECLARATION - Nested IASTDeclaration for IASTCompositeTypeSpecifier"); //$NON-NLS-1$
/**
* Get the type (key) of this composite specifier.
* Returns the type (key) of this composite specifier.
*
* @return key for this type
* @see #k_struct
* @see #k_union
*/
public int getKey();
/**
* <code>k_struct</code> represents 'struct' in C & C++
*/
public static final int k_struct = 1;
/**
* <code>k_union</code> represents 'union' in C & C++
*/
public static final int k_union = 2;
/**
* <code>k_last</code> allows for subinterfaces to continue enumerating
* keys
*/
public static final int k_last = k_union;
/**
* Set the type (key) of this composite specifier.
* Sets the type (key) of this composite specifier.
*
* @param key
* @see #k_struct
* @see #k_union
*/
public void setKey(int key);
/**
* Return the name for this composite type. If this is an anonymous type,
* Returns the name for this composite type. If this is an anonymous type,
* this will return an empty name.
*
* @return the name of the type
@ -70,7 +73,7 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier, IASTNameO
public IASTName getName();
/**
* Set the name for this composite type.
* Sets the name for this composite type.
*
* @param name
*/
@ -84,15 +87,14 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier, IASTNameO
public IASTDeclaration[] getMembers();
/**
* Add a member declaration.
* Adds a member declaration.
*
* @param declaration
*/
public void addMemberDeclaration(IASTDeclaration declaration);
/**
* Get the scope that this interface eludes to in the logical tree.
*
* Returns the scope that this interface eludes to in the logical tree.
*/
public IScope getScope();

View file

@ -11,7 +11,7 @@
package org.eclipse.cdt.core.dom.ast;
/**
* Interface for all composite types: classes, structs or unions.
* Interface for all composite types: classes, structs and unions.
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.

View file

@ -24,23 +24,23 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
*/
public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICPPASTDeclSpecifier {
/**
* <code>k_class</code> C++ introduces the class concept for composite types.
* {@code k_class} C++ introduces the class concept for composite types.
*/
public static final int k_class = IASTCompositeTypeSpecifier.k_last + 1;
/**
* <code>k_last</code> allows for subinterfaces to extend the kind type.
* {@code k_last} allows for subinterfaces to extend the kind type.
*/
public static final int k_last = k_class;
/**
* <code>VISIBILITY_LABEL</code> is used to express the relationship for a visibility label "declaration".
* {@code VISIBILITY_LABEL} is used to express the relationship for a visibility label "declaration".
*/
public static final ASTNodeProperty VISIBILITY_LABEL = new ASTNodeProperty(
"ICPPASTCompositeTypeSpecifier.VISIBILITY_LABEL - Visibility label \"declaration\""); //$NON-NLS-1$
/**
* <code>BASE_SPECIFIER</code> expresses the subclass role.
* {@code BASE_SPECIFIER} expresses the subclass role.
*/
public static final ASTNodeProperty BASE_SPECIFIER = new ASTNodeProperty(
"ICPPASTCompositeTypeSpecifier.BASE_SPECIFIER - Expresses the subclass role"); //$NON-NLS-1$
@ -50,21 +50,13 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
"ICPPASTCompositeTypeSpecifier.CLASS_VIRT_SPECIFIER [ICPPASTClassVirtSpecifier]"); //$NON-NLS-1$
/**
* Base Specifiers are where a class expresses from whom it inherits.
* Base specifiers are where a class expresses from whom it inherits.
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public static interface ICPPASTBaseSpecifier extends IASTNode, IASTNameOwner, ICPPASTPackExpandable {
public static final ICPPASTBaseSpecifier[] EMPTY_BASESPECIFIER_ARRAY = {};
/**
* @deprecated Use {@link ICPPASTBaseSpecifier#NAME_SPECIFIER} instead.
* @noreference This field is not intended to be referenced by clients.
*/
@Deprecated
public static final ASTNodeProperty NAME = new ASTNodeProperty(
"ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$
/**
* Relation between base specifier and its name specifier.
*
@ -73,6 +65,14 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
public static final ASTNodeProperty NAME_SPECIFIER = new ASTNodeProperty(
"ICPPASTBaseSpecifier.NAME_SPECIFIER - Name specifier of base class"); //$NON-NLS-1$
/**
* @deprecated Use {@link ICPPASTBaseSpecifier#NAME_SPECIFIER} instead.
* @noreference This field is not intended to be referenced by clients.
*/
@Deprecated
public static final ASTNodeProperty NAME = new ASTNodeProperty(
"ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$
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;
@ -193,7 +193,7 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
public ICPPASTClassVirtSpecifier getVirtSpecifier();
/**
* Set the class-virt-specifier for this class.
* Sets the class-virt-specifier for this class.
* @since 5.7
*/
public void setVirtSpecifier(ICPPASTClassVirtSpecifier virtSpecifier);

View file

@ -128,8 +128,9 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
public CPPClassType(IASTName name, IBinding indexBinding) {
name = stripQualifier(name);
IASTNode parent = name.getParent();
while (parent instanceof IASTName)
while (parent instanceof IASTName) {
parent = parent.getParent();
}
if (parent instanceof IASTCompositeTypeSpecifier) {
definition = name;

View file

@ -541,13 +541,14 @@ public class CPPVisitor extends ASTQueries {
}
}
// Create a binding
// Create a binding.
if (elabType.getKind() != IASTElaboratedTypeSpecifier.k_enum) {
if (templateDecl != null)
if (templateDecl != null) {
binding = new CPPClassTemplate(name);
else
} else {
binding = new CPPClassType(name, binding);
// name may live in a different scope, so make sure to add it to the owner scope, as well.
}
// Name may live in a different scope, so make sure to add it to the owner scope as well.
ASTInternal.addName(scope, elabType.getName());
}
} catch (DOMException e) {

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.ui.refactoring.actions;
import org.eclipse.jface.action.Action;
@ -43,7 +43,7 @@ public abstract class RefactoringAction extends Action {
/**
* Sets behavior with respect to saving dirty editors.
* @param saveRequired if <code>true</code>, dirty editors will be saved before refactoring.
*
*
* @deprecated saving of editors should be controlled by refactoring runner, not by the action.
* @since 5.3
*/
@ -65,7 +65,7 @@ public abstract class RefactoringAction extends Action {
fEditor= null;
fSite= site;
}
@Override
public final void run() {
if (saveRequired) {
@ -84,11 +84,9 @@ public abstract class RefactoringAction extends Action {
run(fEditor.getSite(), wc, (ITextSelection) s);
}
}
} else if (fSite != null) {
if (fElement != null) {
run(fSite, fElement);
}
}
} else if (fSite != null && fElement != null) {
run(fSite, fElement);
}
}
public void updateSelection(ICElement elem) {