1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2016-01-08 10:19:19 -08:00
parent ea73b8149c
commit 1d75c92c77

View file

@ -85,8 +85,8 @@ public class ASTQueries {
} }
/** /**
* Returns the outermost declarator the given <code>declarator</code> nests within, or * Returns the outermost declarator the given {@code declarator} nests within, or
* <code>declarator</code> itself. * the given {@code declarator} itself.
*/ */
public static IASTDeclarator findOutermostDeclarator(IASTDeclarator declarator) { public static IASTDeclarator findOutermostDeclarator(IASTDeclarator declarator) {
IASTDeclarator outermost= null; IASTDeclarator outermost= null;
@ -99,8 +99,8 @@ public class ASTQueries {
} }
/** /**
* Returns the innermost declarator nested within the given <code>declarator</code>, or * Returns the innermost declarator nested within the given {@code declarator}, or
* <code>declarator</code> itself. * the given {@code declarator} itself.
*/ */
public static IASTDeclarator findInnermostDeclarator(IASTDeclarator declarator) { public static IASTDeclarator findInnermostDeclarator(IASTDeclarator declarator) {
IASTDeclarator innermost= null; IASTDeclarator innermost= null;
@ -149,7 +149,7 @@ public class ASTQueries {
} }
/** /**
* Searches for the function enclosing the given node. May return <code>null</code>. * Searches for the function enclosing the given node. May return {@code null}.
*/ */
public static IBinding findEnclosingFunction(IASTNode node) { public static IBinding findEnclosingFunction(IASTNode node) {
IASTFunctionDefinition functionDefinition = findAncestorWithType(node, IASTFunctionDefinition.class); IASTFunctionDefinition functionDefinition = findAncestorWithType(node, IASTFunctionDefinition.class);
@ -169,7 +169,7 @@ public class ASTQueries {
/** /**
* Extracts the active declarations from an array of declarations. * Extracts the active declarations from an array of declarations.
*/ */
public static IASTDeclaration[] extractActiveDeclarations(final IASTDeclaration[] allDeclarations, final int size) { public static IASTDeclaration[] extractActiveDeclarations(IASTDeclaration[] allDeclarations, int size) {
IASTDeclaration[] active; IASTDeclaration[] active;
if (size == 0) { if (size == 0) {
active= IASTDeclaration.EMPTY_DECLARATION_ARRAY; active= IASTDeclaration.EMPTY_DECLARATION_ARRAY;
@ -182,7 +182,7 @@ public class ASTQueries {
active[j++]= d; active[j++]= d;
} }
} }
active= ArrayUtil.trimAt(IASTDeclaration.class, active, j-1); active= ArrayUtil.trim(active, j);
} }
return active; return active;
} }
@ -263,8 +263,8 @@ public class ASTQueries {
protected static IBinding resolveLabel(IASTName labelReference) { protected static IBinding resolveLabel(IASTName labelReference) {
char[] labelName = labelReference.toCharArray(); char[] labelName = labelReference.toCharArray();
IASTFunctionDefinition functionDefinition = findAncestorWithType(labelReference, IASTFunctionDefinition functionDefinition =
IASTFunctionDefinition.class); findAncestorWithType(labelReference, IASTFunctionDefinition.class);
if (functionDefinition != null) { if (functionDefinition != null) {
for (ILabel label : getLabels(functionDefinition)) { for (ILabel label : getLabels(functionDefinition)) {
if (CharArrayUtils.equals(label.getNameCharArray(), labelName)) { if (CharArrayUtils.equals(label.getNameCharArray(), labelName)) {
@ -272,7 +272,7 @@ public class ASTQueries {
} }
} }
} }
// label not found // Label not found.
return new ProblemBinding(labelReference, IProblemBinding.SEMANTIC_LABEL_STATEMENT_NOT_FOUND, return new ProblemBinding(labelReference, IProblemBinding.SEMANTIC_LABEL_STATEMENT_NOT_FOUND,
labelName); labelName);
} }