Skip to content
Snippets Groups Projects
Commit 690e3d17 authored by bontric's avatar bontric
Browse files

use final variables in store request

parent c3870951
Branches
No related tags found
No related merge requests found
...@@ -9,8 +9,8 @@ import javax.annotation.Nullable; ...@@ -9,8 +9,8 @@ import javax.annotation.Nullable;
import static org.briarproject.bramble.mailbox.protocol.MailboxMessage.TYPE.STORE; import static org.briarproject.bramble.mailbox.protocol.MailboxMessage.TYPE.STORE;
public class MailboxRequestStore extends MailboxRequest { public class MailboxRequestStore extends MailboxRequest {
private ContactId contactId; private final ContactId contactId;
private byte[] encryptedSyncStream; private final byte[] encryptedSyncStream;
public MailboxRequestStore(ContactId contactId, public MailboxRequestStore(ContactId contactId,
byte[] encryptedSyncMessage) { byte[] encryptedSyncMessage) {
...@@ -30,7 +30,7 @@ public class MailboxRequestStore extends MailboxRequest { ...@@ -30,7 +30,7 @@ public class MailboxRequestStore extends MailboxRequest {
BdfList body = msg.getList(2); BdfList body = msg.getList(2);
if(body.size() > 2) if (body.size() != 2)
throw new FormatException(); throw new FormatException();
Long cId = body.getOptionalLong(0); Long cId = body.getOptionalLong(0);
...@@ -38,7 +38,8 @@ public class MailboxRequestStore extends MailboxRequest { ...@@ -38,7 +38,8 @@ public class MailboxRequestStore extends MailboxRequest {
if (cId > Integer.MAX_VALUE || cId < Integer.MIN_VALUE) if (cId > Integer.MAX_VALUE || cId < Integer.MIN_VALUE)
throw new FormatException(); throw new FormatException();
contactId = new ContactId(cId.intValue()); contactId = new ContactId(cId.intValue());
} } else
contactId = null;
encryptedSyncStream = body.getRaw(1); encryptedSyncStream = body.getRaw(1);
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment