From fdd88aa530235913714df983957bd7bd6756335f Mon Sep 17 00:00:00 2001 From: Andreas Straub Date: Sun, 11 Oct 2015 16:04:31 +0200 Subject: Clean up Fixes some random linter warnings. --- .../conversations/crypto/axolotl/AxolotlService.java | 17 +++++------------ .../crypto/axolotl/SQLiteAxolotlStore.java | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index 70de2777..4319efb0 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -140,9 +140,6 @@ public class AxolotlService { putDevicesForJid(account.getJid().toBareJid().toString(), deviceIds, store); for (Contact contact : account.getRoster().getContacts()) { Jid bareJid = contact.getJid().toBareJid(); - if (bareJid == null) { - continue; // FIXME: handle this? - } String address = bareJid.toString(); deviceIds = store.getSubDeviceSessions(address); putDevicesForJid(address, deviceIds, store); @@ -162,7 +159,7 @@ public class AxolotlService { } } - private static enum FetchStatus { + private enum FetchStatus { PENDING, SUCCESS, ERROR @@ -212,14 +209,12 @@ public class AxolotlService { private Set findOwnSessions() { AxolotlAddress ownAddress = getAddressForJid(account.getJid().toBareJid()); - Set ownDeviceSessions = new HashSet<>(this.sessions.getAll(ownAddress).values()); - return ownDeviceSessions; + return new HashSet<>(this.sessions.getAll(ownAddress).values()); } private Set findSessionsforContact(Contact contact) { AxolotlAddress contactAddress = getAddressForJid(contact.getJid()); - Set sessions = new HashSet<>(this.sessions.getAll(contactAddress).values()); - return sessions; + return new HashSet<>(this.sessions.getAll(contactAddress).values()); } public Set getFingerprintsForOwnSessions() { @@ -509,10 +504,8 @@ public class AxolotlService { } public boolean isContactAxolotlCapable(Contact contact) { - Jid jid = contact.getJid().toBareJid(); - AxolotlAddress address = new AxolotlAddress(jid.toString(), 0); - return sessions.hasAny(address) || + return hasAny(contact) || (deviceIds.containsKey(jid) && !deviceIds.get(jid).isEmpty()); } @@ -796,7 +789,7 @@ public class AxolotlService { } public XmppAxolotlMessage.XmppAxolotlKeyTransportMessage processReceivingKeyTransportMessage(XmppAxolotlMessage message) { - XmppAxolotlMessage.XmppAxolotlKeyTransportMessage keyTransportMessage = null; + XmppAxolotlMessage.XmppAxolotlKeyTransportMessage keyTransportMessage; XmppAxolotlSession session = getReceivingSession(message); keyTransportMessage = message.getParameters(session, getOwnDeviceId()); diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/SQLiteAxolotlStore.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/SQLiteAxolotlStore.java index 4d779302..a7831718 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/SQLiteAxolotlStore.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/SQLiteAxolotlStore.java @@ -88,7 +88,6 @@ public class SQLiteAxolotlStore implements AxolotlStore { // -------------------------------------- private IdentityKeyPair loadIdentityKeyPair() { - String ownName = account.getJid().toBareJid().toString(); IdentityKeyPair ownKey = mXmppConnectionService.databaseBackend.loadOwnIdentityKeyPair(account); if (ownKey != null) { -- cgit v1.2.3