mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Code cleanup: "static final" is unnecessary in interfaces.
This commit is contained in:
@@ -9,48 +9,48 @@ interface DatabaseConstants {
|
||||
* device where the database is stored. Whenever less than this much space
|
||||
* is free, old messages will be expired from the database.
|
||||
*/
|
||||
static final long MIN_FREE_SPACE = 300 * 1024 * 1024; // 300 MiB
|
||||
long MIN_FREE_SPACE = 300 * 1024 * 1024; // 300 MiB
|
||||
|
||||
/**
|
||||
* The minimum amount of space in bytes that must be kept free on the device
|
||||
* where the database is stored. If less than this much space is free and
|
||||
* there are no more messages to expire, an Error will be thrown.
|
||||
*/
|
||||
static final long CRITICAL_FREE_SPACE = 100 * 1024 * 1024; // 100 MiB
|
||||
long CRITICAL_FREE_SPACE = 100 * 1024 * 1024; // 100 MiB
|
||||
|
||||
/**
|
||||
* The amount of free space will be checked whenever this many bytes of
|
||||
* messages have been added to the database since the last check.
|
||||
*/
|
||||
static final int MAX_BYTES_BETWEEN_SPACE_CHECKS = 5 * 1024 * 1024; // 5 MiB
|
||||
int MAX_BYTES_BETWEEN_SPACE_CHECKS = 5 * 1024 * 1024; // 5 MiB
|
||||
|
||||
/**
|
||||
* The amount of free space will be checked whenever this many milliseconds
|
||||
* have passed since the last check.
|
||||
*/
|
||||
static final long MAX_MS_BETWEEN_SPACE_CHECKS = 60L * 1000L; // 1 min
|
||||
long MAX_MS_BETWEEN_SPACE_CHECKS = 60L * 1000L; // 1 min
|
||||
|
||||
/**
|
||||
* Up to this many bytes of messages will be expired from the database each
|
||||
* time it is necessary to expire messages.
|
||||
*/
|
||||
static final int BYTES_PER_SWEEP = 5 * 1024 * 1024; // 5 MiB
|
||||
int BYTES_PER_SWEEP = 5 * 1024 * 1024; // 5 MiB
|
||||
|
||||
/**
|
||||
* The timestamp of the oldest message in the database is rounded using
|
||||
* this modulus to avoid revealing the presence of any particular message.
|
||||
*/
|
||||
static final long EXPIRY_MODULUS = 60L * 60L * 1000L; // 1 hour
|
||||
long EXPIRY_MODULUS = 60L * 60L * 1000L; // 1 hour
|
||||
|
||||
/**
|
||||
* A batch sent to a contact is considered lost when this many more
|
||||
* recently sent batches have been acknowledged.
|
||||
*/
|
||||
static final int RETRANSMIT_THRESHOLD = 5;
|
||||
int RETRANSMIT_THRESHOLD = 5;
|
||||
|
||||
/**
|
||||
* The time in milliseconds after which a subscription or transport update
|
||||
* should be sent to a contact even if no changes have occurred.
|
||||
*/
|
||||
static final long MAX_UPDATE_INTERVAL = 12L * 60L * 60L * 1000L; // 12 hours
|
||||
long MAX_UPDATE_INTERVAL = 12L * 60L * 60L * 1000L; // 12 hours
|
||||
}
|
||||
|
||||
@@ -2,28 +2,28 @@ package net.sf.briar.serial;
|
||||
|
||||
interface Tag {
|
||||
|
||||
static final byte FALSE = (byte) 0xFF; // 1111 1111
|
||||
static final byte TRUE = (byte) 0xFE; // 1111 1110
|
||||
static final byte INT8 = (byte) 0xFD; // 1111 1101
|
||||
static final byte INT16 = (byte) 0xFC; // 1111 1100
|
||||
static final byte INT32 = (byte) 0xFB; // 1111 1011
|
||||
static final byte INT64 = (byte) 0xFA; // 1111 1010
|
||||
static final byte FLOAT32 = (byte) 0xF9; // 1111 1001
|
||||
static final byte FLOAT64 = (byte) 0xF8; // 1111 1000
|
||||
static final byte STRING = (byte) 0xF7; // 1111 0111
|
||||
static final byte BYTES = (byte) 0xF6; // 1111 0110
|
||||
static final byte LIST = (byte) 0xF5; // 1111 0111
|
||||
static final byte MAP = (byte) 0xF4; // 1111 0100
|
||||
static final byte END = (byte) 0xF3; // 1111 0011
|
||||
static final byte NULL = (byte) 0xF2; // 1111 0010
|
||||
static final byte STRUCT = (byte) 0xF1; // 1111 0001
|
||||
byte FALSE = (byte) 0xFF; // 1111 1111
|
||||
byte TRUE = (byte) 0xFE; // 1111 1110
|
||||
byte INT8 = (byte) 0xFD; // 1111 1101
|
||||
byte INT16 = (byte) 0xFC; // 1111 1100
|
||||
byte INT32 = (byte) 0xFB; // 1111 1011
|
||||
byte INT64 = (byte) 0xFA; // 1111 1010
|
||||
byte FLOAT32 = (byte) 0xF9; // 1111 1001
|
||||
byte FLOAT64 = (byte) 0xF8; // 1111 1000
|
||||
byte STRING = (byte) 0xF7; // 1111 0111
|
||||
byte BYTES = (byte) 0xF6; // 1111 0110
|
||||
byte LIST = (byte) 0xF5; // 1111 0111
|
||||
byte MAP = (byte) 0xF4; // 1111 0100
|
||||
byte END = (byte) 0xF3; // 1111 0011
|
||||
byte NULL = (byte) 0xF2; // 1111 0010
|
||||
byte STRUCT = (byte) 0xF1; // 1111 0001
|
||||
|
||||
static final int SHORT_STRING = 0x80; // 1000 xxxx
|
||||
static final int SHORT_BYTES = 0x90; // 1001 xxxx
|
||||
static final int SHORT_LIST = 0xA0; // 1010 xxxx
|
||||
static final int SHORT_MAP = 0xB0; // 1011 xxxx
|
||||
static final int SHORT_STRUCT = 0xC0; // 110x xxxx
|
||||
int SHORT_STRING = 0x80; // 1000 xxxx
|
||||
int SHORT_BYTES = 0x90; // 1001 xxxx
|
||||
int SHORT_LIST = 0xA0; // 1010 xxxx
|
||||
int SHORT_MAP = 0xB0; // 1011 xxxx
|
||||
int SHORT_STRUCT = 0xC0; // 110x xxxx
|
||||
|
||||
static final int SHORT_MASK = 0xF0; // Match first four bits
|
||||
static final int SHORT_STRUCT_MASK = 0xE0; // Match first three bits
|
||||
int SHORT_MASK = 0xF0; // Match first four bits
|
||||
int SHORT_STRUCT_MASK = 0xE0; // Match first three bits
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user