From 49678720c639b510f60cc91d3f66c71415bd61e4 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Thu, 26 Jan 2012 18:16:05 -0800 Subject: [PATCH] Only dump with comments if using YAMLFormat.EXTENDED --- src/main/java/com/sk89q/util/yaml/YAMLProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java b/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java index aac8132ba..fcec074df 100644 --- a/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java +++ b/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java @@ -75,6 +75,7 @@ public class YAMLProcessor extends YAMLNode { /* * Map from property key to comment. Comment may have multiple lines that are newline-separated. * Comments support based on ZerothAngel's AnnotatedYAMLConfiguration + * Comments are only supported with YAMLFormat.EXTENDED */ private final Map comments = new HashMap(); @@ -183,7 +184,7 @@ public class YAMLProcessor extends YAMLNode { writer.append(header); writer.append(LINE_BREAK); } - if (comments.size() == 0) { + if (comments.size() == 0 || format != YAMLFormat.EXTENDED) { yaml.dump(root, writer); } else { // Iterate over each root-level property and dump