private static void setInitialValues(ArrayReference arrayReference, Object[] values, EvaluationContextImpl context) throws EvaluateException {
    ArrayType type = (ArrayType)arrayReference.referenceType();
    DebugProcessImpl debugProcess = context.getDebugProcess();
    try {
      if (type.componentType() instanceof ArrayType componentType) {
        int length = arrayReference.length();
        for (int idx = 0; idx < length; idx++) {
          Object value = values[idx];
          if (value instanceof Value) {
            arrayReference.setValue(idx, (Value)value);
          }
          else {
            ArrayReference componentArray = (ArrayReference)arrayReference.getValue(idx);
            Object[] componentArrayValues = (Object[])value;
            if (componentArray == null) {
              componentArray = DebuggerUtilsEx.mirrorOfArray(componentType, componentArrayValues.length, context);
              arrayReference.setValue(idx, componentArray);
            }
            setInitialValues(componentArray, componentArrayValues, context);
          }
        }
      }
      else {
        if (values.length > 0) {
          arrayReference.setValues(new ArrayList(Arrays.asList(values)));
        }
      }
    }
    catch (ClassNotLoadedException ex) {
      final ReferenceType referenceType;
      try {
        referenceType = context.isAutoLoadClasses() ? debugProcess.loadClass(context, ex.className(), type.classLoader()) : null;
      }
      catch (InvocationException | InvalidTypeException | IncompatibleThreadStateException | ClassNotLoadedException e) {
        throw EvaluateExceptionUtil.createEvaluateException(e);
      }
      if (referenceType != null) {
        setInitialValues(arrayReference, values, context);
      }
      else {
        throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("error.class.not.loaded", ex.className()));
      }
    }
    catch (InvalidTypeException ex) {
      throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.incompatible.array.initializer.type"));
    }
    catch (IndexOutOfBoundsException ex) {
      throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.invalid.array.size"));
    }
    catch (ClassCastException ex) {
      throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.cannot.initialize.array"));
    }
  }
private static void setInitialValues(ArrayReference arrayReference, Object[] values, EvaluationContextImpl context)