From 6d0bf04c1eb7f309a568ad99973eea02e8ea692a Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 13 Dec 2019 18:30:43 +0100 Subject: [PATCH] Improve Javadoc readability by adding separating lines --- .../omemo/signal/SignalCachingOmemoStore.java | 1 + .../smackx/omemo/OmemoManager.java | 19 ++++++++++++ .../smackx/omemo/OmemoMessage.java | 9 ++++++ .../smackx/omemo/OmemoRatchet.java | 2 ++ .../smackx/omemo/OmemoService.java | 23 +++++++++++++++ .../jivesoftware/smackx/omemo/OmemoStore.java | 29 +++++++++++++++++++ .../exceptions/StaleDeviceException.java | 3 ++ .../UntrustedOmemoIdentityException.java | 1 + .../listener/OmemoMucMessageListener.java | 2 ++ .../smackx/omemo/util/OmemoConstants.java | 1 + .../smackx/omemo/util/OmemoKeyUtil.java | 9 ++++++ .../omemo/util/OmemoMessageBuilder.java | 4 +++ 12 files changed, 103 insertions(+) diff --git a/smack-omemo-signal/src/main/java/org/jivesoftware/smackx/omemo/signal/SignalCachingOmemoStore.java b/smack-omemo-signal/src/main/java/org/jivesoftware/smackx/omemo/signal/SignalCachingOmemoStore.java index 084d95f2b..135bd96fb 100644 --- a/smack-omemo-signal/src/main/java/org/jivesoftware/smackx/omemo/signal/SignalCachingOmemoStore.java +++ b/smack-omemo-signal/src/main/java/org/jivesoftware/smackx/omemo/signal/SignalCachingOmemoStore.java @@ -44,6 +44,7 @@ public class SignalCachingOmemoStore extends CachingOmemoStore getDevicesOf(BareJid contact) throws IOException { @@ -300,6 +303,7 @@ public final class OmemoManager extends Manager { * @param recipient recipients bareJid * @param message text to encrypt * @return encrypted message + * * @throws CryptoFailedException when something crypto related fails * @throws UndecidedOmemoIdentityException When there are undecided devices * @throws InterruptedException if the calling thread was interrupted. @@ -323,6 +327,7 @@ public final class OmemoManager extends Manager { * @param recipients recipients barejids * @param message text to encrypt * @return encrypted message. + * * @throws CryptoFailedException When something crypto related fails * @throws UndecidedOmemoIdentityException When there are undecided devices. * @throws InterruptedException if the calling thread was interrupted. @@ -349,6 +354,7 @@ public final class OmemoManager extends Manager { * @param muc multiUserChat * @param message message to send * @return encrypted message + * * @throws UndecidedOmemoIdentityException when there are undecided devices. * @throws CryptoFailedException if the OMEMO cryptography failed. * @throws XMPPException.XMPPErrorException if there was an XMPP error returned. @@ -403,6 +409,7 @@ public final class OmemoManager extends Manager { * * @param mamQuery The MAM query * @return list of decrypted OmemoMessages + * * @throws SmackException.NotLoggedInException if the Manager is not authenticated. * @throws IOException if an I/O error occurred. */ @@ -431,6 +438,7 @@ public final class OmemoManager extends Manager { * Distrust the fingerprint/OmemoDevice tuple. * The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must * be of length 64. + * * @param device device * @param fingerprint fingerprint */ @@ -446,6 +454,7 @@ public final class OmemoManager extends Manager { * Returns true, if the fingerprint/OmemoDevice tuple is trusted, otherwise false. * The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must * be of length 64. + * * @param device device * @param fingerprint fingerprint * @return true if this is a trusted OMEMO identity. @@ -462,6 +471,7 @@ public final class OmemoManager extends Manager { * Returns true, if the fingerprint/OmemoDevice tuple is decided by the user. * The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must * be of length 64. + * * @param device device * @param fingerprint fingerprint * @return true if the trust is decided for the identity. @@ -479,6 +489,7 @@ public final class OmemoManager extends Manager { * secrecy. * * @param recipient recipient + * * @throws CorruptedOmemoKeyException When the used identityKeys are corrupted * @throws CryptoFailedException When something fails with the crypto * @throws CannotEstablishOmemoSessionException When we can't establish a session with the recipient @@ -511,6 +522,7 @@ public final class OmemoManager extends Manager { * * @param contact contact * @return true if contact has at least one OMEMO capable device. + * * @throws SmackException.NotConnectedException if the XMPP connection is not connected. * @throws InterruptedException if the calling thread was interrupted. * @throws SmackException.NoResponseException if there was no response from the remote entity. @@ -551,6 +563,7 @@ public final class OmemoManager extends Manager { * @param connection XMPPConnection * @param server domainBareJid of the server to test * @return true if server supports pep + * * @throws XMPPException.XMPPErrorException if there was an XMPP error returned. * @throws SmackException.NotConnectedException if the XMPP connection is not connected. * @throws InterruptedException if the calling thread was interrupted. @@ -614,6 +627,7 @@ public final class OmemoManager extends Manager { /** * Return all OmemoFingerprints of active devices of a contact. * TODO: Make more fail-safe + * * @param contact contact * @return Map of all active devices of the contact and their fingerprints. * @@ -661,6 +675,7 @@ public final class OmemoManager extends Manager { /** * Remove an OmemoMessageListener. + * * @param listener OmemoMessageListener */ public void removeOmemoMessageListener(OmemoMessageListener listener) { @@ -678,6 +693,7 @@ public final class OmemoManager extends Manager { /** * Remove an OmemoMucMessageListener. + * * @param listener OmemoMucMessageListener */ public void removeOmemoMucMessageListener(OmemoMucMessageListener listener) { @@ -688,6 +704,7 @@ public final class OmemoManager extends Manager { * Request a deviceList update from contact contact. * * @param contact contact we want to obtain the deviceList from. + * * @throws InterruptedException if the calling thread was interrupted. * @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node. * @throws XMPPException.XMPPErrorException if there was an XMPP error returned. @@ -750,6 +767,7 @@ public final class OmemoManager extends Manager { /** * Return true, if the given Stanza contains an OMEMO element 'encrypted'. + * * @param stanza stanza * @return true if stanza has extension 'encrypted' */ @@ -812,6 +830,7 @@ public final class OmemoManager extends Manager { /** * Set the deviceId of the manager to nDeviceId. + * * @param nDeviceId new deviceId */ synchronized void setDeviceId(int nDeviceId) { diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoMessage.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoMessage.java index a1486d900..e2eb8635a 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoMessage.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoMessage.java @@ -82,6 +82,7 @@ public class OmemoMessage { /** * Create a new outgoing OMEMO message. + * * @param element OmemoElement * @param key messageKey (or transported key) * @param iv initialization vector belonging to key @@ -97,6 +98,7 @@ public class OmemoMessage { /** * Return a list of all devices the sender originally intended to encrypt the message for. + * * @return list of intended recipients. */ public Set getIntendedDevices() { @@ -105,6 +107,7 @@ public class OmemoMessage { /** * Return a map of all skipped recipients and the reasons for skipping. + * * @return map of skipped recipients and reasons for that. */ public HashMap getSkippedDevices() { @@ -113,6 +116,7 @@ public class OmemoMessage { /** * Determine, if some recipients were skipped during encryption. + * * @return true if recipients were skipped. */ public boolean isMissingRecipients() { @@ -156,6 +160,7 @@ public class OmemoMessage { /** * Create a new incoming OMEMO message. + * * @param element original OmemoElement * @param key message key (or transported key) * @param iv respective initialization vector @@ -174,6 +179,7 @@ public class OmemoMessage { /** * Return the decrypted body of the message. + * * @return decrypted body */ public String getBody() { @@ -182,6 +188,7 @@ public class OmemoMessage { /** * Return the fingerprint of the messages sender device. + * * @return fingerprint of sender */ public OmemoFingerprint getSendersFingerprint() { @@ -199,6 +206,7 @@ public class OmemoMessage { /** * Return true, if this message was sent as a preKeyMessage. + * * @return preKeyMessage or not */ boolean isPreKeyMessage() { @@ -208,6 +216,7 @@ public class OmemoMessage { /** * Return true, if the message was a KeyTransportMessage. * A KeyTransportMessage is a OmemoMessage without a payload. + * * @return keyTransportMessage? */ public boolean isKeyTransportMessage() { diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoRatchet.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoRatchet.java index e00815283..838784806 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoRatchet.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoRatchet.java @@ -86,6 +86,7 @@ public abstract class OmemoRatchet Elliptic Curve PublicKey class * @param Bundle class * @param Cipher class + * * @author Paul Schaub */ public abstract class OmemoService @@ -113,10 +114,12 @@ public abstract class OmemoService> omemoRatchets = new HashMap<>(); protected OmemoService() { + } /** * Return the singleton instance of this class. When no instance is set, throw an IllegalStateException instead. + * * @return instance. */ public static OmemoService getInstance() { @@ -226,6 +229,7 @@ public abstract class OmemoServiceXEP-0384: Sending a key. * * @param managerGuard Initialized OmemoManager. @@ -572,9 +579,11 @@ public abstract class OmemoService getUndecidedDevices(OmemoDevice userDevice, OmemoTrustCallback callback, Set devices) throws IOException { @@ -871,6 +885,7 @@ public abstract class OmemoService Elliptic Curve PublicKey class * @param Bundle class * @param Cipher class + * * @author Paul Schaub */ public abstract class OmemoStore { @@ -68,6 +69,7 @@ public abstract class OmemoStore preKeyHashMap) throws IOException { @@ -449,6 +469,7 @@ public abstract class OmemoStore loadOmemoPreKeys(OmemoDevice userDevice) throws IOException; @@ -473,6 +494,7 @@ public abstract class OmemoStore loadOmemoSignedPreKeys(OmemoDevice userDevice) throws IOException; @@ -497,6 +519,7 @@ public abstract class OmemoStore loadAllRawSessionsOf(OmemoDevice userDevice, BareJid contact) throws IOException; @@ -535,6 +560,7 @@ public abstract class OmemoStore bundles(OmemoBundleElement bundle, OmemoDevice contact) throws CorruptedOmemoKeyException { @@ -138,6 +140,7 @@ public abstract class OmemoKeyUtilOMEMO security audit. * * @param message plaintext message + * * @throws NoSuchPaddingException if the requested padding mechanism is not availble. * @throws InvalidAlgorithmParameterException if the provided arguments are invalid. * @throws InvalidKeyException if the key is invalid. @@ -210,6 +212,7 @@ public class OmemoMessageBuilder