Method used to print out traced objects which recognizes and handles arrays and throwables.

@param objs
@return String
15987
public String formatObj(Object objs) {

        String ans = "";

        final String nlPad;

        // Pad amount changes based on trace format
        if (TraceFormat.ADVANCED.equals(traceFormat)) {
            nlPad = nlAdvancedPadding;
        } else if (TraceFormat.BASIC.equals(traceFormat)) {
            nlPad = nlBasicPadding;
        } else {
            nlPad = nlEnhancedPadding;
        }

        final String nlPadA = nlPad + " ";

        if (objs != null) {
            if (objs.getClass().isArray()) {
                StringBuilder sb = new StringBuilder();
                final int len = Array.getLength(objs);

                if (objs.getClass().getName().equals("[B")) { // Byte array
                    final int COLUMNS = 32;

                    byte b[] = (byte[]) objs;
                    int printLen = len > LoggingConstants.MAX_DATA_LENGTH ? LoggingConstants.MAX_DATA_LENGTH : len;
                    sb.append(nlPad).append(objs.toString()).append(",len=").append(len);

                    for (int i = 0; i < printLen; i++) {
                        if (i % COLUMNS == 0) // offset
                            sb.append(nlPadA + '|' + DataFormatHelper.padHexString(i, 4) + '|');

                        if (i % 4 == 0) // group in words
                            sb.append(" ");

                        sb.append(hexChars[(b[i] >> 4) & 0xF]);
                        sb.append(hexChars[b[i] & 0xF]);
                    }

                    if (printLen != len)
                        sb.append(nlPadA).append(" ...");
                } else if (objs.getClass().getName().equals("[C")) {
                    // Character array - Just print it as a string rather than a single
                    // character on each line
                    sb.append((char[]) objs);
                } else { // not a Byte or char array
                    for (int i = 0; i < len; i++) {
                        String s = formatObj(Array.get(objs, i));
                        if (s.startsWith(LoggingConstants.nl))
                            sb.append(s);
                        else
                            sb.append(nlPad + s);

                        if (sb.length() > LoggingConstants.MAX_DATA_LENGTH) {
                            sb.append(nlPad + "...");
                            break;
                        }
                    }
                }

                ans = sb.toString();
            } else if (objs instanceof Untraceable) {
                ans = nlPad + objs.getClass().getName(); // Use only the class name of the object
            } else if (objs instanceof Traceable) {
                ans = nlPad + formatTraceable((Traceable) objs);
            } else if (objs instanceof TruncatableThrowable) {
                ans = nlPad + DataFormatHelper.throwableToString((TruncatableThrowable) objs);
            } else if (objs instanceof Throwable) {
                ans = nlPad + DataFormatHelper.throwableToString(new TruncatableThrowable((Throwable) objs));
            } else {
                try { // Protect ourselves from badly behaved toString methods
                    ans = nlPad + objs.toString();
                } catch (Exception e) {
                    // No FFDC code needed
                    ans = "<Exception " + e + " caught while calling toString() on object " + objs.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(objs))
                          + ">";
                }
            }
        } else {
            // objs is null - print out "null"
            ans = nlPad + nullParamString;
        }

        return ans;
    }
792000
protected function renderObjects()
    {
        $clusterString = '';

        foreach ($this->objects as $ns => $objects) {
            $undeclared = false;
            if (!empty($ns)) {
                $clusterString .= $this->formatLine('namespace ' . str_replace('\\', '.', $ns) . ' %fillcolor% {');
            }
            foreach ($objects as $shortName => $values) {
                $clusterString .= $values['pre'];
                if ($values['undeclared']) {
                    $undeclared = true;
                }
            }

            if (!empty($ns)) {
                if ($undeclared) {
                    // set background-color of undeclared namespace elements
                    $clusterString = str_replace('%fillcolor%', '#EB937F', $clusterString);
                } else {
                    $clusterString = str_replace('%fillcolor%', '', $clusterString);
                }

                $clusterString .= $this->formatLine('}');
            }
        }
        return $clusterString;
    }
1324357
public function renderBeforeSuite($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeSuite($obj);
        }

        return $print;
    }
978496
public function renderAfterStep($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderAfterStep($obj);
        }

        return $print;
    }
276598
public static Object[] toArray(Object obj)
	{
		if (obj instanceof Object[])
			return (Object[]) obj;
		else
		{
			Object[] returnArray =
			{ obj };
			return returnArray;

		}
	}
1184656
public static Object[] wrap(Object obj) {
		if (null == obj) {
			return null;
		}
		if (isArray(obj)) {
			try {
				return (Object[]) obj;
			} catch (Exception e) {
				final String className = obj.getClass().getComponentType().getName();
				switch (className) {
				case "long":
					return wrap((long[]) obj);
				case "int":
					return wrap((int[]) obj);
				case "short":
					return wrap((short[]) obj);
				case "char":
					return wrap((char[]) obj);
				case "byte":
					return wrap((byte[]) obj);
				case "boolean":
					return wrap((boolean[]) obj);
				case "float":
					return wrap((float[]) obj);
				case "double":
					return wrap((double[]) obj);
				default:
					throw new UtilException(e);
				}
			}
		}
		throw new UtilException(StrUtil.format("[{}] is not Array!", obj.getClass()));
	}
1311317
def debug_object(obj: T) -> str:
    """"""
    pairs = []
    for k, v in vars(obj).items():
        pairs.append(u"{}={}".format(k, v))
    return u", ".join(pairs)
401608
function format(obj)
{
  var output;

  if (typeOf(obj) == 'object' || typeOf(obj) == 'array' || typeOf(obj) == 'null')
  {
    output = JSON.stringify(obj);
  }
  else if (typeOf(obj) != 'undefined')
  {
    output = obj.toString();
  }
  else
  {
    output = '';
  }

  return output;
}
1211648
@Override
	public void visitMethod(Method obj) {
		try {
			if (obj.isSynthetic()) {
				return;
			}

			if (Values.CONSTRUCTOR.equals(getMethodName()) && javaClass.getClassName().contains("$")) {
				return;
			}

			List<String> types = SignatureUtils.getParameterSignatures(obj.getSignature());
			if ((types.isEmpty()) || (types.size() > 2)) {
				return;
			}

			if ((obj.getAccessFlags() & Const.ACC_VARARGS) != 0) {
				return;
			}

			String lastParmSig = types.get(types.size() - 1);
			if (!lastParmSig.startsWith(Values.SIG_ARRAY_PREFIX)
					|| lastParmSig.startsWith(Values.SIG_ARRAY_OF_ARRAYS_PREFIX)) {
				return;
			}

			if (SignatureBuilder.SIG_BYTE_ARRAY.equals(lastParmSig)
					|| SignatureBuilder.SIG_CHAR_ARRAY.equals(lastParmSig)) {
				return;
			}

			if (hasSimilarParms(types)) {
				return;
			}

			if (obj.isStatic() && "main".equals(obj.getName()) && SIG_STRING_ARRAY_TO_VOID.equals(obj.getSignature())) {
				return;
			}

			if (!obj.isPrivate() && !obj.isStatic() && isInherited(obj)) {
				return;
			}

			super.visitMethod(obj);
			bugReporter.reportBug(new BugInstance(this, BugType.UVA_USE_VAR_ARGS.name(), LOW_PRIORITY).addClass(this)
					.addMethod(this));

		} catch (ClassNotFoundException cnfe) {
			bugReporter.reportMissingClass(cnfe);
		}
	}
865028
public function renderAfterExercise($obj)
    {
        $strFeatPassed = count($obj->getPassedFeatures());
        $strFeatFailed = count($obj->getFailedFeatures());
        $strScePassed = count($obj->getPassedScenarios());
        $strScePending = count($obj->getPendingScenarios());
        $strSceFailed = count($obj->getFailedScenarios());
        $strStepsPassed = count($obj->getPassedSteps());
        $strStepsPending = count($obj->getPendingSteps());
        $strStepsSkipped = count($obj->getSkippedSteps());
        $strStepsFailed = count($obj->getFailedSteps());

        $featTotal = (count($obj->getFailedFeatures()) + count($obj->getPassedFeatures()));
        $sceTotal = (count($obj->getFailedScenarios()) + count($obj->getPendingScenarios()) + count($obj->getPassedScenarios()));
        $stepsTotal = (count($obj->getFailedSteps()) + count($obj->getPassedSteps()) + count($obj->getSkippedSteps()) + count($obj->getPendingSteps()));

        $print = $featTotal.','.$strFeatPassed.','.$strFeatFailed."\n";
        $print .= $sceTotal.','.$strScePassed.','.$strScePending.','.$strSceFailed."\n";
        $print .= $stepsTotal.','.$strStepsPassed.','.$strStepsFailed.','.$strStepsSkipped.','.$strStepsPending."\n";
        $print .= $obj->getTimer().','.$obj->getMemory()."\n";

        return $print;
    }
849120
public String getNameByReflection(Object obj)
    {
        Object name = null;
        try {
            java.lang.reflect.Method method = obj.getClass().getMethod("getName");
            
            if (method != null)
                name = method.invoke(obj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (name == null)
            return null;
        else
            return name.toString();
    }
351260
public static String toJson(Object obj) {
		try {
			return objectMapper.writeValueAsString(obj);
		} catch (JsonProcessingException e) {
			throw new RuntimeException(e);
		}
	}
892078
def print_object_results(obj_result):
    
    print_results_header(obj_result.object_id, obj_result.is_valid)

    if obj_result.warnings:
        print_warning_results(obj_result, 1)
    if obj_result.errors:
        print_schema_results(obj_result, 1)
640266
public static String traceOutput(Map<String, Object> properties) {
    SortedSet<String> propertyNames = new TreeSet<>(properties.keySet());
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    Iterator<String> propertyNameIterator = propertyNames.iterator();
    while (propertyNameIterator.hasNext()) {
      String propertyName = propertyNameIterator.next();
      sb.append(propertyName).append(": ");
      appendValue(sb, properties.get(propertyName));
      if (propertyNameIterator.hasNext()) {
        sb.append(", ");
      }
    }
    sb.append("}");
    return sb.toString();
  }
333474
function formatOutput(obj) {
	if (argv.m) {
		return JSON.stringify(obj);
	}
	return JSON.stringify(obj, null, 2);
}
537081
function(obj) {

        if (Array.isArray(obj)) {

            return {

                at: function(skip, pos) { return obj[pos] },
                rest: function(skip, pos) { return obj.slice(pos) }
            };
        }

        var iter = toObject(obj)[Symbol.iterator]();

        return {

            at: function(skip) {

                var r;

                while (skip--)
                    r = iter.next();

                return r.value;
            },

            rest: function(skip) {

                var a = [], r;

                while (--skip)
                    r = iter.next();

                while (r = iter.next(), !r.done)
                    a.push(r.value);

                return a;
            }
        };
    }
159910
protected String toFFDCStringSingleObject(Object obj)
  {
    if (obj == null)
    {
      return "<null>";
    }
    else if (obj instanceof Traceable)
    {
      return ((Traceable) obj).toTraceString();
    }
    else if (obj instanceof String)
    {
      return ((String) obj);
    }
    else if (obj instanceof byte[])
    {
      return toFFDCString((byte[]) obj);
    }
    else
    {
      return obj.toString();
    }
  }