mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
d3264a7418
commit
72b6075733
1 changed files with 28 additions and 26 deletions
|
@ -91,12 +91,12 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
|||
*/
|
||||
public int getVisibility() {
|
||||
IASTDeclaration decl = getPrimaryDeclaration();
|
||||
if( decl == null ){
|
||||
if (decl == null) {
|
||||
IScope scope = getScope();
|
||||
if( scope instanceof ICPPClassScope ){
|
||||
if (scope instanceof ICPPClassScope) {
|
||||
ICPPClassType cls = ((ICPPClassScope)scope).getClassType();
|
||||
if( cls != null )
|
||||
return ( cls.getKey() == ICPPClassType.k_class ) ? ICPPASTVisibilityLabel.v_private : ICPPASTVisibilityLabel.v_public;
|
||||
if (cls != null)
|
||||
return (cls.getKey() == ICPPClassType.k_class) ? ICPPASTVisibilityLabel.v_private : ICPPASTVisibilityLabel.v_public;
|
||||
}
|
||||
return ICPPASTVisibilityLabel.v_private;
|
||||
}
|
||||
|
@ -105,14 +105,15 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
|||
IASTDeclaration [] members = cls.getMembers();
|
||||
ICPPASTVisibilityLabel vis = null;
|
||||
for (IASTDeclaration member : members) {
|
||||
if( member instanceof ICPPASTVisibilityLabel )
|
||||
if (member instanceof ICPPASTVisibilityLabel) {
|
||||
vis = (ICPPASTVisibilityLabel) member;
|
||||
else if( member == decl )
|
||||
} else if (member == decl) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( vis != null ){
|
||||
if (vis != null) {
|
||||
return vis.getVisibility();
|
||||
} else if( cls.getKey() == ICPPASTCompositeTypeSpecifier.k_class ){
|
||||
} else if (cls.getKey() == ICPPASTCompositeTypeSpecifier.k_class) {
|
||||
return ICPPASTVisibilityLabel.v_private;
|
||||
}
|
||||
return ICPPASTVisibilityLabel.v_public;
|
||||
|
@ -145,9 +146,9 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
|||
*/
|
||||
public boolean isVirtual() {
|
||||
IASTDeclaration decl = getPrimaryDeclaration();
|
||||
if( decl != null ){
|
||||
if (decl != null) {
|
||||
ICPPASTDeclSpecifier declSpec = getDeclSpec(decl);
|
||||
if( declSpec != null ){
|
||||
if (declSpec != null) {
|
||||
return declSpec.isVirtual();
|
||||
}
|
||||
}
|
||||
|
@ -156,10 +157,11 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
|||
|
||||
protected ICPPASTDeclSpecifier getDeclSpec(IASTDeclaration decl) {
|
||||
ICPPASTDeclSpecifier declSpec = null;
|
||||
if( decl instanceof IASTSimpleDeclaration )
|
||||
if (decl instanceof IASTSimpleDeclaration) {
|
||||
declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration)decl).getDeclSpecifier();
|
||||
else if( decl instanceof IASTFunctionDefinition )
|
||||
} else if (decl instanceof IASTFunctionDefinition) {
|
||||
declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition)decl).getDeclSpecifier();
|
||||
}
|
||||
return declSpec;
|
||||
}
|
||||
|
||||
|
@ -169,9 +171,9 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
|||
@Override
|
||||
public boolean isInline() {
|
||||
IASTDeclaration decl = getPrimaryDeclaration();
|
||||
if( decl instanceof IASTFunctionDefinition )
|
||||
if (decl instanceof IASTFunctionDefinition)
|
||||
return true;
|
||||
if( decl == null )
|
||||
if (decl == null)
|
||||
return false;
|
||||
|
||||
IASTDeclSpecifier declSpec = ((IASTSimpleDeclaration)decl).getDeclSpecifier();
|
||||
|
@ -183,7 +185,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
|||
*/
|
||||
@Override
|
||||
public boolean isMutable() {
|
||||
return hasStorageClass( this, IASTDeclSpecifier.sc_mutable );
|
||||
return hasStorageClass(this, IASTDeclSpecifier.sc_mutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue