Ejemplo n.º 1
0
 // TODO: maybe we have similar routine
 @Nullable
 public static ClassDescriptor getContainingClass(@NotNull DeclarationDescriptor descriptor) {
   DeclarationDescriptor containing = descriptor.getContainingDeclaration();
   while (containing != null) {
     if (containing instanceof ClassDescriptor && !isClassObject(containing)) {
       return (ClassDescriptor) containing;
     }
     containing = containing.getContainingDeclaration();
   }
   return null;
 }
Ejemplo n.º 2
0
 @NotNull
 public static DeclarationDescriptor getContainingDeclaration(
     @NotNull DeclarationDescriptor descriptor) {
   DeclarationDescriptor containing = descriptor.getContainingDeclaration();
   assert containing != null : "Should be called on objects that have containing declaration.";
   return containing;
 }