fix(config): 修复因使用了错误的 Gson 对象而导致的配置初始化警告.

导致的原因是在初始化 app.json 时错误的使用了 botConfigGson, 而 botConfigGson 未配置用于 MetricsServer 的 UsernameAuthenticator 序列化器, 导致在初始化配置文件中序列化 AppConfig 时, Gson 会反射调用 BasicAuthenticator, 导致被 Java 模块系统拦截并报错, 现已修复该问题.
This commit is contained in:
LamGC 2022-07-02 22:01:05 +08:00
parent 27dc26160d
commit 9b7fc30512
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -114,7 +114,7 @@ internal enum class AppPaths(
CONFIG_APPLICATION({ "$DATA_ROOT/config.json" }, { CONFIG_APPLICATION({ "$DATA_ROOT/config.json" }, {
if (!file.exists()) { if (!file.exists()) {
file.bufferedWriter(StandardCharsets.UTF_8).use { file.bufferedWriter(StandardCharsets.UTF_8).use {
GsonConst.botConfigGson.toJson( GsonConst.appConfigGson.toJson(
AppConfig( AppConfig(
mavenRepositories = listOf( mavenRepositories = listOf(
MavenRepositoryConfig( MavenRepositoryConfig(