Prints a constructor as
name("("arg(", "arg)*")")?

@param constructor
@return pretty string
968300
public static String print(Constructor constructor) {
        final StringBuilder builder = new StringBuilder(constructor.name);
        if (! constructor.args.isEmpty()) {
            builder.append("(");
            boolean first = true;
            for (Arg arg : constructor.args) {
                if (first) {
                    first = false;
                } else {
                    builder.append(", ");
                }
                builder.append(print(arg));
            }
            builder.append(")");
        }
        return builder.toString();
    }
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();
    }
520969
public static String getArgsTypeName(String[] argTypes) {
        if (argTypes != null) {
            return StringUtil.join(argTypes, ',');
        }
        return StringUtil.EMPTY;
    }
1023655
function (name, params) {
			var result = '<pre class="prettyprint">new ';

			if (name) {
				result += name + '(';
			}

			if (params) {
				params.forEach(function (element, index, array) {
					result += element.name;

					if (element.optional) {
						result += '?';
					}

					if (index < array.length - 1) {
						result += ', ';
					}
				});
			}

			if (name) {
				result += ')</pre>';
			}

			return result;
		}
713447
public function initConstructorArgs()
    {
        $constructor = $this->reflected->getConstructor();

        if (!is_null($constructor)) {
            // Index parameters by their names
            foreach ($constructor->getParameters() as $param) {
                $name = Util::snakeToCamelCase($param->getName());
                $this->constructorArgs[$name] = $param;
            }
        }
    }
1289939
def emptyPrinter(self, expr):
        """"""
        indent_str = "    " * (self._print_level - 1)
        lines = []
        if isinstance(expr.__class__, Singleton):
            # We exploit that Singletons override __expr__ to directly return
            # their name
            return indent_str + repr(expr)
        if isinstance(expr, Expression):
            args = expr.args
            keys = expr.minimal_kwargs.keys()
            lines.append(indent_str + expr.__class__.__name__ + "(")
            for arg in args:
                lines.append(self.doprint(arg) + ",")
            for key in keys:
                arg = expr.kwargs[key]
                lines.append(
                    ("    " * self._print_level) + key + '=' +
                    self.doprint(arg).lstrip() + ",")
            if len(args) > 0 or len(keys) > 0:
                lines[-1] = lines[-1][:-1]  # drop trailing comma for last arg
            lines[-1] += ")"
        elif isinstance(expr, (tuple, list)):
            delims = ("(", ")") if isinstance(expr, tuple) else ("[", "]")
            if len(expr) == 1:
                delims = (delims[0], "," + delims[1])
            lines.append(
                indent_str + delims[0] +
                ", ".join([render_head_repr(v) for v in expr]) +
                delims[1])
        else:
            lines.append(indent_str + SympyReprPrinter().doprint(expr))
        return "\n".join(lines)
159242
def argument_name_without_leading_underscore
      name = if argument_name_string[FIRST_CHARACTER] == UNDERSCORE
               argument_name_string.reverse.chop.reverse
             else
               argument_name_string
             end
      name.to_sym
    end
849582
public function getPrintableName() : string
    {
        $printables = array();

        foreach ($this->objects as $object)
        {
            $printables[] = $object->getPrintableName();
        }

        return '{'.implode(' xor ', $printables).'}';
    }
12099
def make_constructor_list(self, constructor_nodes, classname):
        """"""
        if constructor_nodes == []:
            return
        self.add_text(['\n', 'Constructors',
                       '\n', '------------'])
        for n in constructor_nodes:
            self.add_text('\n')
            self.add_line_with_subsequent_indent('* ' + self.get_function_signature(n))
            self.subnode_parse(n, pieces = [], indent=4, ignore=['definition', 'name'])
1155426
void writeConstructor(Definition def, Writer out, int indent) throws IOException
   {
      writeSimpleMethodSignature(out, indent, " * Default constructor", "public " + getClassName(def) + "()");
      writeLeftCurlyBracket(out, indent);

      writeWithIndent(out, indent + 1, "this.mbeanServer = null;\n");
      writeWithIndent(out, indent + 1, "this.objectName = \"" + def.getDefaultValue() + ",class=HelloWorld\";\n");
      writeWithIndent(out, indent + 1, "this.registered = false;\n\n");

      writeRightCurlyBracket(out, indent);
      writeEol(out);
   }
215433
public static String print(DeprData dd) {
        StringBuilder sb = new StringBuilder();
        sb.append(depr(dd.since, dd.forRemoval))
          .append(' ');

        switch (dd.kind) {
            case ANNOTATION_TYPE:
                sb.append("@interface ");
                sb.append(unslashify(dd.typeName));
                break;
            case CLASS:
                sb.append("class ");
                sb.append(unslashify(dd.typeName));
                break;
            case ENUM:
                sb.append("enum ");
                sb.append(unslashify(dd.typeName));
                break;
            case INTERFACE:
                sb.append("interface ");
                sb.append(unslashify(dd.typeName));
                break;

            case ENUM_CONSTANT:
            case FIELD:
                sb.append(unslashify(dd.typeName))
                  .append('.')
                  .append(dd.nameSig);
                break;
            case CONSTRUCTOR:
                Matcher cons = DESC_PAT.matcher(dd.nameSig);
                sb.append(unslashify(dd.typeName));
                if (cons.matches()) {
                    sb.append('(')
                      .append(parms(cons.group("args")))
                      .append(')');
                } else {
                    sb.append('.')
                      .append(dd.nameSig);
                }
                break;
            case METHOD:
                Matcher meth = DESC_PAT.matcher(dd.nameSig);
                if (meth.matches()) {
                    sb.append(desc(meth.group("return")))
                      .append(' ')
                      .append(unslashify(dd.typeName))
                      .append('.')
                      .append(meth.group("name"))
                      .append('(')
                      .append(parms(meth.group("args")))
                      .append(')');
                } else {
                    sb.append(unslashify(dd.typeName))
                      .append('.')
                      .append(dd.nameSig);
                }
                break;
        }

        return sb.toString();
    }
63921
private String printError(Throwable t) {

        StringBuffer result = new StringBuffer(1024);
        result.append("/*\n");
        result.append(CmsStringUtil.escapeHtml(t.getMessage()));
        result.append("\n*/\n");
        result.append("function init() {\n");
        result.append("}\n");
        return result.toString();
    }
1015080
public static String asString( Example example )
    {
        StringWriter sw = new StringWriter();
        PrintWriter writer = new PrintWriter( sw );
        example.print( writer );
        return sw.toString();
    }
1196847
@Override
	public String getName()
	{
		StringBuilder result = new StringBuilder();
		String prefix = "";

		for (IPOContext ctxt : this)
		{
			String name = ctxt.getName();

			if (name.length() > 0)
			{
				result.append(prefix);
				result.append(name);
				prefix = ", ";
			}
		}

		return result.toString();
	}
1356023
public static Enum<?>[][] explodeArguments(TestConstructor constructor) {
    checkNotNull(constructor, "constructor");

    return explodeParameters(constructor.getVariationTypes(),
        constructor.getName() + " constructor");
  }
1118056
public String print(String parameterName, String parameterValue)
    {
        // escape meaningfull strings
        String value = this.escaped.matcher(parameterValue).replaceAll(this.replacement);

        return parameterName + "=" + QUOTE + value + QUOTE;
    }
795906
function functionName(fn) {
  if (Function.prototype.name === undefined) {
    var funcNameRegex = /function\s([^(]{1,})\(/;
    var results = (funcNameRegex).exec((fn).toString());
    return (results && results.length > 1) ? results[1].trim() : "";
  }
  else if (fn.prototype === undefined) {
    return fn.constructor.name;
  }
  else {
    return fn.prototype.constructor.name;
  }
}