Issue #3056 made venue participant equals method case insensitive
needed since collaboration server lower cases room names lower cased on creation so in memory matches what is on the server Former-commit-id:2a9d341910
[formerlybfd88f3e14
[formerly1adbf6253a
] [formerly2a9d341910
[formerly 7a2423f4a90597706e52ce0f89bacb1a0e10f067]]] Former-commit-id:bfd88f3e14
[formerly1adbf6253a
] Former-commit-id:bfd88f3e14
Former-commit-id:a5730ca7bd
This commit is contained in:
parent
caf4b280ba
commit
b0436d483a
2 changed files with 38 additions and 7 deletions
|
@ -21,7 +21,6 @@ package com.raytheon.uf.viz.collaboration.comm.provider.user;
|
|||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
@ -40,6 +39,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 29, 2014 bclement Initial creation
|
||||
* Feb 13, 2014 2751 bclement no longer is a subclass of UserId
|
||||
* Apr 22, 2014 3056 bclement made equals case insensitive
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -131,12 +131,38 @@ public class VenueParticipant implements IUser {
|
|||
if (!(obj instanceof VenueParticipant)) {
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* the xmpp server lower cases room names so we may get them back as
|
||||
* lower case when we have them locally as upper/mixed case. Treat case
|
||||
* insensitive.
|
||||
*/
|
||||
VenueParticipant other = (VenueParticipant) obj;
|
||||
EqualsBuilder builder = new EqualsBuilder();
|
||||
builder.append(handle, other.handle);
|
||||
builder.append(host, other.host);
|
||||
builder.append(room, other.room);
|
||||
return builder.isEquals();
|
||||
if (!stringFieldEquals(this.handle, other.handle)){
|
||||
return false;
|
||||
}
|
||||
if (!stringFieldEquals(this.room, other.room)) {
|
||||
return false;
|
||||
}
|
||||
if (!stringFieldEquals(this.host, other.host)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param field
|
||||
* @param other
|
||||
* @return true if both arguments are null or arguments are equal ignoring
|
||||
* case
|
||||
*/
|
||||
private boolean stringFieldEquals(String field, String other) {
|
||||
boolean rval;
|
||||
if (field == null) {
|
||||
rval = other == null;
|
||||
} else {
|
||||
rval = field.equalsIgnoreCase(other);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,6 +94,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
* Feb 11, 2014 2699 bclement require non-blank handle
|
||||
* Mar 06, 2014 2848 bclement moved session creation logic to separate method
|
||||
* Apr 16, 2014 3021 bclement increased width of dialog
|
||||
* Apr 22, 2014 3056 bclement made room name lowercase to match xmpp server
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -452,7 +453,11 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
List<String> errorMessages = new ArrayList<String>();
|
||||
String subject = subjectTF.getText().trim();
|
||||
String err = validateVenueName();
|
||||
String name = nameTF.getText();
|
||||
/*
|
||||
* xmpp server lowercases all room names, lowercase here to
|
||||
* match when we get names back from the server
|
||||
*/
|
||||
String name = nameTF.getText().toLowerCase();
|
||||
if (err != null) {
|
||||
focusField = nameTF;
|
||||
errorMessages.add(err);
|
||||
|
|
Loading…
Add table
Reference in a new issue