builder:CheckstyleWriter: use UTF-8 encoding to load XML template

This commit is contained in:
Paul Campbell 2017-01-06 22:36:52 +00:00
parent be2e92bdb6
commit c027c372d8

View file

@ -87,7 +87,8 @@ class CheckstyleWriter implements CommandLineRunner {
val checkstyleXmlTemplate = templateProperties.getCheckstyleXml();
if (checkstyleXmlTemplate.toFile()
.exists()) {
val template = new String(Files.readAllBytes(checkstyleXmlTemplate));
val bytes = Files.readAllBytes(checkstyleXmlTemplate);
val template = new String(bytes, StandardCharsets.UTF_8);
val output = Arrays.asList(String.format(template, checkerRules, treeWalkerRules)
.split(NEWLINE));
log.info("Writing xmlFile: {}", xmlFile);