@Override
  public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener listener)
    throws EvaluateException {
    if (!Registry.is("debugger.renderers.arrays") ||
        OnDemandRenderer.isOnDemandForced((DebugProcessImpl)evaluationContext.getDebugProcess())) {
      return ClassRenderer.calcLabel(descriptor, evaluationContext);
    }

    Value value = descriptor.getValue();
    if (value == null) {
      return "null";
    }
    else if (value instanceof ArrayReference arrValue) {
      String componentTypeName = ((ArrayType)arrValue.type()).componentTypeName();
      boolean isString = CommonClassNames.JAVA_LANG_STRING.equals(componentTypeName);
      if (TypeConversionUtil.isPrimitive(componentTypeName) || UnBoxingEvaluator.isTypeUnboxable(componentTypeName) || isString) {
        CompletableFuture<String> asyncLabel = DebuggerUtilsAsync.length(arrValue)
          .thenCompose(length -> {
            if (length > 0) {
              int shownLength = Math.min(length, Registry.intValue(
                isString ? "debugger.renderers.arrays.max.strings" : "debugger.renderers.arrays.max.primitives"));
              return DebuggerUtilsAsync.getValues(arrValue, 0, shownLength).thenCompose(values -> {
                @SuppressWarnings("unchecked")
                CompletableFuture<String>[] futures = ContainerUtil.map2Array(values, new CompletableFuture[0], v -> {
                  if (v != null) {
                    try {
                      v = (Value)UnBoxingEvaluator.unbox(v, evaluationContext);
                    }
                    catch (EvaluateException e) {
                      throw new RuntimeException(e);
                    }
                  }
                  return getElementAsString(v);
                });
                return CompletableFuture.allOf(futures).thenApply(__ -> {
                  List<String> elements = ContainerUtil.map(futures, CompletableFuture::join);
                  if (descriptor instanceof ValueDescriptorImpl) {
                    int compactLength = Math.min(shownLength, isString ? 5 : 10);
                    String compact =
                      createLabel(elements.subList(0, compactLength), length - values.size() + (shownLength - compactLength));
                    ((ValueDescriptorImpl)descriptor).setCompactValueLabel(compact);
                  }
                  return createLabel(elements, length - values.size());
                });
              });
            }
            return CompletableFuture.completedFuture("[]");
          });
        if (asyncLabel.isDone()) {
          return asyncLabel.join();
        }
        else {
          asyncLabel.thenAccept(res -> {
            descriptor.setValueLabel(res);
            listener.labelChanged();
          });
        }
      }
      return "";
    }
    return JavaDebuggerBundle.message("label.undefined");
  }
@Override
  public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener listener)