diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-29 14:11:59 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-09-29 15:11:59 +0300 |
commit | 3c7a9514117b348336b89306de735d92c8e9f463 (patch) | |
tree | 8f0eccfc3afa3cc47a97f565719295dd28926951 /server/src/main/java/com/vaadin/ui/declarative/Design.java | |
parent | 241b7fadca23259f300ed0e09cb2c27c8b55dcaf (diff) | |
download | vaadin-framework-3c7a9514117b348336b89306de735d92c8e9f463.tar.gz vaadin-framework-3c7a9514117b348336b89306de735d92c8e9f463.zip |
Use StandardCharsets.UTF_8 (#10113)
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/declarative/Design.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/declarative/Design.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java index 761ce3c355..65565eb47a 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/Design.java +++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui.declarative; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.beans.IntrospectionException; import java.io.IOException; import java.io.InputStream; @@ -67,8 +69,6 @@ import com.vaadin.util.ReflectTools; */ public class Design implements Serializable { - private static final String UTF8 = "UTF-8"; - /** * Callback for creating instances of a given component class when reading * designs. The default implementation, {@link DefaultComponentFactory} will @@ -392,7 +392,8 @@ public class Design implements Serializable { */ private static Document parse(InputStream html) { try { - Document doc = Jsoup.parse(html, UTF8, "", Parser.htmlParser()); + Document doc = Jsoup.parse(html, UTF_8.name(), "", + Parser.htmlParser()); return doc; } catch (IOException e) { throw new DesignException("The html document cannot be parsed."); @@ -808,7 +809,7 @@ public class Design implements Serializable { doc.outputSettings().indentAmount(4); doc.outputSettings().syntax(Syntax.html); doc.outputSettings().prettyPrint(true); - outputStream.write(doc.html().getBytes(UTF8)); + outputStream.write(doc.html().getBytes(UTF_8)); } private Design() { |