@Override
  protected synchronized void initialize() {
    UMethod method = getUastElement();
    LOG.assertTrue(method != null);
    PsiElement sourcePsi = method.getSourcePsi();
    LOG.assertTrue(sourcePsi != null);

    List<UParameter> paramList = method.getUastParameters();
    if (!paramList.isEmpty()) {
      // Empty constructor body signals Java record header or Kotlin primary constructor (or red code): uses all parameters implicitly
      // TODO create an extension point for this kind of thing.
      boolean parameterUsed = method.isConstructor() && method.getUastBody() == null;
      for (int i = 0; i < paramList.size(); i++) {
        UParameter param = paramList.get(i);
        if (param.getSourcePsi() != null) {
          RefParameterImpl parameter = (RefParameterImpl)getRefJavaManager().getParameterReference(param, i, this);
          if (parameterUsed && parameter != null) {
            parameter.setUsedForReading();
          }
        }
      }
    }

    RefElement parentRef = findParentRef(sourcePsi, method, myManager);
    if (parentRef == null) return;
    setOwner((WritableRefEntity)parentRef);
    if (!myManager.isDeclarationsFound()) return;

    PsiMethod javaPsi = method.getJavaPsi();
    if (!method.isConstructor()) {
      setAbstract(javaPsi.hasModifierProperty(PsiModifier.ABSTRACT));

      setLibraryOverride(javaPsi.hasModifierProperty(PsiModifier.NATIVE));
      setAppMain(isAppMain(javaPsi, this));
      if (!PsiModifier.PRIVATE.equals(getAccessModifier()) && !isStatic()) {
        initializeSuperMethods(javaPsi);
      }
    }

    if (sourcePsi instanceof PsiMethod && sourcePsi.getLanguage().isKindOf(JavaLanguage.INSTANCE)) {
      if (!method.isConstructor() && JavaPsiRecordUtil.getRecordComponentForAccessor((PsiMethod)sourcePsi) != null) {
        setRecordAccessor(true);
      }
      collectUncaughtExceptions((PsiMethod)sourcePsi);
    }
  }
@Override
  protected synchronized void initialize()