mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Equals method must be symmetric and transitive.
This commit is contained in:
@@ -1207,7 +1207,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
t = new Transport(id);
|
||||
transports.add(t);
|
||||
}
|
||||
t.put(rs.getString(2), rs.getString(3));
|
||||
t.getProperties().put(rs.getString(2), rs.getString(3));
|
||||
lastId = id;
|
||||
}
|
||||
rs.close();
|
||||
@@ -2763,7 +2763,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
int batchSize = 0;
|
||||
for(Transport t : transports) {
|
||||
ps.setBytes(2, t.getId().getBytes());
|
||||
for(Entry<String, String> e1 : t.entrySet()) {
|
||||
for(Entry<String, String> e1 : t.getProperties().entrySet()) {
|
||||
ps.setString(3, e1.getKey());
|
||||
ps.setString(4, e1.getValue());
|
||||
ps.addBatch();
|
||||
|
||||
@@ -27,13 +27,13 @@ class GroupImpl implements Group {
|
||||
return publicKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Group && id.equals(((Group) o).getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Group && id.equals(((Group) o).getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,13 +71,13 @@ class MessageImpl implements Message {
|
||||
return bodyLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Message && id.equals(((Message) o).getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Message && id.equals(((Message) o).getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class ProtocolWriterImpl implements ProtocolWriter {
|
||||
for(Transport p : t.getTransports()) {
|
||||
w.writeStructId(Types.TRANSPORT);
|
||||
w.writeBytes(p.getId().getBytes());
|
||||
w.writeMap(p);
|
||||
w.writeMap(p.getProperties());
|
||||
}
|
||||
w.writeListEnd();
|
||||
w.writeInt64(t.getTimestamp());
|
||||
|
||||
Reference in New Issue
Block a user