mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Code cleanup, complain about lack of unit tests.
This commit is contained in:
@@ -10,6 +10,7 @@ import org.briarproject.util.StringUtils;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static org.briarproject.api.db.Metadata.REMOVE;
|
||||
import static org.briarproject.data.Types.DICTIONARY;
|
||||
import static org.briarproject.data.Types.END;
|
||||
import static org.briarproject.data.Types.FALSE;
|
||||
@@ -39,7 +40,7 @@ class MetadataParserImpl implements MetadataParser {
|
||||
}
|
||||
|
||||
private Object parseObject(byte[] b) throws FormatException {
|
||||
if (b == null) return null;
|
||||
if (b == REMOVE) return null;
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(b);
|
||||
Object o = parseObject(in);
|
||||
if (in.available() > 0) throw new FormatException();
|
||||
|
||||
@@ -42,7 +42,8 @@ class AliceConnector extends Connector {
|
||||
Logger.getLogger(AliceConnector.class.getName());
|
||||
|
||||
AliceConnector(CryptoComponent crypto,
|
||||
BdfReaderFactory bdfReaderFactory, BdfWriterFactory bdfWriterFactory,
|
||||
BdfReaderFactory bdfReaderFactory,
|
||||
BdfWriterFactory bdfWriterFactory,
|
||||
StreamReaderFactory streamReaderFactory,
|
||||
StreamWriterFactory streamWriterFactory,
|
||||
AuthorFactory authorFactory, GroupFactory groupFactory,
|
||||
|
||||
@@ -42,7 +42,8 @@ class BobConnector extends Connector {
|
||||
Logger.getLogger(BobConnector.class.getName());
|
||||
|
||||
BobConnector(CryptoComponent crypto,
|
||||
BdfReaderFactory bdfReaderFactory, BdfWriterFactory bdfWriterFactory,
|
||||
BdfReaderFactory bdfReaderFactory,
|
||||
BdfWriterFactory bdfWriterFactory,
|
||||
StreamReaderFactory streamReaderFactory,
|
||||
StreamWriterFactory streamWriterFactory,
|
||||
AuthorFactory authorFactory, GroupFactory groupFactory,
|
||||
|
||||
@@ -83,7 +83,8 @@ abstract class Connector extends Thread {
|
||||
private volatile ContactId contactId = null;
|
||||
|
||||
Connector(CryptoComponent crypto,
|
||||
BdfReaderFactory bdfReaderFactory, BdfWriterFactory bdfWriterFactory,
|
||||
BdfReaderFactory bdfReaderFactory,
|
||||
BdfWriterFactory bdfWriterFactory,
|
||||
StreamReaderFactory streamReaderFactory,
|
||||
StreamWriterFactory streamWriterFactory,
|
||||
AuthorFactory authorFactory, GroupFactory groupFactory,
|
||||
@@ -147,8 +148,8 @@ abstract class Connector extends Thread {
|
||||
if (LOG.isLoggable(INFO)) LOG.info(pluginName + " sent key");
|
||||
}
|
||||
|
||||
protected byte[] receivePublicKey(BdfReader r) throws GeneralSecurityException,
|
||||
IOException {
|
||||
protected byte[] receivePublicKey(BdfReader r)
|
||||
throws GeneralSecurityException, IOException {
|
||||
byte[] b = r.readRaw(MAX_PUBLIC_KEY_LENGTH);
|
||||
keyParser.parsePublicKey(b);
|
||||
if (LOG.isLoggable(INFO)) LOG.info(pluginName + " received key");
|
||||
@@ -221,7 +222,8 @@ abstract class Connector extends Thread {
|
||||
return authorFactory.createAuthor(name, publicKey);
|
||||
}
|
||||
|
||||
protected void sendTimestamp(BdfWriter w, long timestamp) throws IOException {
|
||||
protected void sendTimestamp(BdfWriter w, long timestamp)
|
||||
throws IOException {
|
||||
w.writeInteger(timestamp);
|
||||
w.flush();
|
||||
if (LOG.isLoggable(INFO)) LOG.info(pluginName + " sent timestamp");
|
||||
@@ -236,7 +238,8 @@ abstract class Connector extends Thread {
|
||||
|
||||
protected void sendTransportProperties(BdfWriter w) throws IOException {
|
||||
w.writeListStart();
|
||||
for (Entry<TransportId, TransportProperties> e : localProps.entrySet()) {
|
||||
for (Entry<TransportId, TransportProperties> e :
|
||||
localProps.entrySet()) {
|
||||
w.writeString(e.getKey().getString());
|
||||
w.writeDictionary(e.getValue());
|
||||
}
|
||||
|
||||
@@ -78,7 +78,8 @@ class ConnectorGroup extends Thread implements InvitationTask {
|
||||
private String remoteName = null;
|
||||
|
||||
ConnectorGroup(CryptoComponent crypto,
|
||||
BdfReaderFactory bdfReaderFactory, BdfWriterFactory bdfWriterFactory,
|
||||
BdfReaderFactory bdfReaderFactory,
|
||||
BdfWriterFactory bdfWriterFactory,
|
||||
StreamReaderFactory streamReaderFactory,
|
||||
StreamWriterFactory streamWriterFactory,
|
||||
AuthorFactory authorFactory, GroupFactory groupFactory,
|
||||
|
||||
Reference in New Issue
Block a user