Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-05-19 19:14:53 +0000
committerFrank Becker2012-05-19 19:14:53 +0000
commitc2f129be1aacd844e4dfd1b7f18d00cd13a0787e (patch)
treec4115fb6501f66228ca8f06246d9762a0588c0ed
parent3d841d4928f92acd01b94514415a3fcd16a951e2 (diff)
downloadorg.eclipse.mylyn.commons-c2f129be1aacd844e4dfd1b7f18d00cd13a0787e.tar.gz
org.eclipse.mylyn.commons-c2f129be1aacd844e4dfd1b7f18d00cd13a0787e.tar.xz
org.eclipse.mylyn.commons-c2f129be1aacd844e4dfd1b7f18d00cd13a0787e.zip
ASSIGNED - bug 379619: clicking Validate Settings should temporarily
disable Validate on Finish https://bugs.eclipse.org/bugs/show_bug.cgi?id=379619
-rw-r--r--org.eclipse.mylyn.commons.net/src/org/eclipse/mylyn/commons/net/AuthenticationCredentials.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.commons.net/src/org/eclipse/mylyn/commons/net/AuthenticationCredentials.java b/org.eclipse.mylyn.commons.net/src/org/eclipse/mylyn/commons/net/AuthenticationCredentials.java
index 4c09ff53..5009748e 100644
--- a/org.eclipse.mylyn.commons.net/src/org/eclipse/mylyn/commons/net/AuthenticationCredentials.java
+++ b/org.eclipse.mylyn.commons.net/src/org/eclipse/mylyn/commons/net/AuthenticationCredentials.java
@@ -18,7 +18,7 @@ package org.eclipse.mylyn.commons.net;
* @since 2.2
* @noextend This class is not intended to be subclassed by clients.
*/
-public class AuthenticationCredentials {
+public class AuthenticationCredentials implements Comparable<AuthenticationCredentials> {
private final String userName;
@@ -88,4 +88,38 @@ public class AuthenticationCredentials {
return true;
}
+ /**
+ * @since 3.8
+ */
+ public int compareTo(AuthenticationCredentials obj) {
+ if (this == obj) {
+ return 0;
+ }
+ if (obj == null) {
+ return -1;
+ }
+ final AuthenticationCredentials other = obj;
+ if (password == null) {
+ if (other.password != null) {
+ return 1;
+ }
+ } else {
+ int temp = password.compareTo(other.password);
+ if (temp != 0) {
+ return temp;
+ }
+ }
+ if (userName == null) {
+ if (other.userName != null) {
+ return 1;
+ }
+ } else {
+ int temp = userName.compareTo(other.userName);
+ if (temp != 0) {
+ return temp;
+ }
+ }
+ return 0;
+ }
+
}

Back to the top