void (@NotNull PsiStatement statement) { if (statement instanceof PsiRequiresStatement requiresStatement) { PsiJavaModule module = requiresStatement.resolve(); if (module == null) return; PsiAnnotation annotation = getPreviewFeatureAnnotation(module); HighlightingFeature feature = HighlightingFeature.fromPreviewFeatureAnnotation(annotation); if (feature == null) return; String description = JavaBundle.message("inspection.preview.feature.0.is.preview.api.message", module.getName()); registerProblem(requiresStatement.getReferenceElement(), description, feature, annotation); } else if (statement instanceof PsiProvidesStatement providesStatement) { PsiReferenceList list = providesStatement.getImplementationList(); if (list == null) return; for (PsiJavaCodeReferenceElement element : list.getReferenceElements()) { PsiElement resolved = element.resolve(); if (resolved instanceof PsiClass psiClass) { PsiAnnotation annotation = getPreviewFeatureAnnotation(psiClass); HighlightingFeature feature = HighlightingFeature.fromPreviewFeatureAnnotation(annotation); if (feature == null) continue; String description = JavaBundle.message("inspection.preview.feature.0.is.preview.api.message", psiClass.getQualifiedName()); registerProblem(element, description, feature, annotation); } } } }