Restore Java example compatibility with Java 1.8.

This commit is contained in:
levlam 2022-07-21 20:44:22 +03:00
parent ffc26eea08
commit 376476481c

View File

@ -615,7 +615,7 @@ public final class Example {
}
private static void onFatalError(String errorMessage) {
final static class ThrowError implements Runnable {
final class ThrowError implements Runnable {
private final String errorMessage;
private final AtomicLong errorThrowTime;
@ -640,19 +640,19 @@ public final class Example {
throw new ExternalClientError("Fatal error: " + errorMessage);
}
private static final class ClientError extends Error {
final class ClientError extends Error {
private ClientError(String message) {
super(message);
}
}
private static final class ExternalClientError extends Error {
final class ExternalClientError extends Error {
public ExternalClientError(String message) {
super(message);
}
}
private static boolean isDatabaseBrokenError(String message) {
private boolean isDatabaseBrokenError(String message) {
return message.contains("Wrong key or database is corrupted") ||
message.contains("SQL logic error or missing database") ||
message.contains("database disk image is malformed") ||
@ -661,12 +661,12 @@ public final class Example {
message.contains("Database was corrupted and deleted during execution and can't be recreated");
}
private static boolean isDiskFullError(String message) {
private boolean isDiskFullError(String message) {
return message.contains("PosixError : No space left on device") ||
message.contains("database or disk is full");
}
private static boolean isDiskError(String message) {
private boolean isDiskError(String message) {
return message.contains("I/O error") || message.contains("Structure needs cleaning");
}
}