private static Object @NotNull [] calculatePossibleInstanceQualifiers(@NotNull PsiMethod method) {
    if (!method.hasModifierProperty(PsiModifier.STATIC)) {
      throw new CommonRefactoringUtil.RefactoringErrorHintException(
        JavaRefactoringBundle.message("convertToInstanceMethod.method.is.not.static", method.getName()));
    }
    List<Object> qualifiers = new ArrayList<>();
    final PsiParameter[] parameters = method.getParameterList().getParameters();
    boolean classTypesFound = false;
    boolean resolvableClassesFound = false;
    for (final PsiParameter parameter : parameters) {
      final PsiType type = parameter.getType();
      if (type instanceof PsiClassType classType) {
        classTypesFound = true;
        final PsiClass psiClass = classType.resolve();
        if (psiClass != null && !(psiClass instanceof PsiTypeParameter)) {
          resolvableClassesFound = true;
          if (method.getManager().isInProject(psiClass)) {
            qualifiers.add(parameter);
          }
        }
      }
    }
    PsiClass containingClass = method.getContainingClass();
    boolean canHaveUsableConstructor = containingClass != null && 
                                       containingClass.getQualifiedName() != null && 
                                       !containingClass.isEnum() &&
                                       !PsiUtil.isInnerClass(containingClass) && 
                                       !(containingClass instanceof PsiImplicitClass);
    if (canHaveUsableConstructor) {
      PsiMethod[] constructors = containingClass.getConstructors();
      boolean noArgConstructor =
        constructors.length == 0 || ContainerUtil.exists(constructors, constructor -> constructor.getParameterList().isEmpty());
      if (noArgConstructor) {
        qualifiers.add("this / new " + containingClass.getName() + "()");
      }
    }
    if (!qualifiers.isEmpty()) {
      return qualifiers.toArray();
    }
    
    String message;
    if (!classTypesFound) {
      message = JavaRefactoringBundle.message("convertToInstanceMethod.no.parameters.with.reference.type");
    }
    else if (!resolvableClassesFound) {
      message = JavaRefactoringBundle.message("convertToInstanceMethod.all.reference.type.parameters.have.unknown.types");
    }
    else {
      message = JavaRefactoringBundle.message("convertToInstanceMethod.all.reference.type.parameters.are.not.in.project");
    }
    if (canHaveUsableConstructor) {
      message += " " + JavaRefactoringBundle.message("convertToInstanceMethod.no.default.ctor");
    }
    throw new CommonRefactoringUtil.RefactoringErrorHintException(message);
  }
private static Object @NotNull [] calculatePossibleInstanceQualifiers(@NotNull PsiMethod method)