public String toString()

in core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/memleak/ReferenceTreeObject.java [326:364]


	public String toString(int displayFormatting) {
		String text = getType().getTypeName();
		if ((displayFormatting & ReferenceTreeObject.FORMAT_PACKAGE) != 0) {
			text = getType().getFullName();
		}
		if (this.getChildren().size() > 0 && getField() != null) {
			if ((displayFormatting & ReferenceTreeObject.FORMAT_FIELD) != 0) {
				text = text + "." + getField().getName(); //$NON-NLS-1$
			}
			if (getField().getModifier() != null) {
				String modifiers = Modifier.toString(getField().getModifier());
				if ((displayFormatting & ReferenceTreeObject.FORMAT_STATIC_MODIFIER) != 0
						&& (displayFormatting & ReferenceTreeObject.FORMAT_OTHER_MODIFIERS) == 0) {
					if (modifiers.contains("static")) { //$NON-NLS-1$
						text = "static " + text; //$NON-NLS-1$
					}
				} else if ((displayFormatting & ReferenceTreeObject.FORMAT_OTHER_MODIFIERS) != 0
						&& (displayFormatting & ReferenceTreeObject.FORMAT_STATIC_MODIFIER) == 0) {
					String nonStaticModifiers = modifiers.replaceAll("static ", ""); //$NON-NLS-1$ //$NON-NLS-2$
					if (!"".equals(nonStaticModifiers)) { //$NON-NLS-1$
						text = nonStaticModifiers + " " + text; //$NON-NLS-1$
					}
				} else if ((displayFormatting & ReferenceTreeObject.FORMAT_STATIC_MODIFIER) != 0
						&& (displayFormatting & ReferenceTreeObject.FORMAT_OTHER_MODIFIERS) != 0) {
					if (!"".equals(modifiers)) { //$NON-NLS-1$
						text = modifiers + " " + text; //$NON-NLS-1$
					}
				}
			}
		}
		if ((displayFormatting & ReferenceTreeObject.FORMAT_ARRAY_INFO) != 0 && this.getArray() != null) {
			if (text.endsWith("[]")) { //$NON-NLS-1$
				text = text.substring(0, text.length() - 1) + getArray().getIndex() + "/" + getArray().getSize() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
			} else {
				text = text + getArray().getIndex() + "/" + getArray().getSize(); //$NON-NLS-1$
			}
		}
		return text.trim();
	}