Example #1
0
 private void renderModalityForCallable(
     @NotNull CallableMemberDescriptor callable, @NotNull StringBuilder builder) {
   if (!DescriptorUtils.isTopLevelDeclaration(callable)
       || callable.getModality() != Modality.FINAL) {
     if (overridesSomething(callable)
         && overrideRenderingPolicy == OverrideRenderingPolicy.RENDER_OVERRIDE
         && callable.getModality() == Modality.OPEN) {
       return;
     }
     renderModality(callable.getModality(), builder);
   }
 }
 @Override
 protected Set<CallableMemberDescriptor> collectMethodsToGenerate(
     MutableClassDescriptor descriptor) {
   final Set<CallableMemberDescriptor> superMethods =
       OverrideResolver.collectSuperMethods(descriptor).keySet();
   for (CallableMemberDescriptor member : descriptor.getDeclaredCallableMembers()) {
     superMethods.removeAll(member.getOverriddenDescriptors());
   }
   Set<CallableMemberDescriptor> result = new HashSet<CallableMemberDescriptor>();
   for (CallableMemberDescriptor superMethod : superMethods) {
     if (superMethod.getModality().isOverridable()) {
       result.add(superMethod);
     }
   }
   return result;
 }