diff --git a/.classpath b/.classpath index 43b52b8..2c86875 100644 --- a/.classpath +++ b/.classpath @@ -21,7 +21,6 @@ - diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 08f7658..1dda271 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,22 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/envoy/data/GroupMessage.java b/src/main/java/envoy/data/GroupMessage.java index b1c05ce..234c354 100644 --- a/src/main/java/envoy/data/GroupMessage.java +++ b/src/main/java/envoy/data/GroupMessage.java @@ -27,11 +27,12 @@ public final class GroupMessage extends Message { * * @param id unique ID * @param senderID the ID of the user who sends the message - * @param recipientID the ID of the user who receives the message + * @param groupID the ID of the group which receives the message * @param creationDate the creation date of the message * @param text the text content of the message * @param attachment the attachment of the message, if present - * @param status the current {@link MessageStatus} of the message + * @param status the current {@link Message.MessageStatus} of the + * message * @param forwarded whether this message was forwarded * @param memberStatuses a map of all members and their status according to this * {@link GroupMessage} diff --git a/src/main/java/envoy/data/LoginCredentials.java b/src/main/java/envoy/data/LoginCredentials.java index 438dd15..e097047 100644 --- a/src/main/java/envoy/data/LoginCredentials.java +++ b/src/main/java/envoy/data/LoginCredentials.java @@ -30,16 +30,22 @@ public class LoginCredentials implements Serializable { * @param password the password of the user (will be converted to a hash) * @param registration signifies that these credentials are used for user * registration instead of user login - * @throws NoSuchAlgorithmException if the algorithm used is unknown * @since Envoy Common v0.2-alpha */ - public LoginCredentials(String identifier, char[] password, boolean registration) throws NoSuchAlgorithmException { + public LoginCredentials(String identifier, char[] password, boolean registration) { this.identifier = identifier; passwordHash = getSha256(toByteArray(password)); this.registration = registration; } - private byte[] getSha256(byte[] input) throws NoSuchAlgorithmException { return MessageDigest.getInstance("SHA-256").digest(input); } + private byte[] getSha256(byte[] input) { + try { + return MessageDigest.getInstance("SHA-256").digest(input); + } catch (NoSuchAlgorithmException e) { + // This will never happen + throw new RuntimeException(e); + } + } private byte[] toByteArray(char[] chars) { byte[] bytes = new byte[chars.length * 2];