Address some deprecation warnings

This commit is contained in:
arkon 2023-06-30 22:14:17 -04:00
parent 7d26ca046f
commit b79ef5dc79
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,6 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import nl.adaptivity.xmlutil.XmlDeclMode import nl.adaptivity.xmlutil.XmlDeclMode
import nl.adaptivity.xmlutil.core.XmlVersion import nl.adaptivity.xmlutil.core.XmlVersion
import nl.adaptivity.xmlutil.serialization.UnknownChildHandler
import nl.adaptivity.xmlutil.serialization.XML import nl.adaptivity.xmlutil.serialization.XML
import tachiyomi.core.preference.AndroidPreferenceStore import tachiyomi.core.preference.AndroidPreferenceStore
import tachiyomi.core.preference.PreferenceStore import tachiyomi.core.preference.PreferenceStore
@ -110,10 +109,12 @@ class AppModule(val app: Application) : InjektModule {
} }
addSingletonFactory { addSingletonFactory {
XML { XML {
unknownChildHandler = UnknownChildHandler { _, _, _, _, _ -> emptyList() } defaultPolicy {
ignoreUnknownChildren()
}
autoPolymorphic = true autoPolymorphic = true
xmlDeclMode = XmlDeclMode.Charset xmlDeclMode = XmlDeclMode.Charset
indent = 4 indent = 2
xmlVersion = XmlVersion.XML10 xmlVersion = XmlVersion.XML10
} }
} }

View File

@ -168,7 +168,7 @@ internal object ExtensionLoader {
} }
.flatMap { .flatMap {
try { try {
when (val obj = Class.forName(it, false, classLoader).newInstance()) { when (val obj = Class.forName(it, false, classLoader).getDeclaredConstructor().newInstance()) {
is Source -> listOf(obj) is Source -> listOf(obj)
is SourceFactory -> obj.createSources() is SourceFactory -> obj.createSources()
else -> throw Exception("Unknown source class type! ${obj.javaClass}") else -> throw Exception("Unknown source class type! ${obj.javaClass}")