Apply suggestions from code review
Co-authored-by: CyB3RC0nN0R <CyB3RC0nN0R@users.noreply.github.com>
This commit is contained in:
parent
cc17131003
commit
3c56cd5ff9
@ -41,5 +41,6 @@ public class GroupMessageStatusChangeEvent extends MessageStatusChangeEvent {
|
|||||||
public long getMemberID() { return memberID; }
|
public long getMemberID() { return memberID; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() { return String.format("GroupMessageStatusChangeEvent[meta=%s, memberID=%d]", super.toString(), memberID); }
|
public String toString() { return String.format("GroupMessageStatusChangeEvent[meta=%s,memberID=%d]", super.toString(), memberID); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@ public class GroupResizeEvent extends Event<User> {
|
|||||||
public GroupResizeEvent(User user, Group group, ElementOperation operation) {
|
public GroupResizeEvent(User user, Group group, ElementOperation operation) {
|
||||||
super(user);
|
super(user);
|
||||||
if (group.getContacts().contains(user)) {
|
if (group.getContacts().contains(user)) {
|
||||||
if (operation.equals(ElementOperation.ADD)) throw new IllegalStateException(
|
if (operation.equals(ElementOperation.ADD)) throw new IllegalArgumentException(
|
||||||
"Cannot add " + user + " to group " + group.getID() + " because he is already a member of this group");
|
"Cannot add " + user + " to group " + group.getID() + " because he is already a member of this group");
|
||||||
} else if (operation.equals(ElementOperation.REMOVE))
|
} else if (operation.equals(ElementOperation.REMOVE))
|
||||||
throw new IllegalStateException("Cannot remove " + user + " from group " + group.getID() + " because he is no part of this group");
|
throw new IllegalArgumentException("Cannot remove " + user + " from group " + group.getID() + " because he is no part of this group");
|
||||||
groupID = group.getID();
|
groupID = group.getID();
|
||||||
this.operation = operation;
|
this.operation = operation;
|
||||||
}
|
}
|
||||||
|
@ -16,12 +16,12 @@ public class HandshakeRejectionEvent extends Event<String> {
|
|||||||
/**
|
/**
|
||||||
* Select this value if a given password hash or user was incorrect.
|
* Select this value if a given password hash or user was incorrect.
|
||||||
*/
|
*/
|
||||||
public static final String WRONG_PASSWORD_OR_USER = "password or user were entered incorrectly";
|
public static final String WRONG_PASSWORD_OR_USER = "Incorrect user name or password.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select this value if the handshake could not be completed for some reason.
|
* Select this value if the handshake could not be completed for some reason.
|
||||||
*/
|
*/
|
||||||
public static final String INTERNAL_ERROR = "the process could not be finished as an internal error occurred";
|
public static final String INTERNAL_ERROR = "An internal error occured.";
|
||||||
|
|
||||||
private static final long serialVersionUID = 0L;
|
private static final long serialVersionUID = 0L;
|
||||||
|
|
||||||
|
@ -62,9 +62,6 @@ public class EnvoyLog {
|
|||||||
}
|
}
|
||||||
consoleHandler = new StreamHandler(System.out, formatter) {
|
consoleHandler = new StreamHandler(System.out, formatter) {
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void publish(LogRecord record) {
|
public synchronized void publish(LogRecord record) {
|
||||||
super.publish(record);
|
super.publish(record);
|
||||||
|
Reference in New Issue
Block a user