void (@NotNull PsiClass aClass) { if (aClass.isInterface() || aClass.isAnnotationType() || aClass.isRecord()) { return; } if (!SerializationUtils.isSerializable(aClass) || SerializationUtils.hasWriteReplace(aClass)) { return; } PsiClass ancestor = aClass.getSuperClass(); final Set<PsiClass> visitedClasses = new HashSet<>(8); while (ancestor != null && SerializationUtils.isSerializable(ancestor)) { if (SerializationUtils.hasWriteReplace(ancestor)) { return; } ancestor = ancestor.getSuperClass(); if (!visitedClasses.add(ancestor)) { return; } } if (ancestor == null || classHasNoArgConstructor(ancestor)) { return; } registerClassError(aClass, ancestor); }