1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-01-16 21:28:09 +00:00
parent 8a315d0822
commit 4dcc4e1fde

View file

@ -29,7 +29,7 @@ import org.eclipse.core.runtime.CoreException;
*/ */
public class ASTInternal { public class ASTInternal {
public static IASTNode[] getDeclarationsOfBinding(IBinding binding) { public static IASTNode[] getDeclarationsOfBinding(IBinding binding) {
if( binding instanceof ICPPInternalBinding ) { if(binding instanceof ICPPInternalBinding) {
return ((ICPPInternalBinding)binding).getDeclarations(); return ((ICPPInternalBinding)binding).getDeclarations();
} }
assert false; assert false;
@ -78,13 +78,11 @@ public class ASTInternal {
ICPPInternalBinding ib= (ICPPInternalBinding) binding; ICPPInternalBinding ib= (ICPPInternalBinding) binding;
decls= ib.getDeclarations(); decls= ib.getDeclarations();
def= ib.getDefinition(); def= ib.getDefinition();
} } else if (binding instanceof ICInternalBinding) {
else if (binding instanceof ICInternalBinding) {
ICInternalBinding ib= (ICInternalBinding) binding; ICInternalBinding ib= (ICInternalBinding) binding;
decls= ib.getDeclarations(); decls= ib.getDeclarations();
def= ib.getDefinition(); def= ib.getDefinition();
} } else {
else {
return null; return null;
} }
if (requireDefinition && def == null) { if (requireDefinition && def == null) {
@ -92,14 +90,14 @@ public class ASTInternal {
} }
String filePath= null; String filePath= null;
if (def != null) { if (def != null) {
if ( (filePath= isPartOfSource(filePath, def)) == null) { if ((filePath= isPartOfSource(filePath, def)) == null) {
return null; return null;
} }
} }
if (decls != null) { if (decls != null) {
for (final IASTNode node : decls) { for (final IASTNode node : decls) {
if (node != null) { if (node != null) {
if ( (filePath= isPartOfSource(filePath, node)) == null) { if ((filePath= isPartOfSource(filePath, node)) == null) {
return null; return null;
} }
} }
@ -135,13 +133,11 @@ public class ASTInternal {
ICPPInternalBinding ib= (ICPPInternalBinding) binding; ICPPInternalBinding ib= (ICPPInternalBinding) binding;
decls= ib.getDeclarations(); decls= ib.getDeclarations();
def= ib.getDefinition(); def= ib.getDefinition();
} } else if (binding instanceof ICInternalBinding) {
else if (binding instanceof ICInternalBinding) {
ICInternalBinding ib= (ICInternalBinding) binding; ICInternalBinding ib= (ICInternalBinding) binding;
decls= ib.getDeclarations(); decls= ib.getDeclarations();
def= ib.getDefinition(); def= ib.getDefinition();
} } else {
else {
return null; return null;
} }
String filePath= null; String filePath= null;