void (@NotNull PsiClass aClass) { // no call to super, so it doesn't drill down if (aClass.isInterface() || aClass.isAnnotationType() || aClass.isEnum() || aClass.isRecord()) { return; } if (aClass instanceof PsiTypeParameter || aClass instanceof PsiEnumConstantInitializer) { return; } if (ignoreAnonymousInnerClasses && aClass instanceof PsiAnonymousClass) { return; } if (!SerializationUtils.isSerializable(aClass)) { return; } final boolean hasReadObject = SerializationUtils.hasReadObject(aClass); final boolean hasWriteObject = SerializationUtils.hasWriteObject(aClass); if (hasWriteObject && hasReadObject) { return; } if (isIgnoredSubclass(aClass)) { return; } if (ignoreClassWithoutFields) { final PsiField[] fields = aClass.getFields(); boolean hasField = false; for (PsiField field : fields) { if (field.hasModifierProperty(PsiModifier.STATIC)) { continue; } hasField = true; break; } if (!hasField) { return; } } registerClassError(aClass, Boolean.valueOf(hasReadObject), Boolean.valueOf(hasWriteObject)); }