public static String renderLocation(final Location location) {
    String sourceName;
    try {
      sourceName = location.sourceName();
    } catch (Throwable e) {
      sourceName = "Unknown Source";
    }

    final StringBuilder methodName = new StringBuilder();
    try {
      methodName.append(location.declaringType().name());
    } catch (Throwable e) {
      methodName.append(e.getMessage());
    }
    methodName.append(".");
    try {
      methodName.append(location.method().name());
    } catch (Throwable e) {
      methodName.append(e.getMessage());
    }

    int lineNumber;
    try {
      lineNumber = location.lineNumber();
    } catch (Throwable e) {
      lineNumber = -1;
    }
    return DebuggerBundle.message(
        "export.threads.stackframe.format", methodName.toString(), sourceName, lineNumber);
  }
 public static String renderObject(ObjectReference monitor) {
   String monitorTypeName;
   try {
     monitorTypeName = monitor.referenceType().name();
   } catch (Throwable e) {
     monitorTypeName = "Error getting object type: '" + e.getMessage() + "'";
   }
   return DebuggerBundle.message(
       "threads.export.attribute.label.object-id",
       Long.toHexString(monitor.uniqueID()),
       monitorTypeName);
 }