mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01:00
Print strings with quotation marks.
This commit is contained in:
parent
72bfa3da9b
commit
f2e078ce6a
@ -154,15 +154,17 @@ public class PrettyPrinter {
|
|||||||
// Just print primitive types
|
// Just print primitive types
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
output.append("NULL");
|
output.append("NULL");
|
||||||
} else if (type.isPrimitive() || Primitives.isWrapperType(type) || type == String.class || hierachyIndex <= 0) {
|
} else if (type.isPrimitive() || Primitives.isWrapperType(type)) {
|
||||||
output.append(value);
|
output.append(value);
|
||||||
|
} else if (type == String.class || hierachyIndex <= 0) {
|
||||||
|
output.append("\"" + value + "\"");
|
||||||
} else if (type.isArray()) {
|
} else if (type.isArray()) {
|
||||||
printArray(output, value, type, stop, previous, hierachyIndex);
|
printArray(output, value, type, stop, previous, hierachyIndex);
|
||||||
} else if (Iterable.class.isAssignableFrom(type)) {
|
} else if (Iterable.class.isAssignableFrom(type)) {
|
||||||
printIterables(output, (Iterable) value, type, stop, previous, hierachyIndex);
|
printIterables(output, (Iterable) value, type, stop, previous, hierachyIndex);
|
||||||
} else if (ClassLoader.class.isAssignableFrom(type) || previous.contains(value)) {
|
} else if (ClassLoader.class.isAssignableFrom(type) || previous.contains(value)) {
|
||||||
// Don't print previous objects
|
// Don't print previous objects
|
||||||
output.append(value);
|
output.append("\"" + value + "\"");
|
||||||
} else {
|
} else {
|
||||||
output.append("{ ");
|
output.append("{ ");
|
||||||
printObject(output, value, value.getClass(), stop, previous, hierachyIndex);
|
printObject(output, value, value.getClass(), stop, previous, hierachyIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user