From f2e078ce6a1496410b7b51fad835ae72cc393182 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Sat, 3 Nov 2012 06:59:47 +0100 Subject: [PATCH] Print strings with quotation marks. --- .../java/com/comphenix/protocol/reflect/PrettyPrinter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/PrettyPrinter.java b/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/PrettyPrinter.java index f440cc3b..51f22558 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/PrettyPrinter.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/PrettyPrinter.java @@ -154,15 +154,17 @@ public class PrettyPrinter { // Just print primitive types if (value == 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); + } else if (type == String.class || hierachyIndex <= 0) { + output.append("\"" + value + "\""); } else if (type.isArray()) { printArray(output, value, type, stop, previous, hierachyIndex); } else if (Iterable.class.isAssignableFrom(type)) { printIterables(output, (Iterable) value, type, stop, previous, hierachyIndex); } else if (ClassLoader.class.isAssignableFrom(type) || previous.contains(value)) { // Don't print previous objects - output.append(value); + output.append("\"" + value + "\""); } else { output.append("{ "); printObject(output, value, value.getClass(), stop, previous, hierachyIndex);