All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opentelemetry.javaagent.extension.matcher.Utils Maven / Gradle / Ivy

There is a newer version: 2.11.0-alpha
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.javaagent.extension.matcher;

import net.bytebuddy.description.type.TypeDefinition;

final class Utils {
  static String safeTypeDefinitionName(TypeDefinition td) {
    try {
      return td.getTypeName();
    } catch (IllegalStateException ex) {
      String message = ex.getMessage();
      if (message.startsWith("Cannot resolve type description for ")) {
        return message.replace("Cannot resolve type description for ", "");
      } else {
        return "?";
      }
    }
  }

  private Utils() {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy