diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java b/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java index 209de1ed7..048abe737 100644 --- a/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java +++ b/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java @@ -19,7 +19,7 @@ import org.yaml.snakeyaml.Yaml; public class YamlStorageWriter implements IStorageWriter { - private transient static Pattern pattern = Pattern.compile("\\w"); + private transient static final Pattern NON_WORD_PATTERN = Pattern.compile("\\W"); private transient final PrintWriter writer; private transient static final Yaml YAML = new Yaml(); @@ -243,7 +243,7 @@ public class YamlStorageWriter implements IStorageWriter if (data instanceof String || data instanceof Boolean || data instanceof Number) { String output = data.toString(); - if (pattern.matcher(output).find()) + if (NON_WORD_PATTERN.matcher(output).find()) { writer.print('"'); writer.print(output.replace("\"", "\\\"")); |