mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Use getInt() in a couple more places.
This commit is contained in:
@@ -73,7 +73,7 @@ class PayloadParserImpl implements PayloadParser {
|
||||
List<TransportDescriptor> recognised = new ArrayList<>();
|
||||
for (int i = 1; i < payload.size(); i++) {
|
||||
BdfList descriptor = payload.getList(i);
|
||||
long transportId = descriptor.getLong(0);
|
||||
int transportId = descriptor.getInt(0);
|
||||
if (transportId == TRANSPORT_ID_BLUETOOTH) {
|
||||
TransportId id = BluetoothConstants.ID;
|
||||
recognised.add(new TransportDescriptor(id, descriptor));
|
||||
|
||||
@@ -217,7 +217,7 @@ public class LanTcpPluginTest extends BrambleTestCase {
|
||||
// The plugin should have bound a socket and stored the port number
|
||||
BdfList descriptor = kal.getDescriptor();
|
||||
assertEquals(3, descriptor.size());
|
||||
assertEquals(TRANSPORT_ID_LAN, descriptor.getLong(0).longValue());
|
||||
assertEquals(TRANSPORT_ID_LAN, descriptor.getInt(0).intValue());
|
||||
byte[] address = descriptor.getRaw(1);
|
||||
InetAddress addr = InetAddress.getByAddress(address);
|
||||
assertTrue(addr instanceof Inet4Address);
|
||||
|
||||
@@ -76,7 +76,7 @@ class AvatarValidator implements MessageValidator {
|
||||
// 0.0: Message Type, Version, Content-Type
|
||||
checkSize(body, 3);
|
||||
// Message Type
|
||||
long messageType = body.getLong(0);
|
||||
long messageType = body.getInt(0);
|
||||
if (messageType != MSG_TYPE_UPDATE) throw new FormatException();
|
||||
// Version
|
||||
long version = body.getLong(1);
|
||||
|
||||
@@ -366,7 +366,7 @@ class PrivateGroupManagerImpl extends BdfIncomingMessageHook
|
||||
// parse the metadata
|
||||
for (Entry<MessageId, BdfDictionary> entry : metadata.entrySet()) {
|
||||
BdfDictionary meta = entry.getValue();
|
||||
if (meta.getLong(KEY_TYPE) == JOIN.getInt()) {
|
||||
if (meta.getInt(KEY_TYPE) == JOIN.getInt()) {
|
||||
headers.add(getJoinMessageHeader(txn, g, entry.getKey(),
|
||||
meta, authorInfos));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user