Minor, fix yellow code in OverrideResolver and OverridingUtil

This commit is contained in:
Alexander Udalov
2016-07-11 21:57:46 +03:00
parent 8f33830f29
commit 87387d030f
2 changed files with 9 additions and 9 deletions
@@ -56,8 +56,7 @@ import static org.jetbrains.kotlin.resolve.DescriptorUtils.classCanHaveAbstractM
import static org.jetbrains.kotlin.resolve.OverridingUtil.OverrideCompatibilityInfo.Result.OVERRIDABLE; import static org.jetbrains.kotlin.resolve.OverridingUtil.OverrideCompatibilityInfo.Result.OVERRIDABLE;
public class OverrideResolver { public class OverrideResolver {
private final BindingTrace trace;
@NotNull private final BindingTrace trace;
public OverrideResolver(@NotNull BindingTrace trace) { public OverrideResolver(@NotNull BindingTrace trace) {
this.trace = trace; this.trace = trace;
@@ -124,7 +123,7 @@ public class OverrideResolver {
}; };
} }
private static enum Filtering { private enum Filtering {
RETAIN_OVERRIDING, RETAIN_OVERRIDING,
RETAIN_OVERRIDDEN RETAIN_OVERRIDDEN
} }
@@ -136,7 +135,7 @@ public class OverrideResolver {
} }
@NotNull @NotNull
public static <D> Set<D> filterOutOverriding(@NotNull Set<D> candidateSet) { private static <D> Set<D> filterOutOverriding(@NotNull Set<D> candidateSet) {
//noinspection unchecked //noinspection unchecked
return filterOverrides(candidateSet, Function.ID, Filtering.RETAIN_OVERRIDDEN); return filterOverrides(candidateSet, Function.ID, Filtering.RETAIN_OVERRIDDEN);
} }
@@ -757,7 +756,7 @@ public class OverrideResolver {
/** /**
* @return overridden real descriptors (not fake overrides). Note that all usages of this method should be followed by calling * @return overridden real descriptors (not fake overrides). Note that all usages of this method should be followed by calling
* {@link #filterOutOverridden(java.util.Set)} or {@link #filterOutOverriding(java.util.Set)}, because some of the declarations * {@link #filterOutOverridden(Set)} or {@link #filterOutOverriding(Set)}, because some of the declarations
* can override the other * can override the other
* TODO: merge this method with filterOutOverridden * TODO: merge this method with filterOutOverridden
*/ */
@@ -956,7 +955,7 @@ public class OverrideResolver {
} }
} }
public static boolean isReturnTypeOkForOverride( private static boolean isReturnTypeOkForOverride(
@NotNull CallableDescriptor superDescriptor, @NotNull CallableDescriptor superDescriptor,
@NotNull CallableDescriptor subDescriptor @NotNull CallableDescriptor subDescriptor
) { ) {
@@ -992,7 +991,7 @@ public class OverrideResolver {
return new IndexedParametersSubstitution(superTypeParameters, arguments).buildSubstitutor(); return new IndexedParametersSubstitution(superTypeParameters, arguments).buildSubstitutor();
} }
public static boolean isPropertyTypeOkForOverride( private static boolean isPropertyTypeOkForOverride(
@NotNull PropertyDescriptor superDescriptor, @NotNull PropertyDescriptor superDescriptor,
@NotNull PropertyDescriptor subDescriptor @NotNull PropertyDescriptor subDescriptor
) { ) {
@@ -239,7 +239,7 @@ public class OverridingUtil {
} }
@Nullable @Nullable
static OverrideCompatibilityInfo checkReceiverAndParameterCount( private static OverrideCompatibilityInfo checkReceiverAndParameterCount(
CallableDescriptor superDescriptor, CallableDescriptor superDescriptor,
CallableDescriptor subDescriptor CallableDescriptor subDescriptor
) { ) {
@@ -290,7 +290,7 @@ public class OverridingUtil {
return true; return true;
} }
static List<KotlinType> compiledValueParameters(CallableDescriptor callableDescriptor) { private static List<KotlinType> compiledValueParameters(CallableDescriptor callableDescriptor) {
ReceiverParameterDescriptor receiverParameter = callableDescriptor.getExtensionReceiverParameter(); ReceiverParameterDescriptor receiverParameter = callableDescriptor.getExtensionReceiverParameter();
List<KotlinType> parameters = new ArrayList<KotlinType>(); List<KotlinType> parameters = new ArrayList<KotlinType>();
if (receiverParameter != null) { if (receiverParameter != null) {
@@ -501,6 +501,7 @@ public class OverridingUtil {
H firstNonFlexible = null; H firstNonFlexible = null;
for (H candidate : candidates) { for (H candidate : candidates) {
//noinspection ConstantConditions
if (!FlexibleTypesKt.isFlexible(descriptorByHandle.invoke(candidate).getReturnType())) { if (!FlexibleTypesKt.isFlexible(descriptorByHandle.invoke(candidate).getReturnType())) {
firstNonFlexible = candidate; firstNonFlexible = candidate;
break; break;