Compare commits

...

2 Commits

Author SHA1 Message Date
AsamK
f1de69d7ff Set same toolchain in lib module as in main module 2025-12-07 19:58:25 +01:00
AsamK
ba2214d8c7 Silence unchecked error 2025-12-07 19:47:53 +01:00
2 changed files with 7 additions and 4 deletions

View File

@ -7,8 +7,10 @@ java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
if (!JavaVersion.current().isCompatibleWith(targetCompatibility)) {
toolchain {
languageVersion.set(JavaLanguageVersion.of(targetCompatibility.majorVersion))
}
}
}

View File

@ -160,9 +160,10 @@ public class Utils {
return NetworkResultUtil.toBasicLegacy(response);
}
@SuppressWarnings("unchecked")
public static <T, E extends BadRequestError> T handleResponseException(final RequestResult<T, E> result) throws IOException {
if (result instanceof RequestResult.Success) {
return ((RequestResult.Success<T>) result).getResult();
if (result instanceof RequestResult.Success<?> success) {
return ((RequestResult.Success<T>) success).getResult();
} else if (result instanceof RequestResult.ApplicationError e) {
final var cause = e.getCause();
switch (cause) {