mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Cosmetics.
Change-Id: I7db0495a9d98c1920a090e41a1eb8a4bf1e40354
This commit is contained in:
parent
6c6901547e
commit
cfbb774b7a
1 changed files with 10 additions and 8 deletions
|
@ -94,7 +94,7 @@ public class ClassTypeHelper {
|
||||||
if (backup != null)
|
if (backup != null)
|
||||||
return backup.getFriends();
|
return backup.getFriends();
|
||||||
IASTNode[] declarations= host.getDeclarations();
|
IASTNode[] declarations= host.getDeclarations();
|
||||||
IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
|
IASTNode node = (declarations != null && declarations.length != 0) ? declarations[0] : null;
|
||||||
return new IBinding[] { new ProblemBinding(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
|
return new IBinding[] { new ProblemBinding(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@ public class ClassTypeHelper {
|
||||||
/**
|
/**
|
||||||
* Checks if a binding is a friend of a class. Only classes and functions can be friends of a class.
|
* Checks if a binding is a friend of a class. Only classes and functions can be friends of a class.
|
||||||
* A class is considered a friend of itself.
|
* A class is considered a friend of itself.
|
||||||
|
*
|
||||||
* @param binding a binding.
|
* @param binding a binding.
|
||||||
* @param classType a class.
|
* @param classType a class.
|
||||||
* @return {@code true} if {@code binding} is a friend of {@code classType}.
|
* @return {@code true} if {@code binding} is a friend of {@code classType}.
|
||||||
|
@ -281,6 +282,7 @@ public class ClassTypeHelper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all direct and indirect base classes.
|
* Returns all direct and indirect base classes.
|
||||||
|
*
|
||||||
* @param classType a class
|
* @param classType a class
|
||||||
* @return An array of base classes in arbitrary order.
|
* @return An array of base classes in arbitrary order.
|
||||||
*/
|
*/
|
||||||
|
@ -306,7 +308,8 @@ public class ClassTypeHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all (direct or indirect) virtual base classes of 'classType'.
|
* Returns all (direct or indirect) virtual base classes of {@code classType}.
|
||||||
|
*
|
||||||
* @param point the point of instantiation for name lookups
|
* @param point the point of instantiation for name lookups
|
||||||
*/
|
*/
|
||||||
public static ICPPClassType[] getVirtualBases(ICPPClassType classType, IASTNode point) {
|
public static ICPPClassType[] getVirtualBases(ICPPClassType classType, IASTNode point) {
|
||||||
|
@ -318,7 +321,7 @@ public class ClassTypeHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function for #getVirtualBases(classType, point).
|
* Helper function for {@link #getVirtualBases(ICPPClassType, IASTNode)}.
|
||||||
*/
|
*/
|
||||||
private static void getVirtualBases(ICPPClassType classType, Set<ICPPClassType> virtualBases,
|
private static void getVirtualBases(ICPPClassType classType, Set<ICPPClassType> virtualBases,
|
||||||
Set<ICPPClassType> nonvirtualBases, IASTNode point) {
|
Set<ICPPClassType> nonvirtualBases, IASTNode point) {
|
||||||
|
@ -343,6 +346,7 @@ public class ClassTypeHelper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks inheritance relationship between two classes.
|
* Checks inheritance relationship between two classes.
|
||||||
|
*
|
||||||
* @return {@code true} if {@code subclass} is a subclass of {@code superclass}.
|
* @return {@code true} if {@code subclass} is a subclass of {@code superclass}.
|
||||||
*/
|
*/
|
||||||
public static boolean isSubclass(ICPPClassType subclass, ICPPClassType superclass, IASTNode point) {
|
public static boolean isSubclass(ICPPClassType subclass, ICPPClassType superclass, IASTNode point) {
|
||||||
|
@ -461,8 +465,8 @@ public class ClassTypeHelper {
|
||||||
return ArrayUtil.trim(result);
|
return ArrayUtil.trim(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#getConstructors()
|
* @see ICPPClassType#getConstructors()
|
||||||
*/
|
*/
|
||||||
public static ICPPConstructor[] getConstructors(ICPPInternalClassTypeMixinHost host) {
|
public static ICPPConstructor[] getConstructors(ICPPInternalClassTypeMixinHost host) {
|
||||||
ICPPClassScope scope = host.getCompositeScope();
|
ICPPClassScope scope = host.getCompositeScope();
|
||||||
|
@ -653,8 +657,7 @@ public class ClassTypeHelper {
|
||||||
private static boolean findOverridden(ICPPClassType classType, IASTNode point, char[] methodName,
|
private static boolean findOverridden(ICPPClassType classType, IASTNode point, char[] methodName,
|
||||||
ICPPFunctionType methodType, Map<ICPPClassType, Boolean> virtualInClass,
|
ICPPFunctionType methodType, Map<ICPPClassType, Boolean> virtualInClass,
|
||||||
List<ICPPMethod> result, int maxdepth) {
|
List<ICPPMethod> result, int maxdepth) {
|
||||||
// Prevent recursion due to a hierarchy of unbounded depth,
|
// Prevent recursion due to a hierarchy of unbounded depth, e.g. A<I> deriving from A<I - 1>.
|
||||||
// e.g. A<I> deriving from A<I - 1>.
|
|
||||||
if (maxdepth <= 0)
|
if (maxdepth <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -698,7 +701,6 @@ public class ClassTypeHelper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all methods found in the index, that override the given {@code method}.
|
* Returns all methods found in the index, that override the given {@code method}.
|
||||||
* @throws CoreException
|
|
||||||
*/
|
*/
|
||||||
public static ICPPMethod[] findOverriders(IIndex index, ICPPMethod method) throws CoreException {
|
public static ICPPMethod[] findOverriders(IIndex index, ICPPMethod method) throws CoreException {
|
||||||
if (!isVirtual(method))
|
if (!isVirtual(method))
|
||||||
|
|
Loading…
Add table
Reference in a new issue