Consistently use character encoding constants
Use the java.nio.charset.StandardCharsets.{ISO_8859_1,UTF_8} constants' name() methods instead of hard-coding the strings. Where possible, use method variants that take a Charset rather than a String. This removes the need to catch UnsupportedEncodingException in some cases. Change-Id: I4ac1ba0a753de715e1f38ce631842f527b9e127c
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
package com.google.gerrit.server.util;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.gerrit.common.Die;
|
||||
import com.google.gerrit.server.config.GerritServerConfig;
|
||||
@@ -60,7 +62,7 @@ public class SystemLog {
|
||||
final DailyRollingFileAppender dst = new DailyRollingFileAppender();
|
||||
dst.setName(name);
|
||||
dst.setLayout(layout);
|
||||
dst.setEncoding("UTF-8");
|
||||
dst.setEncoding(UTF_8.name());
|
||||
dst.setFile(resolve(logdir).resolve(name).toString());
|
||||
dst.setImmediateFlush(true);
|
||||
dst.setAppend(true);
|
||||
|
Reference in New Issue
Block a user