@Override
  public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
    myInternalName = name;
    TypeInfo fqn = myAnonymousInner || myLocalClassInner ? null : myFirstPassData.toTypeInfo(name);
    String shortName = myShortName != null && name.endsWith(myShortName) ? myShortName : fqn != null ? fqn.getShortTypeText() : myShortName;

    int flags = myAccess | access;
    boolean isDeprecated = isSet(flags, Opcodes.ACC_DEPRECATED);
    boolean isInterface = isSet(flags, Opcodes.ACC_INTERFACE);
    boolean isEnum = isSet(flags, Opcodes.ACC_ENUM);
    boolean isAnnotationType = isSet(flags, Opcodes.ACC_ANNOTATION);
    boolean isRecord = isSet(flags, Opcodes.ACC_RECORD);
    short stubFlags = PsiClassStubImpl.packFlags(
      isDeprecated, isInterface, isEnum, false, false, isAnnotationType, false, false, myAnonymousInner, myLocalClassInner, false,
      isRecord, false);
    myResult =
      new PsiClassStubImpl<>(JavaStubElementTypes.CLASS, myParent, fqn == null ? TypeInfo.SimpleTypeInfo.NULL : fqn, shortName, null,
                             stubFlags);

    int classFlags = packClassFlags(flags);
    if (myFirstPassData.isSealed()) {
      classFlags |= ModifierFlags.SEALED_MASK;
    }
    myModList = new PsiModifierListStubImpl(myResult, classFlags);
    if (isRecord) {
      myHeaderStub = new PsiRecordHeaderStubImpl(myResult);
    }

    if (signature != null) {
      try {
        myClassInfo = parseClassSignature(signature);
      }
      catch (ClsFormatException e) {
        if (LOG.isDebugEnabled()) LOG.debug("source=" + mySource + " signature=" + signature, e);
      }
    }
    if (myClassInfo == null) {
      myClassInfo = parseClassDescription(superName, interfaces);
    }

    new PsiTypeParameterListStubImpl(myResult);

    if (myResult.isInterface()) {
      if (myClassInfo.interfaces != null && myResult.isAnnotationType()) {
        myClassInfo.interfaces.removeIf(info -> info.getKind() == TypeInfo.TypeKind.JAVA_LANG_ANNOTATION_ANNOTATION);
      }
      newReferenceList(JavaStubElementTypes.EXTENDS_LIST, myResult, myClassInfo.interfaces);
      newReferenceList(JavaStubElementTypes.IMPLEMENTS_LIST, myResult, Collections.emptyList());
    }
    else {
      if (myClassInfo.superType == null || 
          myResult.isEnum() && "java/lang/Enum".equals(superName) ||
          myResult.isRecord() && "java/lang/Record".equals(superName)) {
        newReferenceList(JavaStubElementTypes.EXTENDS_LIST, myResult, Collections.emptyList());
      }
      else {
        newReferenceList(JavaStubElementTypes.EXTENDS_LIST, myResult, Collections.singletonList(myClassInfo.superType));
      }
      newReferenceList(JavaStubElementTypes.IMPLEMENTS_LIST, myResult, myClassInfo.interfaces);
    }
  }
@Override
  public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)