Beispiel #1
0
 @NotNull
 @Override
 public Collection<? extends JetType> getSupertypes() {
   if (supertypes == null) {
     if (resolveSession.isClassSpecial(DescriptorUtils.getFQName(LazyClassDescriptor.this))) {
       this.supertypes = Collections.emptyList();
     } else {
       JetClassOrObject classOrObject =
           declarationProvider.getOwnerInfo().getCorrespondingClassOrObject();
       if (classOrObject == null) {
         this.supertypes = Collections.emptyList();
       } else {
         List<JetType> allSupertypes =
             resolveSession
                 .getInjector()
                 .getDescriptorResolver()
                 .resolveSupertypes(
                     getScopeForClassHeaderResolution(),
                     LazyClassDescriptor.this,
                     classOrObject,
                     resolveSession.getTrace());
         List<JetType> validSupertypes =
             Lists.newArrayList(Collections2.filter(allSupertypes, VALID_SUPERTYPE));
         this.supertypes = validSupertypes;
         findAndDisconnectLoopsInTypeHierarchy(validSupertypes);
       }
     }
   }
   return supertypes;
 }
                  @Override
                  public Collection<JetType> invoke() {
                    if (resolveSession.isClassSpecial(
                        DescriptorUtils.getFQName(LazyClassDescriptor.this))) {
                      return Collections.emptyList();
                    } else {
                      JetClassOrObject classOrObject =
                          declarationProvider.getOwnerInfo().getCorrespondingClassOrObject();
                      if (classOrObject == null) {
                        return Collections.emptyList();
                      } else {
                        List<JetType> allSupertypes =
                            resolveSession
                                .getInjector()
                                .getDescriptorResolver()
                                .resolveSupertypes(
                                    getScopeForClassHeaderResolution(),
                                    LazyClassDescriptor.this,
                                    classOrObject,
                                    resolveSession.getTrace());

                        return Lists.newArrayList(
                            Collections2.filter(allSupertypes, VALID_SUPERTYPE));
                      }
                    }
                  }
 @NotNull
 private List<AnnotationDescriptor> resolveAnnotations() {
   JetClassLikeInfo classInfo = declarationProvider.getOwnerInfo();
   JetModifierList modifierList = classInfo.getModifierList();
   if (modifierList != null) {
     AnnotationResolver annotationResolver = resolveSession.getInjector().getAnnotationResolver();
     JetScope scopeForDeclaration =
         getScopeProvider().getResolutionScopeForDeclaration(classInfo.getScopeAnchor());
     return annotationResolver.resolveAnnotationsWithArguments(
         scopeForDeclaration, modifierList, resolveSession.getTrace());
   } else {
     return Collections.emptyList();
   }
 }
Beispiel #4
0
 @Override
 public List<AnnotationDescriptor> getAnnotations() {
   if (annotations == null) {
     JetClassLikeInfo classInfo = declarationProvider.getOwnerInfo();
     JetModifierList modifierList = classInfo.getModifierList();
     if (modifierList != null) {
       AnnotationResolver annotationResolver =
           resolveSession.getInjector().getAnnotationResolver();
       annotations =
           annotationResolver.resolveAnnotations(
               resolveSession.getResolutionScope(classInfo.getScopeAnchor()),
               modifierList,
               resolveSession.getTrace());
     } else {
       annotations = Collections.emptyList();
     }
   }
   return annotations;
 }
Beispiel #5
0
 @Override
 public List<AnnotationDescriptor> getAnnotations() {
   return Collections.emptyList(); // TODO
 }
 @Override
 public Collection<JetType> invoke(Boolean firstTime) {
   return Collections.emptyList();
 }