PsiAnnotation (@NotNull PsiModifierListOwner element) { if (element instanceof PsiPackage) return null; PsiAnnotation annotation = element.getAnnotation(JDK_INTERNAL_JAVAC_PREVIEW_FEATURE); if (annotation == null) { annotation = element.getAnnotation(JDK_INTERNAL_PREVIEW_FEATURE); } if (annotation == null && element instanceof PsiMember) { PsiClass containingClass = ((PsiMember)element).getContainingClass(); annotation = containingClass == null ? null : getPreviewFeatureAnnotation(containingClass); } if (annotation == null && !(element instanceof PsiJavaModule)) { PsiJavaModule javaModule = JavaModuleGraphUtil.findDescriptorByElement(element); annotation = javaModule == null ? null : getPreviewFeatureAnnotation(javaModule); } return annotation; }