Result<PsiModifierList> () { List<PsiModifierList> modifiers = new ArrayList<>(); for(PsiDirectory directory: getDirectories()) { PsiFile file = directory.findFile(PACKAGE_INFO_FILE); PsiPackageStatement stmt = file == null ? null : PsiTreeUtil.getChildOfType(file, PsiPackageStatement.class); PsiModifierList modifierList = stmt == null ? null : stmt.getAnnotationList(); ContainerUtil.addIfNotNull(modifiers, modifierList); } for (PsiClass aClass : getFacade().findClasses(getQualifiedName() + ".package-info", allScope())) { ContainerUtil.addIfNotNull(modifiers, aClass.getModifierList()); } PsiCompositeModifierList result = modifiers.isEmpty() ? null : new PsiCompositeModifierList(getManager(), modifiers); return new Result<>(result, PsiModificationTracker.MODIFICATION_COUNT); }