void (@NotNull PsiClass aClass) { super.visitClass(aClass); if (!aClass.isRecord()) return; if (AnnotationUtil.isAnnotated(aClass, CommonClassNames.JAVA_LANG_SAFE_VARARGS, 0)) return; PsiRecordHeader header = aClass.getRecordHeader(); if (header == null) return; PsiRecordComponent lastComponent = ArrayUtil.getLastElement(header.getRecordComponents()); if (lastComponent == null || !lastComponent.isVarArgs()) return; PsiMethod constructor = JavaPsiRecordUtil.findCanonicalConstructor(aClass); if (constructor != null && constructor.isPhysical()) return; // will be reported on constructor instead final PsiType type = lastComponent.getType(); LOG.assertTrue(type instanceof PsiEllipsisType, "type: " + type.getCanonicalText() + "; param: " + lastComponent); final PsiType componentType = ((PsiEllipsisType)type).getComponentType(); if (JavaGenericsUtil.isReifiableType(componentType)) { return; } final PsiElement nameIdentifier = ((PsiNameIdentifierOwner)aClass).getNameIdentifier(); if (nameIdentifier != null) { final LocalQuickFix quickFix = new AnnotateAsSafeVarargsQuickFix(false); myHolder.registerProblem(nameIdentifier, JavaAnalysisBundle.message("possible.heap.pollution.from.parameterized.vararg.type.loc"), quickFix); } }