Only use DatatypeConverter as a fallback

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2022-11-12 14:48:42 +00:00
parent 8a81aaaa0a
commit 7534eaf006
6 changed files with 67 additions and 24 deletions

View File

@@ -59,27 +59,10 @@ public final class SkinFix implements Fix, URLStreamHandlerFactory {
@Override
public boolean isApplicable(Parameters params) {
if (!isSupported()) {
Log.warning("Using Java 8 will probably fix this");
Log.warning("Alternatively, turning off legacy skin fix in Settings > Miscellaneous will silence the warnings");
return false;
}
return true;
}
private boolean isSupported() {
// check for DatatypeConverter first
// most users will just be annoyed by the big stacktrace
try {
Class.forName("javax.xml.bind.DatatypeConverter");
} catch (ClassNotFoundException e) {
Log.warning("Cannot find DatatypeConverter - required for skin fix");
return false;
}
if (!UrlUtils.isSupported()) {
Log.warning("Cannot access the necessary Java internals for skin fix");
Log.warning("Using an older Java version will probably fix this");
Log.warning("Alternatively, turning off legacy skin fix in Settings > Miscellaneous will silence the warnings");
return false;
}