return resolvedInnerType != null &&
isEnclosedBy(resolvedInnerType.getBaseType(), outerType);
}
private boolean isContextWithinTypeInstance(final TypeReference type) {
final MethodReference method = context.getCurrentMethod();
if (method != null) {
final MethodDefinition resolvedMethod = method.resolve();
if (resolvedMethod != null && resolvedMethod.isStatic()) {
return false;
}
}
final TypeReference scope = context.getCurrentType();
for (TypeReference current = scope;
current != null;
current = current.getDeclaringType()) {
if (MetadataResolver.areEquivalent(current, type)) {
return true;
}
final TypeDefinition resolved = current.resolve();
if (resolved != null && resolved.isLocalClass()) {
final MethodReference declaringMethod = resolved.getDeclaringMethod();
if (declaringMethod != null) {
final MethodDefinition resolvedDeclaringMethod = declaringMethod.resolve();
if (resolvedDeclaringMethod != null && resolvedDeclaringMethod.isStatic()) {
break;
}
}