Example #1
0
 @Nullable
 @SuppressWarnings("unchecked")
 public static <D extends DeclarationDescriptor> D getParentOfType(
     @Nullable DeclarationDescriptor descriptor, @NotNull Class<D> aClass, boolean strict) {
   if (descriptor == null) return null;
   if (strict) {
     descriptor = descriptor.getContainingDeclaration();
   }
   while (descriptor != null) {
     if (aClass.isInstance(descriptor)) {
       return (D) descriptor;
     }
     descriptor = descriptor.getContainingDeclaration();
   }
   return null;
 }
Example #2
0
 @NotNull
 public static OverrideCompatibilityInfo externalConditionFailed(
     Class<? extends ExternalOverridabilityCondition> conditionClass) {
   return new OverrideCompatibilityInfo(
       INCOMPATIBLE, "externalConditionFailed: " + conditionClass.getName()); // TODO
 }